9.3 Taylor’s Theorem: Error Analysis for Series Tacoma Narrows Bridge: November 7, 1940 Last time in BC… So the Taylor Series for ln x centered at x = 1 is given by… ( x 1) ( x 1) ( x 1) f ( x) ln x ( x 1) ... 2 3 4 ( x 1) (1) n 2 3 4 n n 1 n 1 Use the first two terms of the Taylor Series for ln x centered at x = 1 to approximate: 3 0.25 (1.5 1) 2 ln (1.5 1) 0.5 0.375 2 2 2 1 (0.5 1) 2 0.25 ln (0.5 1) 0.5 0.625 2 2 2 Recall that the Taylor Series for ln x centered at x = 1 is given by… n (x 1)2 (x 1) 3 (x 1) 4 (x 1) f (x) ln x (x 1) ... (1) n 1 2 3 4 n n 1 Find the maximum error bound for each approximation. Because the series is alternating, we can start with… 3 ( 1 . 5 1 ) 3 error 0.0417 ln 3 2 actual error | ln( 1.5) 0.625 | 0.03047 3 ( 0 . 5 1 ) 1 error 0.0417 ln 3 2 actual error | ln( 0.5) (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 alternating series 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 derivatives of all orders in an open interval I containing a, then for each positive integer n and for each x in I: f a f n a 2 f x f a f a x a x a x a n Rn x 2! n! Lagrange Error Bound Rn x c x a n1 n 1! f n 1 In this case, c is the number between x and a that will give us the largest result for Rn (x) Does any part of this look familiar? f n 1 c Rn x n 1! x a n 1 This remainder term is just like the Alternating Series error (note that it uses the n + 1 term) except for the If our Taylor Series had alternating terms: f n1 (a) Rn ( x) ( x a) n (n 1)! This is just the next term of the series which is all we need if it is an Alternating Series f n1 c If our Taylor Series did not have alternating terms: Rn x f n 1 c n 1! x a n 1 n 1 c f Note that working with is the part that makes the Lagrange 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: f a f n a 2 f x f a f a x a x a x a n Rn x 2! n! Lagrange Error Bound Rn x c x a n1 n 1! f 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… n ( x 1) 2 ( x 1)3 ( x 1) 4 ( x 1 ) ln x ( x 1) ... (1) n1 2 3 4 n n 1 Find the maximum error bound for each approximation. Because the series is alternating, we can start with… 3 ( 1 . 5 1 ) 3 error 0.0417 ln 3 2 actual error | ln( 1.5) 0.625 | 0.03047 3 ( 0 . 5 1 ) 1 error 0.0417 ln 3 2 actual error | ln( 0.5) (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… n ( x 1) 2 ( x 1)3 ( x 1) 4 ( x 1 ) ln x ( x 1) ... (1) n1 2 3 4 n n 1 First of all, when plugging in ½ for x, what happens to your series? n 1 (0.5 1) 2 (0.5 1)3 ( 0 . 5 ) ln (0.5 1) ... (1) n1 2 2 3 n n 1 1 0.25 0.0625 (0.5) n ln 0.5 ... 2 2 3 n n 1 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 Remainder Term(error bound): The Taylor Series for f ( x) ln x 1 f ( x ) x 1 f ( x) 2 x 2 f ( x) 3 x = 2, we will need to go to n = 3 to find our f ( x) ln x centered at x = 1 f (1) ln 1 0 The third derivative 1 f (1) 1 gives us this 1 coefficient: 1 f (1) 2 1 3 2c f c 1 3! 3! 2 3 f (c) 3 2c c This is the part of the error bound formula that we need 3 ( 0 . 5 1 ) 1 error 0.0417 ln 3 2 actual error | ln( 0.5) (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… The Lagrange Error Bound f n1 (c) ( x a) n1 (n 1)! 3 2 c f (c ) (0.125) error (0.5 1) 3 3! 3! The third derivative 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 2c–3. 3 2 c f (c) (0.125) error (0.5 1) 3 3! 3! The third derivative 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. Let’s rewrite it as And therefore… 2 c3 which has its largest value when c is smallest. c = 0.5 3 3 f ( c ) 2(0.5) error (0.5 1) 3 2c (0.125) (0.125) 3! 3! 3! 16 1 1 6 8 3 Which is larger than the actual error! And we always want the error bound to be larger than the actual error actual error | ln( 0.5) (0.625) | 0.068147 Let’s try using Lagrange on an alternating series x2 ln(1 x) x 2 We know that since this is an alternating series, the error bound would be x 3 3 But let’s apply Lagrange (which works on all Taylor Series)… f (c) 3 error x 3! The third derivative of ln(1+ x) is 2(1 c) 3 3 x3 error x 3! 3(1 c) 3 x3 x3 3 3(1 c) 3 2 ( x) f (1 x)3 The value of c that will maximize the error is 0 so… Which is the same as the Alternating Series error bound Most text books will describe the error bound two ways: Lagrange Form of the Remainder: Rn x f n 1 c n 1! x a n 1 and If M is the maximum value of between a and x, then: Remainder Estimation Theorem: f n 1 x on the interval M n 1 Rn x xa 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