How Accurate is the Taylor Polynomial for Approximating Sin Functions?

In summary: And in order to find what M should be, you're going to need to use a bound like the one I just gave to find something you can use to estimate \lvert\sin \pi x\rvert. Alternatively, you could just write the remainder as \lvert f^{(n+1)}(c)/ (n+1)! \rvert \lvert x-a\rvert^{n+1}, and then you don't have to worry about what M is. You just need some bound for \lvert f^{(n+1)}(c)\rvert. In this case, it's the same as before, but you don't have to go through the rig
  • #1
GreenPrint
1,196
0
New Question (Changed Old one) - Taylor Polynomial - Upper Bound for Absolute Error

Homework Statement



(a) Find the 3-rd degree Taylor polynomial of sin(pix) centered at x=1.

(b) Use (a) to approximate sin(1.1*pi)

(c) Use the remainder term to find an upper bound for the absolute error in this approximation

Homework Equations



Estimate of the Remainder
Let n be a fixed positive integer. Suppose there exists a number M such that |f(x)^(n+1)| <= M for all c between a and x inclusive. the remainder in the nth-order Taylor polynomial for f centered at a satisfies
|Rn(x)| = |f(x) - Pn(x)| <= (M|x-a|^(n+1))/(n+1)!

Remainder in a Taylor Polynomial
Let Pn be the Taylor polynomial of order n for f. The remainder in using Pn to approximate f at the point x is
Rn(x) = f(x) - Pn(x)

Taylor Polynomials
Let f be a function with f', f'', ..., f^(n) defined at a. The nth-order Taylor polynomial for f with its center a, denoted Pn, has the property that it matches f in value, slope and all derivatives up to the nth derivative at a; that is,
Pn(x) = sigma[k=0,n] ck (x-a)^k, where the coefficients are
ck = f(a)^k/k!, for k = 0, 1 2, ..., n

Taylor's Theorem
Let f have continuous derivatives up to f^(n+1) on an open interval I containing a. For all x in I,
f(x) = Pn(x) + Rn(x),
where Pn is the nth-order Taylor polynomial for f centered at a, and the remainder is
Rn(x) = ( f(x)^(n+1)*(x-a)^(n+1) )/(n+1)!,
for some point c between x and a

The Attempt at a Solution



(a) Find the 3-rd degree Taylor polynomial of sin(pix) centered at x=1.

f(x) = sin(pix), df(x)/dx = pi cos(pix), d^2f(x)/dx^2 = -pi^2*sin(pix), d^3f(x)/dx^3 = -pi^3*cos(pix), f(1) = 0, df(1)/dx = -pi, d^2f(1)/dx^2 = 0, d^3f(1)/dx^3 = pi^3

P3(x) = -pi(x-1) + (pi^3*(x-1)^3)/6

(b) Use (a) to approximate sin(1.1*pi)

P3(1.1) is about -.309

(c) Use the remainder term to find an upper bound for the absolute error in this approximation

d^4f(x)/dx^4 = pi^4*sin(pix), |d^4f(x)/dx^4| <= pi^4 = M
R3(x) <= ( pi^4 |x-1|^4 )/4!

So I take it that sense the maximum value of R3(x) occurs at R3(inf) which has a value of infinity I say that the upper bound is infinity? I think I may be doing something wrong

I apologize for posting a post #2 I had to change some things around because I original had asked a different question but found the answer myself, so instead of creating another topic I just edited this one post for my new question that I seem to be struggling with.
 
Last edited:
Physics news on Phys.org
  • #2
Please see post #1.
 
Last edited:
  • #3


GreenPrint said:
So I take it that sense the maximum value of R3(x) occurs at R3(inf) which has a value of infinity I say that the upper bound is infinity? I think I may be doing something wrong

Huh? How did you conclude that. Your remainder [itex]R_3(x)[/itex] is correct. So the upper bound is simply [itex]R_3(1.1)[/itex]. I don't see what infinity has to do with all of this...
 
  • #4
I thought I had to find the maximum value of this
R3(x) <= ( pi^4 |x-1|^4 )/4!
but I can just plug in 1.1?
 
  • #5
Yes, that's the idea!
 
  • #6
GreenPrint said:
Estimate of the Remainder
Let n be a fixed positive integer. Suppose there exists a number M such that |f(x)^(n+1)| <= M for all c between a and x inclusive. the remainder in the nth-order Taylor polynomial for f centered at a satisfies
|Rn(x)| = |f(x) - Pn(x)| <= (M|x-a|^(n+1))/(n+1)!

GreenPrint said:
I thought I had to find the maximum value of this
R3(x) <= ( pi^4 |x-1|^4 )/4!
but I can just plug in 1.1?
You want to maximize the function |f(n+1)(x)| on the interval [1, 1.1]. One end of the interval is the point you're expanding about, and the other end is the point you're evaluating the polynomial at.
 
