# Compute the second order Taylor polynomial centered at 2 for ln(x)

1. Apr 15, 2013

### Lo.Lee.Ta.

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

a. Compute the second order Taylor polynomial centered at 2, P2(x), for the function ln(x).

b. Estimate the maximum error of the answer to part a for x in the interval [1,2].

2. Relevant equations

3. The attempt at a solution

For part a, I'm thinking that when it says "second order Taylor polynomial," it's talking about writing out the terms to the second derivative... Is that right?

c0 = f(0)(x) = ln(x) → ln(x)/0!

c1 = f(1)(x) = 1/x → 1/x/(1!)

c2 = f(2)(x) = -1/x2 → -1/x2/(2!) = -1/2x2

P2(x) = ln(x)*(x-2)0 + (1/x)*(x-2)1 - (1/2x2)*(x-2)2

P2(x) = ln(x) + 1 - 2/x -1/2 + 2/x - 2/x2

= ln(x) - 2/x2 + 1/2

I'm not very confident in this answer, and don't want to proceed until I figure this out...
I feel like I'm supposed to get an actual number here...
How else would I be able to calculate the max error if I don't have a number?

When it says "centered at 2," that doesn't mean the x is 2, does it? I thought it meant that only the a is 2. Is this right?

Thanks! :)

Last edited by a moderator: Apr 16, 2013
2. Apr 15, 2013

### Staff: Mentor

Yes.
The above are not right.
"Centered at 2" means that a = 2, and that your polynomial will be in powers of (x - 2).

So c0 = f(2)/0! = ln(2)
c1 = f'(2)/1!
And so on.
No, you're supposed to get a polynomial function of degree 2.
There should be a theorem in your book, near the Taylor Series theorem, that tells you how to estimate the error when you approximate a function by a finite-degree polynomial.
Correct - it means that a = 2, but it doesn't mean that x = 2. Typically x will be somewhere close to a.

3. Apr 15, 2013

### Lo.Lee.Ta.

Are you plugging in 2 for x because it is a 2nd degree polynomial?

4. Apr 15, 2013

### SammyS

Staff Emeritus
$\displaystyle f(x)=f(a)+f'(a)(x-a)+\frac{f''(a)}{2!}(x-a)^2+\frac{f'''(a)}{3!}(x-a)^3+\dots$

"Centered about 2" means that a = 2.

Second order means taking terms through x2 .

Edited to correct a couple of typos. DUH !

Last edited: Apr 16, 2013
5. Apr 15, 2013

### Lo.Lee.Ta.

Well, assuming we replace x with 2 because it's a second order Taylor polynomial, I get:

c0 = [f(0)(x)]/0! = ln(x)/0! = ln(2)

c1 = [f(1)(x)]/1! = 1/x/1! = 1/2

c2 = [f(2)(x)]/2! = -1/2x2 = -1/8

P2(x) = ln(2)*(x-2)0 + 1/2*(x-2)1 - 1/8*(x-2)2

= ln(2) + 1/2x - 1 - 1/8x2 + 1/2x - 1/4

= -1/8x2 + x - 5/4 + ln(2)

Is this right...?

6. Apr 15, 2013

### Lo.Lee.Ta.

SammyS- well, then why do we replace x with 2???

7. Apr 15, 2013

### Staff: Mentor

You don't. You replace a with 2. The polynomial will still have x in it.

8. Apr 15, 2013

### Staff: Mentor

There's a small mistake in all three of these lines.

c0 = f(a)/0! = f(2)/0!= ln(2)
c1 = f'(a)/1! = f'(2)/1! = 1/2
c2 = f''(a)/2! = f''(2)/2! = -1/8
You should leave it in the first form, in powers of x - 2.
So P2(x) = ln(2) + (1/2)(x - 2) - (1/8)(x - 2)2

9. Apr 15, 2013

### Lo.Lee.Ta.

Oh! Thanks, Mark44!

It's f(n)(a), NOT f(n)(x)!

That's where my confusion was!

Okay, I'll remember to leave it in the unsimplified form.

Now, let me try part b.
I'm trying to find the maximum error for x over the interval [1,2]
1 is my x, and 2 is my a.

z is any point between by interval 1 and 2, so 1 ≤ z ≤ 2.

Rn = $\frac{f^{n+1}(z)}{(n+1)!}$*(x-c)n+1

[f(3)(z)/3!]*(1-2)3

c3 = f(3)(a)/3! = 2/x3*(1/6) = 1/3x3

Substituting z for x...

1/3z3*(-1)

Now, don't we say z is equal to 1 because that will tell us the maximum error. 2 is the value we substituted for a, so we don't want to use 2.
Is this right...?
Or is z just always 1?

1/3(1)3*(-1) = -1/3 maximum error

Is this right?

If this is right, does it mean that the 2nd degree polynomial
(ln(2)*(x-2)0 + 1/2(x-2)1 - 1/8(x-2)2) is off by 1/3 when it approximates ln(x)...?

It makes sense when the polynomial has an x-value that's plugged in, making the answer a number. Because then you can say the max error is answer +/- 1/3.

It makes no sense that a polynomial can be +/- 1/3.

Thanks!!!

10. Apr 16, 2013

### Lo.Lee.Ta.

Am I calculating the maximum error right? :/

11. Apr 16, 2013

### Staff: Mentor

No, 1 and 2 are the endpoints of the interval. They don't correspond to either a or x.
???
c3 doesn't enter into things here.

Since you're approximating by a polynomial of degree 2, you're trying to find lower and upper bounds for R2(x), which will involve f(3)(z) = 2z-3, where z is between 1 and 2.

So R2(x) = $\frac{2z^{-3}}{3!} * (x - 2)^3$, for some number z, 1 ≤ z ≤ 2.

What's the largest possible value for 2z-3/6 on the interval [1, 2]? If the function is increasing, the largest value comes at the right endpoint. If the function is decreasing, the largest value comes at the left endpoint.