Taylor and Maclaurin Series MATH 211, Calculus II J. Robert Buchanan Department of Mathematics Spring 2018
Background We have seen that some power series converge. When they do, we can think of them as functions, say f (x). The derivatives and antiderivatives of f (x) are power series too. Suppose we start with a function, f (x). Is there a power series representation for f (x)? Which functions have power series representations? How do we find the power series representation?
Differentiating a Power Series f (x) = a k (x c) k = a 0 + a 1 (x c) + f (c) = a 0 f (x) = k a k (x c) k 1 = a 1 + 2a 2 (x c) + k=1 f (c) = a 1 f (x) = k(k 1)a k (x c) k 2 = 2a 2 + 6a 3 (x c) + k=2 f (c) = 2a 2.
Differentiating a Power Series f (x) = a k (x c) k = a 0 + a 1 (x c) + f (c) = a 0 f (x) = k a k (x c) k 1 = a 1 + 2a 2 (x c) + k=1 f (c) = a 1 f (x) = k(k 1)a k (x c) k 2 = 2a 2 + 6a 3 (x c) + k=2 f (c) = 2a 2. Observation: in general f (k) (c) = a k a k = f (k) (c).
Summary If a k (x c) k converges with radius of convergence r > 0 to a function f (x), then f (x) = a k (x c) k = f (k) (c) (x c) k.
Big Question Question: suppose f (x) is infinitely differentiable, i.e., f (k) (x) exists for all k = 1, 2,..., then does f (k) (c) (x c) k converge? is its radius of convergence positive? does it converge to f (x)?
Big Question Question: suppose f (x) is infinitely differentiable, i.e., f (k) (x) exists for all k = 1, 2,..., then does f (k) (c) (x c) k converge? is its radius of convergence positive? does it converge to f (x)? If the answers are all yes, we say Taylor series expansion of f (x) about x = c. f (k) (c) (x c) k is the
Examples (1 of 3) Verify that e x. x k is the Taylor series expansion about c = 0 of
Examples (1 of 3) Verify that e x. x k is the Taylor series expansion about c = 0 of Let f (x) = e x, then f (k) (x) = e x for all k = 0, 1,.... If c = 0 then f (k) (c) = e c = e 0 = 1 for all k = 0, 1,.... Consequently f (k) (c) = 1 for all k = 0, 1,.... According to the Ratio Test, the power series f (k) (c) x k = x k converges absolutely for < x <, therefore e x = x k for all x.
Examples (2 of 3) Find Taylor series expansions for the following functions. 1. e 3x 2. e x 3. 2xe 3x
Examples (2 of 3) Find Taylor series expansions for the following functions. 1. e 3x (3x) k 3 k x k = = 2. e x 3. 2xe 3x
Examples (2 of 3) Find Taylor series expansions for the following functions. 1. e 3x (3x) k 3 k x k = = 2. e x = 3. 2xe 3x ( x) k = ( 1) k x k
Examples (2 of 3) Find Taylor series expansions for the following functions. 1. e 3x (3x) k 3 k x k = = 2. e x = ( x) k = 3. 2xe 3x = 2x ( 1) k x k ( 3x) k = 2( 3) k x k+1
Examples (3 of 3) Find an infinite series of positive terms whose sum is e.
Examples (3 of 3) Find an infinite series of positive terms whose sum is e. Since e x x k = for < x < then e 1 = 1 k = 1.
Terminology Definition A Taylor series for which c = 0, i.e., Maclaurin series. f (k) (0) x k is called a
Terminology Definition A Taylor series for which c = 0, i.e., Maclaurin series. f (k) (0) x k is called a Definition The n th partial sum of a Taylor series is polynomial of degree n P n (x) = n f (k) (c) (x c) k = f (c) + f (c)(x c) + + f (n) (c) (x c) n n! called the Taylor polynomial of degree n for f expanded about x = c.
Example Find the Taylor polynomials centered at c = 0 of degree 1, 3, and 5 for f (x) = sin x.
Example Find the Taylor polynomials centered at c = 0 of degree 1, 3, and 5 for f (x) = sin x. P 1 (x) = x P 3 (x) = x x 3! P 5 (x) = x x 3! + x 5 5!
Illustration y 3 -π - 2 π 3 - π 3 2 1-1 π 3 2 π 3 π x sin x P 1 (x) P 3 (x) P 5 (x) -2-3
Taylor s Theorem Theorem (Taylor s Theorem) Suppose that f has n + 1 derivatives on the interval (c r, c + r) for some r > 0. Then for x (c r, c + r), f (x) P n (x) and the error in using P n (x) to approximate f (x) is R n (x) = f (x) P n (x) = f (n+1) (z) (x c)n+1 (n + 1)! for some z between x and c.
Taylor s Theorem Theorem (Taylor s Theorem) Suppose that f has n + 1 derivatives on the interval (c r, c + r) for some r > 0. Then for x (c r, c + r), f (x) P n (x) and the error in using P n (x) to approximate f (x) is R n (x) = f (x) P n (x) = f (n+1) (z) (x c)n+1 (n + 1)! for some z between x and c. Remarks: R n (x) is called the nth Taylor remainder. f (x) = P n (x) + R n (x).
Proof (1 of 4) (x t)n+1 n Define g(t) = f (x) R n (x) (x c) n+1 Verify that g(x) = 0 and that g(c) = 0. f (k) (t) (x t) k.
Proof (1 of 4) (x t)n+1 n Define g(t) = f (x) R n (x) (x c) n+1 Verify that g(x) = 0 and that g(c) = 0. f (k) (t) (x t) k. (x x)n+1 n g(x) = f (x) R n (x) (x c) n+1 (0) n+1 = f (x) R n (x) (x c) n+1 f (0) (x) 0! = f (x) f (x) = 0 f (k) (x) (x x) k n k=1 f (k) (x) (0) k
Proof (1 of 4) (x t)n+1 n Define g(t) = f (x) R n (x) (x c) n+1 Verify that g(x) = 0 and that g(c) = 0. f (k) (t) (x t) k. (x x)n+1 n g(x) = f (x) R n (x) (x c) n+1 (0) n+1 = f (x) R n (x) (x c) n+1 f (0) (x) 0! = f (x) f (x) = 0 (x c)n+1 n g(c) = f (x) R n (x) (x c) n+1 = f (x) R n (x) P n (x) = 0 f (k) (x) (x x) k n k=1 f (k) (c) (x c) k f (k) (x) (0) k
Proof (2 of 4) Since g(x) = 0 = g(c), g(t) is continuous on the closed interval from x to c, and g(t) is differentiable on the open interval from x to c, then by Rolle s Theorem there is a number z between x and c for which g (z) = 0. Differentiate g(t) with respect to t and set the derivative equal to zero.
Proof (3 of 4) (x t)n+1 n g(t) = f (x) R n (x) (x c) n+1 g ( 1)(n + 1)(x t)n (t) = R n (x) (x c) n+1 n f (k+1) (t) (x t) k (x t)n = (n + 1)R n (x) (x c) n+1 n f (k+1) (t) (x t) k + (x t)n = (n + 1)R n (x) (x c) n+1 n f (k+1) (t) f (k) (t) (x t) k n ( 1)k f (k) (t) (x t) k 1 k=1 n k=1 n 1 (x t) k + f (k) (t) (x t)k 1 (k 1)! f (k+1) (t) (x t) k
Proof (4 of 4) g (x t)n (t) = (n + 1)R n (x) (x c) n+1 n f (k+1) (t) n 1 (x t) k + f (k+1) (t) (x t) k g (x t)n (t) = (n + 1)R n (x) (x c) n+1 f (n+1) (t) (x t) n n! For some z between x and c, g (z) = 0, so (x z)n (n + 1)R n (x) (x c) n+1 f (n+1) (z) (x z) n = 0 n! 1 (n + 1)R n (x) (x c) n+1 = f (n+1) (z) n! R n (x) = f (n+1) (z) (n + 1)! (x c)n+1.
Big Answer Using Taylor s Theorem we can now answer the big questions posed at the beginning of this discussion.
Big Answer Using Taylor s Theorem we can now answer the big questions posed at the beginning of this discussion. Theorem If f (x) has derivatives of all orders in the interval (c r, c + r) for some r > 0 and if lim R n(x) = 0 for all x (c r, c + r), n then the Taylor series for f expanded about x = c converges to f (x), i.e., f (k) (c) f (x) = (x c) k.
Taylor s Inequality Theorem (Taylor s Inequality) If f (n+1) (x) M for x c r, then the remainder R n (x) of the Taylor series satisfies the inequality R n (x) M (n + 1)! x c n+1 for x c r.
Useful Result The following theorem will frequently be of use when trying to prove that lim n R n(x) = 0 for a potential Taylor series. Theorem If x is a real number then lim n x n n! = 0.
Verifying e x = x k We have seen that if f (x) = e x then a k = f (k) (0) = 1 and x k the power series converges (by the Ratio Test) for all x. An important detail is to show that it converges to e x. Let R n = f (n+1) (z) (n + 1)! x n+1 = between 0 and x. If x d then R n (x) = e z (n + 1)! x n+1 where z is e z (n + 1)! x n+1 lim R n(x) e d x n+1 lim n n (n + 1)! = 0. e d (n + 1)! x n+1
Example Find the Maclaurin series expansion for cos x.
Solution (1 of 2) Let f (x) = cos x, then f (0) = cos 0 = 1 f (0) = sin 0 = 0 f (0) = cos 0 = 1 f (0) = sin 0 = 0 f (4) (0) = cos 0 = 1 f (5) (0) = sin 0 = 0. f (n) (0) = 0 if n is odd, 1 if n/2 is even, 1 if n/2 is odd.
Solution (2 of 2) cos x = P n (x) + R n (x) = n ( 1) n (2n)! x 2n + = n d 2n+1 dx 2n+1 [cos x] x=z (2n + 1)! ( 1) n (2n)! x 2n + ± sin z (2n + 1)! x 2n+1 x 2n+1
Solution (2 of 2) Note that cos x = P n (x) + R n (x) = n ( 1) n (2n)! x 2n + = n d 2n+1 dx 2n+1 [cos x] x=z (2n + 1)! ( 1) n (2n)! x 2n + ± sin z (2n + 1)! x 2n+1 R n (x) = ± sin z (2n + 1)! x 2n+1 x 2n+1 (2n + 1)! lim R n(x) lim x 2n+1 n n (2n + 1)! = 0 x 2n+1
Error Estimates (1 of 4) 1. Find the Taylor series expansion for ln x about x = 1. 2. Estimate the error in using P 4 (x) to approximate ln 1.2. 3. Compare this with the actual error.
Error Estimates (2 of 4) Recall that d dx [ln x] = 1 x. 1 x = 1 1 (1 x) = (1 x) k = if 0 < x < 2. ( 1) k (x 1) k
Error Estimates (2 of 4) Recall that d dx [ln x] = 1 x. 1 x = 1 1 (1 x) = (1 x) k = if 0 < x < 2. Therefore ( 1) k (x 1) k ln x = ( 1) k k + 1 (x 1)k+1 = ( 1) k 1 (x 1) k k k=1
Error Estimates (2 of 4) Recall that d dx [ln x] = 1 x. 1 x = 1 1 (1 x) = (1 x) k = if 0 < x < 2. Therefore ( 1) k (x 1) k ln x = P 4 (x) = ( 1) k k + 1 (x 1)k+1 = 4 ( 1) k 1 (x 1) k k k=1 ( 1) k 1 (x 1) k k k=1 = (x 1) 1 2 (x 1)2 + 1 3 (x 1)3 1 (x 1)4 4 ln 1.2 P 4 (1.2) 0.182267
Error Estimates (3 of 4) ( 1) k 1 Since (x 1) k is an alternating series then k k=1 ln 1.2 P 4 (1.2) 1 (1.2 1)5 5 0.000064.
Error Estimates (3 of 4) ( 1) k 1 Since (x 1) k is an alternating series then k k=1 The actual error is ln 1.2 P 4 (1.2) 1 (1.2 1)5 5 0.000064. ln 1.2 P 4 (1.2) 0.0000548901.
Error Estimates (4 of 4) Find the smallest value of n so that the maximum theoretical error in using P n (x) to approximate e x on the interval [ ln 10, ln 10] is less than 10 6.
Error Estimates (4 of 4) Find the smallest value of n so that the maximum theoretical error in using P n (x) to approximate e x on the interval [ ln 10, ln 10] is less than 10 6. e z We can calculate R n (x) = (n + 1)! x n+1. R n (x) = e z (n + 1)! x n+1 eln 10 (n + 1)! (ln 10)n+1 when n 15 (found by trial and error). = 10 (n + 1)! (ln 10)n+1 < 10 6
Binomial Series Definition If n is any real number and x < 1, then (1+x) n = ( ) n x k = 1+n x+ k n(n 1) x 2 + 2! where the expressions ( ) n n(n 1)(n 2) (n k + 1) = k are called binomial coefficients. n(n 1)(n 2) x 3 + 3!
Example Find the Maclaurin series for f (x) = convergence. 1 1 x and its radius of
Example Find the Maclaurin series for f (x) = convergence. 1 1 x and its radius of Solution We can write f (x) = (1 x) 1/2 and use the Binomial Series formula with n = 1/2. ( ) 1/2 ( ) 1/2 f (x) = ( x) k = ( 1) k x k k k = 1 1 ( 1 ) ( 3 ) ( 1 ) ( 3 ) ( 5 ) 2 x + 2 2 x 2 2 2 2 x 3 + 2! 3! = 1 + 1 2 x + (1)(3) 2 2 2! x 2 + (1)(3)(5) 2 3 x 3 + 3!
Common Taylor Series Taylor series Interval of Convergence e x x k = (, ) ( 1) k x 2k+1 sin x = (, ) (2k + 1)! ( 1) k x 2k cos x = (, ) (2k)! ( 1) k+1 (x 1) k ln x = (0, 2] k k=1 tan 1 ( 1) k x 2k+1 x = ( 1, 1) 2k + 1 ( ) n (1 + x) n = x k ( 1, 1) k
Further Examples Find the Maclaurin series for the following functions. f (x) = (2 + x) 5 g(x) = ln 1 + x 1 x h(x) = x 3 sin x
Limits and Maclaurin Series Suppose f (x) = a k x k and g(x) = b k x k. Both Maclaurin series have a positive radius of convergence and f (0) = 0 = g(0). What does f (0) = 0 = g(0) imply about the coefficients of these two infinite series? f (x) Find lim x 0 g(x). Find lim x 0 cos(x 2 ) 1 ln(1 + x) x.
Function without Taylor Series Expansion Observation: Some functions have derivatives of all orders, but their Taylor remainders do not limit on 0, and thus there is no convergent Taylor series for these functions. Example Consider f (x) = { e 1/x 2 if x 0 0 if x = 0.
Function without Taylor Series Expansion Observation: Some functions have derivatives of all orders, but their Taylor remainders do not limit on 0, and thus there is no convergent Taylor series for these functions. Example Consider f (x) = { e 1/x 2 if x 0 0 if x = 0. We can show that f (k) (0) = 0 for all k = 0, 1, 2,.... f (k) (0) However f (x) 0 = x k.
Illustration f (x) = { e 1/x 2 if x 0 0 if x = 0. y 0.3 0.2 0.1-1.0-0.5 0.5 1.0 x
Homework Read Section 11.10 Exercises: WebAssign/D2L