Last edited:
  • #7
So you don't necessarily just plug in the value your evaluating at, in this case 1.1, but what ever value from were the polynomial is centered at to the value that you were being asked to estimate, in this case [1,1.1] and this is why you plug in 1.1, because ( pi^4 |x-1|^4 )/4! attains it's maximum value on [1,1.1] at the value of 1.1... ?

So I could have cases were I don't necessarily plug in the value I'm trying to estimate into the remainder expression just what ever value from [a, c] were a is the value were the polynomial is centered at, and c is the value that you plugged into the Taylor polynomial to get an estimate of?
 
  • #8
Just to keep your variable straight, a is the point your expanding about; x is the point you're approximating the function at; and c is some point in the interval [a,x].

M is an upper bound for |f(n+1)(x)|. That's the function you're interested in maximizing. In this case, as you noted, it would be [itex]\lvert\pi^4 \sin \pi x\rvert[/itex]. At [itex]x=\pi[/itex], that function vanishes, and you know over the interval [1, 1.1] it's strictly increasing, which is why you know x=1.1 is where it reaches a maximum. If you had a function that wiggled more, the maximum could occur somewhere in the middle of the interval instead of at an endpoint. So in this case, you know [itex]M=\pi^4 \sin 1.1\pi[/itex] will work (which is actually a bit better than the estimate for M you're using by about a factor of 3).

Presumably, you don't know what [itex]\sin 1.1\pi[/itex] equals, otherwise you wouldn't be trying to approximate it, so that expression for M doesn't seem so useful. But you can say [itex]\lvert\sin \pi x\rvert \le \lvert \pi(x-1) \rvert[/itex] when x is close to 1 (just look at a graph of the two functions), so [itex]\lvert\pi^4 \sin 1.1\pi \rvert \le \pi^5 \lvert x-1 \rvert = 0.1\pi^5 = M[/itex] would work.

At this point, you're done with finding a maximum. Now you just plug the values you're given and your estimate for M into the formula for the remainder. In this problem, you're given x=1.1, so that's what you use.
 
Last edited:
  • #9
vela said:
Just to keep your variable straight, a...over the interval [1, 1.1] it's strictly increasing, which is why you know x=1.1 is where it reaches a maximum. If you had a function that wiggled more, the maximum could occur somewhere in the middle of the interval instead of at an endpoint... At this point, you're done with finding a maximum. Now you just plug the values you're given and your estimate for M into the formula for the remainder. In this problem, you're given x=1.1, so that's what you use.

I'm just trying to fully understand this, you don't plug in x=1.1 because this is what your given into the remainder equation, but you do so because it's the value on [1,1.1] in which the equation for the remainder achieves it's maximum value? I'm sort of unsure based on that.
 
  • #10
You're not trying to maximize R(x). (If anything, you want to minimize it.) You need to estimate the maximum of f(n+1)(x) on [a,x] to find M.
 
  • #11
vela said:
You're not trying to maximize R(x). (If anything, you want to minimize it.) You need to estimate the maximum of f(n+1)(x) on [a,x] to find M.

So I can plug in any value between [a,x] including either a or x? Sorry my book didn't do that great job explaining this at all. But sense we want to minimize this value I should plug in the value that will minimize it but it doesn't really matter if you don't?
 
  • #12
No. What does Taylor's theorem say about the remainder?
 
  • #13
My book says

"the remainder is
Rn(x) = ( f(x)^(n+1)*(x-a)^(n+1) )/(n+1)!,
for some point c between x and a"

So I take it I'm not suppose to plug in either x or a but c, which is some value between x and a, any value at all?
 
  • #14
GreenPrint said:
My book says

"the remainder is
Rn(x) = ( f(x)^(n+1)*(x-a)^(n+1) )/(n+1)!,
for some point c between x and a"

So I take it I'm not suppose to plug in either x or a but c, which is some value between x and a, any value at all?

No, your book probably says

[tex]R_n(x)=\frac{f(c)^{(n+1)}(x-a)^{n+1}}{(n+1)!}[/tex]

But c is not known, so you can only find an upper bound of it. In this case, [itex]\pi^4[/itex] is an upper bound, so

[tex]|R_n(x)|\leq \frac{\pi^4 (x-a)^{n+1}}{(n+1)!}[/tex]

And now you just need to plug in 1.1 to find the answer.
 
  • #15
micromass said:
No, your book probably says

[tex]R_n(x)=\frac{f(c)^{(n+1)}(x-a)^{n+1}}{(n+1)!}[/tex]

But c is not known, so you can only find an upper bound of it. In this case, [itex]\pi^4[/itex] is an upper bound, so

[tex]|R_n(x)|\leq \frac{\pi^4 (x-a)^{n+1}}{(n+1)!}[/tex]

And now you just need to plug in 1.1 to find the answer.

[tex]|R_n(x)|\leq \frac{M (x-a)^{n+1}}{(n+1)!}[/tex]

