<<

9.3 Taylor’s Theorem: Error Analysis for

Tacoma Narrows Bridge: November 7, 1940 Last time in BC… So the for ln x centered at x = 1 is given by… (x −1)2 (x −1)3 (x −1)4 f (x) = ln x = (x − )1 − + − ... 2 3 4 n ∞ (x −1) = ∑(− )1 n+1 n=1 n Use the first two terms of the Taylor Series for ln x centered at x = 1 to approximate:

3 5.1( − )1 2 0.25 ln ≈ 5.1( − )1 − = 5.0 − = .0 375 2 2 2

1 5.0( − )1 2 25.0 ln ≈ 5.0( − )1 − = − 5.0 − = − .0 625 2 2 2 Recall that the Taylor Series for ln x centered at x = 1 is given by… (x −1)2 (x −1)3 (x −1)4 ∞ (x −1)n f (x) = ln x = (x −1) − + − ... = ∑(−1)n +1 2 3 4 n =1 n Find the maximum error bound for each . Because the series is alternating, we can start with…

3 5.1( − )1 3 ln → error ≤ = .0 0417 2 3 actual error =| ln( )5.1 − .0 625 |= .0 03047

1 5.0( − )1 3 ln → error ≤ = .0 0417 2 3 actual error =| ln( )5.0 − (− .0 625 |) = .0 068147

Wait! How is the actual error bigger than the error bound for ln 0.5? And now, the exciting conclusion of Chapter 9… Since each term of a convergent moves the partial sum a little closer to the limit: Alternating Series Estimation Theorem For a convergent alternating series, the truncation error is less than the first missing term, and is the same sign as that term.

This is also a good tool to remember because it is easier than the Lagrange Error Bound…which you’ll find out about soon enough…

Muhahahahahahaaa! Taylor’s Theorem with Remainder If f has of all orders in an open I containing a, then for each positive integer n and for each x in I:

()n f′′ ()a2 f () a n f()()()()xaaxa=+ f f ′ − +() xa − +⋅⋅⋅ ()() xa − + R x 2!n ! n

(n+1) f( c ) n+1 Lagrange Error Bound Rx()=() xa − n ()n +1 !

In this case, c is the number between x and a that will give

us the largest result for Rn (x) (n+1) f( c ) n+1 Does any part of Rx()=() xa − this look familiar? n ()n +1 !

This remainder term is just like the Alternating Series error (note (n+1) that it uses the n + 1 term) except for the f (c)

If our Taylor Series had If our Taylor Series did not alternating terms: have alternating terms:

n+1 (n+1) f (a) n f( c ) n+1 Rn (x) = (x − a) Rx()=() xa − (n + )!1 n ()n +1 !

(n+1) This is just the next term of the Note that working with f (c) series which is all we need if it is is the part that makes the Lagrange an Alternating Series Error Bound more complicated. Taylor’s Theorem with Remainder If f has derivatives of all orders in an open interval I containing a, then for each positive integer n and for each x in I:

()n f′′ ()a2 f () a n f()()()()xaaxa=+ f f ′ − +() xa − +⋅⋅⋅ ()() xa − + R x 2!n ! n

(n+1) f( c ) n+1 Lagrange Error Bound Rx()=() xa − n ()n +1 !

Why this is the case involves a mind-bending proof so we just won’t do it here. Now let’s go back to our last problem… Recall that the Taylor Series for ln x centered at x = 1 is given by… (x − )1 2 (x − )1 3 (x − )1 4 ∞ (x − )1 n ln x = (x − )1 − + − ... = ∑(− )1 n+1 2 3 4 n=1 n Find the maximum error bound for each approximation. Because the series is alternating, we can start with…

3 5.1( − )1 3 ln → error ≤ = .0 0417 2 3 actual error =| ln( )5.1 − .0 625 |= .0 03047

1 5.0( − )1 3 ln → error ≤ = .0 0417 2 3 actual error =| ln( )5.0 − (− .0 625 |) = .0 068147

