LECTURE 34: WORKING WITH TAYLOR SERIES MINGFENG ZHAO April 01, 2015 Definition 1. Suppose a function f (x) has derivatives of all orders on an interval centered at point a, then the Taylor series for f (x) centered at a is: ∞ X f (k) (a) k=0 k! · (x − a)k := f (a) + f 0 (a)(x − a) + f 00 (a) f (3) (a) (x − a)2 + (x − a)3 + · · · . 2! 3! A Taylor series centered at 0 is called a Maclaurin series. Example 1. Find the Maclaurin series of cos(x) and sin(x). Let f (x) = cos(x), then f (0) (x) = f (x) = cos(x), f (0) = 1 f 0 (x) = − sin(x), f 0 (0) = 0 f 00 (x) = − cos(x), f 00 (0) = −1 f (3) (x) = sin(x), f (3) (0) = 0 f (4) (x) = cos(x), f (4) (0) = 1. So f (k) (0) = 0 if k is odd, and 1, if k is even f (2k) (0) = −1, if k is odd. Hence the Maclaurin series for f (x) is: ∞ X (−1)k k=0 (2k)! x2k = 1 − x2 x4 x6 + − + ··· . 2! 4! 6! Differentiate the above series, we get − sin(x) = ∞ X (−1)k 2k−1 x . (2k − 1)! k=1 1 2 MINGFENG ZHAO So we get sin(x) = − ∞ ∞ X (−1)k 2k−1 X (−1)k+1 2k−1 x = x . (2k − 1)! (2k − 1)! k=1 k=1 Limits by Taylor series x2 + 2 cos(x) − 2 . x→0 3x4 By Example in 1, we have Example 2. Evaluate lim cos(x) = ∞ X (−1)k k=0 (2k)! x2k = 1 − x2 x4 x6 + − + ··· . 2! 4! 6! Then x2 + 2 cos(x) − 2 x4 x6 x2 + − + ··· x2 − 2 + 2 · 1 − 2! 4! 6! 6 4 x x 2 2 + 2 − + ··· = x −2+2−x + 12 6! 6 4 x x = + 2 − + ··· . 12 6! = So we get 2 x + 2 cos(x) − 2 = 3x4 x4 12 h 6 i + 2 − x6! + · · · 3x4 2 1 x 1 = + 2 − + ··· → , 36 6! 36 Hence we have x2 + 2 cos(x) − 2 1 . = x→0 3x4 36 1 Example 3. Evaluate lim 6x5 sin − 6x4 + x2 . x→∞ x 1 Let t = , then t → 0 as x → ∞, which implies that x 1 6 sin(t) 6 1 lim 6x5 sin − 6x4 + x2 = lim − + x→∞ t→0 x t5 t4 t2 lim = lim t→0 6 sin(t) − 6t + t3 . t5 By Example 1, we have sin(t) = ∞ X (−1)k+1 2k−1 t3 t5 8t7 t =t− + − − ··· . (2k − 1)! 6 120 8! k=1 as x → 0. LECTURE 34: WORKING WITH TAYLOR SERIES 3 Then 6 sin(t) − 6t + t 3 t3 t5 t7 6 t− + − − · · · − 6t + t3 6 120 7! 7 t5 t 6t − t3 + −6 − · · · − 6t + t3 20 7! 7 5 t t −6 − ··· . 20 7! = = = So we get 3 6 sin(t) − 6t + t = t5 t5 20 −6 h 8t7 8! − ··· i t5 2 1 t = −6 − ··· , 20 7! as t → 0. Hence we have lim x→∞ 1 6 sin(t) − 6t + t3 1 = . − 6x4 + x2 = lim 6x5 sin 5 t→0 x t 20 Remark 1. One can use l’Hospital’s Rule to check your answers for the above examples: Let f (x) and g(x) be differential functions, and a be a number or ±∞, then a. f 0 (x) 0 type: Assume that lim f (x) = lim g(x) = 0 and lim 0 = L, then x→a x→a x→a g (x) 0 lim x→a b. f (x) = L. g(x) ∞ f 0 (x) type: Assume that lim f (x) = ±∞, lim g(x) = ±∞ and lim 0 = L, then x→a x→a x→a g (x) ∞ lim x→a f (x) = L. g(x) sin(x) . x By l’Hospital’s rule, we have Example 4. Evaluate lim x→0 lim x→0 sin(x) cos(x) = lim = cos(0) = 1. x→0 x 1 Differentiating power series Example 5. Find a power series solution of the differential equation y 0 (x) = y with initial condition y(0) = 1. Let y(x) = ∞ X k=0 ck xk . 4 MINGFENG ZHAO Since y(0) = 1, then c0 = 1. Notice that y 0 (x) = ∞ X kck xk−1 k=0 = ∞ X kck xk−1 k=1 = ∞ X (k + 1)ck+1 xk k=0 0 Since y (x) = y, then ∞ X (k + 1)ck+1 xk = k=0 ∞ X ck x k . k=0 Then we have (k + 1)ck+1 = ck , for all k ≥ 0. 1 · ck , k+1 for all k ≥ 0. That is, we have ck+1 = Since c0 = 1, then c1 = c2 = c3 = c4 = .. . ck+1 So we get ck = = c0 = 1 1 1 c1 = 2 2 1 1 c2 = 3 3! 1 1 1 1 c3 = · = 4 4 3! 4! .. . 1 1 1 1 1 · · · · · · c0 = . k+1 k 2 1 (k + 1)! 1 for all k ≥ 0. Hence we have k! y(x) = ∞ X xk k=0 k! . Hence we know that y(x) = ∞ X xk k=0 k! = ex . LECTURE 34: WORKING WITH TAYLOR SERIES Integrating power series 1 Z Since ex = ∞ X xk k=0 k! 2 e−x dx. Example 6. Evaluate the integral 0 , then 2 e−x = ∞ X (−x2 )k k! k=0 = ∞ X (−1)k k! k=0 · x2k . So we get 1 Z Z ∞ X (−1)k 2 e−x dx = 0 k! k=0 1 x2k dx = 0 ∞ X (−1)k k=0 k! · 1 2k + 1 Representing real numbers Example 7. Identify the function represented by the power series ∞ X (1 − 2x)k k=1 k! . Let y = 1 − 2x, then ∞ X (1 − 2x)k k=1 k! = ∞ X yk = k! k=1 ∞ X yk k=0 k! − 1 = ey − 1 = e1−2x − 1. Example 8. Identify the function represented by the power series ∞ X (−1)k k k=1 4k x2k . In fact, we have ∞ X (−1)k k k=1 4k x2k = 2 k ∞ X x k − 4 k=1 = ∞ X ky k Let y = − k=1 = = = ∞ X x2 4 ! ∞ ∞ X d X k d k y · ky =y (y ) = y y dy dy k=1 k=1 k=1 2 x d y y if |y| < 1, then − < 1, that is, |x| < 2 dy 1 − y 4 y· k−1 1−y+y y = 2 (1 − y) (1 − y)2 2 − x4 = 1+ = − x2 2 4 4x2 . (x2 + 4)2 Since y = − x2 4 5 6 MINGFENG ZHAO Remark 2. The function f (x) = − ∞ X 4x2 (−1)k k 2k is defined on −∞ < x < ∞, but its power series x is only 2 2 (x + 4) 4k k=1 defined on (−2, 2). Remark 3. For the problems like Example 8, the Step I is to write the series has the form of xm X g(k)y k by using X substitution, where g(k) is a rational function of k; the Step II is to identify the function for the series g(k)y k by using differentiation of integration; the Step II is to substitute y back to x. Example 9. Identify the function represented by the power series Approach I: Let f (x) = ∞ X xk k=1 k ∞ X xk k=1 k . , then ∞ X xk d f 0 (x) = dx k=1 ! k ∞ X xk−1 = k=1 1 , 1−x if |x| < 1. So we have Z f (x) = 1 dx = − ln |1 − x| + C. 1−x Since f (0) = 0, then C = 0. Hence we get ∞ X xk k=1 k = − ln |1 − x|. Approach II: In fact, we have ∞ X xk k=1 k = ∞ Z X x k−1 Z dx = k=1 Z = = ∞ X ! x k−1 k=1 1 dx 1−x Z dx = ∞ X ! x k dx k=0 if |x| < 1 − ln |1 − x| + C. Plug x = 0 into the above identities, then C = 0. So we get ∞ X xk k=1 k = − ln |1 − x|. Department of Mathematics, The University of British Columbia, Room 121, 1984 Mathematics Road, Vancouver, B.C. Canada V6T 1Z2 E-mail address: mingfeng@math.ubc.ca