Thanks for your response. So I can always just plug in x, the value I was trying to make an estimate for, in this case 1.1, into the equation above when asked for a upper bound? I don't have to try to maximize or minimize this function in any way or shape or form?

Is the absolute value function not necessary because my book has the function as

[tex]|R_n(x)|\leq \frac{M |x-a|^{n+1}}{(n+1)!}[/tex]
 
  • #16
GreenPrint said:
[tex]|R_n(x)|\leq \frac{M (x-a)^{n+1}}{(n+1)!}[/tex]

Thanks for your response. So I can always just plug in x, the value I was trying to make an estimate for, in this case 1.1, into the equation above when asked for a upper bound? I don't have to try to maximize or minimize this function in any way or shape or form?

No, the only thing you have to worry about is to choose M as small as you can. Obviously, choosing M=10000000000000000 is correct here but wouldn't convey much useful information :smile: But your [itex]M=\pi^4[/itex] seems quite small.

So yes, jjust plug in x now.
 
  • #17
GreenPrint said:
Is the absolute value function not necessary because my book has the function as

[tex]|R_n(x)|\leq \frac{M |x-a|^{n+1}}{(n+1)!}[/tex]

Yes, I'm sorry, the absolute value is necessary. A typo of mine...
 
  • #18
I think I get it now. Thanks for the help.
 
  • #19
GreenPrint said:
[tex]|R_n(x)|\leq \frac{M (x-a)^{n+1}}{(n+1)!}[/tex]

Thanks for your response. So I can always just plug in x, the value I was trying to make an estimate for, in this case 1.1, into the equation above when asked for a upper bound? I don't have to try to maximize or minimize this function in any way or shape or form?
As you wrote in the original post, the remainder is the difference between the actual function, f(x), and the Taylor polynomial Pn(x):[tex]R_n(x) = f(x)-P_n(x)[/tex]So for this problem, you have[tex]R_n(1.1) = f(1.1)-P_n(1.1)[/tex]The theorem tells you[tex]R_n(x) = \frac{f^{(n+1)}(c)(x-a)^{n+1}}{(n+1)!}[/tex]where c is between x and a. The problem is, you don't know what c is, but if you could find a number M such that M≥|f(n+1)(z)| for all z in [a,x], you can say[tex]|R_n(x)| = \left\lvert \frac{f^{(n+1)}(c)(x-a)^{n+1}}{(n+1)!} \right\rvert \le \frac{M \lvert x-a \rvert^{n+1}}{(n+1)!}[/tex]The problem now is to find a suitable M. It needs to be big enough so it bounds |f(n+1)| from above, but you want to find an M as small as possible so that your estimate for the remainder is actually useful. One approach is to find the maximum |f(n+1)| attains on [a,x] and use that for M. Since it's the maximum, it obviously bounds the function from above, and it's the smallest M that does that. However, sometimes, like when f(n+1) is complicated, finding the maximum is more trouble than it's worth, so you find a possible M another way, like you did in this problem.
 

Related to How Accurate is the Taylor Polynomial for Approximating Sin Functions?

1. What is a Taylor Series?

A Taylor Series is a mathematical representation of a function as an infinite sum of polynomials, which are derived from the function's derivatives at a specific point.

2. How is a Taylor Series calculated?

A Taylor Series is calculated using the formula: f(x) = f(a) + f'(a)(x-a) + f''(a)(x-a)^2/2! + f'''(a)(x-a)^3/3! + ... where a is the point at which the derivatives are evaluated.

3. What is the purpose of a Taylor Series?

The purpose of a Taylor Series is to approximate a function with a polynomial that becomes more accurate as more terms are added. This allows for easier calculation and analysis of complex functions.

4. What is the difference between a Taylor Series and a Maclaurin Series?

A Taylor Series is centered around a specific point, while a Maclaurin Series is centered around x = 0. This means that a Maclaurin Series is a special case of a Taylor Series.

5. Can a Taylor Series be used to find the value of a function at a point?

Yes, a Taylor Series can be used to approximate the value of a function at a specific point. By adding more terms to the series, the approximation becomes more accurate.

Similar threads

  • Calculus and Beyond Homework Help
Replies
27
Views
2K
  • Calculus and Beyond Homework Help
Replies
6
Views
2K
  • Calculus and Beyond Homework Help
Replies
2
Views
1K
  • Calculus and Beyond Homework Help
Replies
8
Views
2K
  • Calculus and Beyond Homework Help
Replies
3
Views
441
  • Calculus and Beyond Homework Help
Replies
5
Views
1K
  • Calculus and Beyond Homework Help
Replies
3
Views
1K
  • Calculus and Beyond Homework Help
Replies
10
Views
1K
  • Calculus and Beyond Homework Help
Replies
5
Views
2K
  • Calculus and Beyond Homework Help
Replies
6
Views
4K
Back
Top