Wait! How is the actual error bigger than the error bound for ln 0.5? Recall that the Taylor Series for ln x centered at x = 1 is given by… (x − )1 2 (x − )1 3 (x − )1 4 ∞ (x − )1 n ln x = (x − )1 − + − ... = ∑(− )1 n+1 2 3 4 n=1 n

First of all, when plugging in ½ for x, what happens to your series? 1 5.0( − )1 2 5.0( − )1 3 ∞ (− )5.0 n ln = 5.0( − )1 − + ... = ∑(− )1 n+1 2 2 3 n=1 n 1 25.0 .0 0625 ∞ )5.0( n ln = − 5.0 − − ... = −∑ 2 2 3 n=1 n

Note that when x = ½, the series is no longer alternating. So now what do we do?

Since the Remainder Term will work for any Taylor Series, we’ll have to use it to find our error bound in this case Since we used terms up through n = 2 , we will need to go to n = 3 to find our Remainder Term(error bound): The Taylor Series for f (x) = ln x centered at x = 1 f (x) = ln x f )1( = ln 1 = 0 1 1 The third f ′(x) = f ′ )1( = =1 gives us this x 1 coefficient: −1 1 f ′′(x) = f ′′ )1( = − = −1 − 2 2 f ′′′(c) 2c 3 x 1 = 2 2 3! 3! ′′′ ′′′ −3 f (x) = 3 f (c) = 3 = 2c x c This is the part of the error bound formula that we need 3 1 5.0( − )1 ln → error ≤ = .0 0417 2 3 actual error =| ln( )5.0 − (− .0 625 |) = .0 068147 We saw that plugging in ½ for x makes each term of the series positive and therefore it is no longer an alternating series. So we need to use the Remainder Term which is also called… f n+1(c) The Lagrange Error Bound (x − a)n+1 (n + )!1

f ′′′(c) 2c−3 error = 5.0( − )1 3 = .0( 125 ) The 3! 3! of ln x at x = c What value of c will give us the maximum error?

Normally, we wouldn’t care about the actual value of c but in this case, we need to find out what value of c will give us the maximum value for 2 c–3. f ′′′(c) 2c−3 error = 5.0( − )1 3 = .0( 125 ) The third derivative 3! 3! of ln x at x = c The question is what value of c between x and a will give us the maximum error?

So we are looking for a number for c between 0.5 and 1. 2 Let’s rewrite it as which has its largest value when c is smallest. c 3 And therefore… c = 0.5

−3 −3 f ′′′(c) 3 2c 2(0.5) error = 5.0( − )1 = .0( 125 ) = (0.125) 3! 3! 3!

16 1 1 Which is larger than And we always want the error bound = = the actual error! to be larger than the actual error 6 8 3 actual error =| ln( )5.0 − (− .0 625 |) = .0 068147 Let’s try using Lagrange on an alternating series

x 2 We know that since this is an alternating ln(1+ x) ≈ x − 2 series, the error bound would be x 3 3 But let’s apply Lagrange (which works on all Taylor Series)… ′′′ 2 f (c) 3 The third derivative ′′′ error ≤ x f (x) = 3 3! of ln(1+ x) is 1( + x)

2(1+ c)−3 x 3 error ≤ x 3 = The value of c that will 3! 3(1+ c)3 maximize the error is 0 so…

x 3 x 3 = Which is the same as the 3(1+ c)3 3 Alternating Series error bound Most text books will describe the error bound two ways:

(n+1) f( c ) n+1 Lagrange Form of the Remainder: Rx()=() xa − n ()n +1 !

and If M is the maximum value of f ( n + 1 ) ( x ) on the interval between a and x, then: M n+1 Remainder Estimation Theorem: R() x ≤ x− a n ()n +1 !

Note from the way that it is described above that M is just another way of saying that you have to maximize f (n+1)(c) Remember that the only difference you need to worry about between Alternating Series error and La Grange is finding f (n+1)(c)