# Calculus II - Taylor Series

1. Aug 19, 2011

### GreenPrint

New Question (Changed Old one) - Taylor Polynomial - Upper Bound for Absolute Error

1. The problem statement, all variables and given/known data

(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

2. Relevant 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

3. 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)

(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: Aug 19, 2011
2. Aug 19, 2011

### GreenPrint

Last edited: Aug 19, 2011
3. Aug 19, 2011

### micromass

Staff Emeritus
Re: New Question (Changed Old one) - Taylor Polynomial - Upper Bound for Absolute Err

Huh? How did you conclude that. Your remainder $R_3(x)$ is correct. So the upper bound is simply $R_3(1.1)$. I don't see what infinity has to do with all of this...

4. Aug 19, 2011

### GreenPrint

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. Aug 19, 2011

### micromass

Staff Emeritus
Yes, that's the idea!

6. Aug 19, 2011

### vela

Staff Emeritus
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: Aug 19, 2011
7. Aug 19, 2011

### GreenPrint

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. Aug 19, 2011

### vela

Staff Emeritus
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 $\lvert\pi^4 \sin \pi x\rvert$. At $x=\pi$, 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 $M=\pi^4 \sin 1.1\pi$ 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 $\sin 1.1\pi$ equals, otherwise you wouldn't be trying to approximate it, so that expression for M doesn't seem so useful. But you can say $\lvert\sin \pi x\rvert \le \lvert \pi(x-1) \rvert$ when x is close to 1 (just look at a graph of the two functions), so $\lvert\pi^4 \sin 1.1\pi \rvert \le \pi^5 \lvert x-1 \rvert = 0.1\pi^5 = M$ 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: Aug 19, 2011
9. Aug 19, 2011

### GreenPrint

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. Aug 19, 2011

### vela

Staff Emeritus
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. Aug 19, 2011

### GreenPrint

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. Aug 19, 2011

### vela

Staff Emeritus
No. What does Taylor's theorem say about the remainder?

13. Aug 19, 2011

### GreenPrint

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. Aug 19, 2011

### micromass

Staff Emeritus

$$R_n(x)=\frac{f(c)^{(n+1)}(x-a)^{n+1}}{(n+1)!}$$

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

$$|R_n(x)|\leq \frac{\pi^4 (x-a)^{n+1}}{(n+1)!}$$

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

15. Aug 19, 2011

### GreenPrint

$$|R_n(x)|\leq \frac{M (x-a)^{n+1}}{(n+1)!}$$

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

$$|R_n(x)|\leq \frac{M |x-a|^{n+1}}{(n+1)!}$$

16. Aug 19, 2011

### micromass

Staff Emeritus
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 But your $M=\pi^4$ seems quite small.

So yes, jjust plug in x now.

17. Aug 19, 2011

### micromass

Staff Emeritus
Yes, I'm sorry, the absolute value is necessary. A typo of mine...

18. Aug 19, 2011

### GreenPrint

I think I get it now. Thanks for the help.

19. Aug 19, 2011

### vela

Staff Emeritus
As you wrote in the original post, the remainder is the difference between the actual function, f(x), and the Taylor polynomial Pn(x):$$R_n(x) = f(x)-P_n(x)$$So for this problem, you have$$R_n(1.1) = f(1.1)-P_n(1.1)$$The theorem tells you$$R_n(x) = \frac{f^{(n+1)}(c)(x-a)^{n+1}}{(n+1)!}$$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$$|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)!}$$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.