<<

Section 1.5. Taylor Expansions

In the previous section, we learned that any represents a and that it is very easy to di¤erentiate or integrate a power series function. In this section, we are going to use power series to represent and then to approximate general functions. Let us start with the formula

1 1 = xn, for x < 1. (1) 1 x j j n=0 ¡ X We call the power series the power series representation (or expansion) for the function 1 f (x) = about x = 0. 1 x ¡ 1 It is very important to recognize that though the function f (x) = (1 x)¡ is de…ned for all x = 1, the representation holds only for x < 1. In g¡eneral, if a function f (x) c6 an be represented by a power series asj j

1 n f (x) = cn (x a) n=0 ¡ X then we call this power series

power series representation (or expansion) of f (x) about x = a.

We often refer to the power series as

Taylor of f (x) about x = a.

Note that for the same function f (x) , its expansion about x = b, 1 f (x) = d (x b)n n ¡ n=0 X if a = b, is completely di¤erent from the Taylor series expansion about x = a. Gen6erally speaking, the of convergence for the representing Taylor series may be di¤erent from the domain of the function. Example 5.1. Find Taylor series expansion at given point x = a : 1 (a) f (x) = , a = 0; 1 + x2

1 x (b) g (x) = , a = 0; x + 2 1 (c) h (x) = , a = 1. 2x + 3 Solution: (a) We shall use (1) by …rst rewriting the function as follows:

1 1 y= x2 1 1 = =¡ = yn, for y < 1. 1 + x2 1 ( x2) 1 y n=0 j j ¡ ¡ ¡ X Formula (1) leads to

1 1 1 n 1 = yn = x2 = ( 1)n x2n, for y < 1. 1 + x2 n=0 n=0 ¡ n=0 ¡ j j X X ¡ ¢ X Note that, since y = x2,and ¡ y < 1 x2 < 1 x < 1 , j j () ¡ () j j we know conclude ¯ ¯ ¯ ¯ 1 1 = ( 1)n x2n, for x < 1. 1 + x2 n=0 ¡ j j X (b) Write x 1 1 g (x) = = x = x (2) x + 2 2 + x 2 (1 + x/2) µ ¶ µ ¶ x 1 x 1 = = . 2 ¢ 1 + x/2 2 ¢ 1 ( x/2) ¡ ¡ We now use (1) to derive

1 y= x/2 1 1 =¡ = yn 1 ( x/2) 1 y ¡ ¡ ¡ n=0 X n 1 x n 1 ( 1) = = ¡ xn, for y < 1. 2 2n n=0 ¡ n=0 j j X ³ ´ X Substituting this into (2), we obtain n x x 1 x 1 ( 1) = = ¡ xn x + 2 2 ¢ 1 ( x/2) 2 2n ¡ ¡ n=0 n X 1 ( 1) = ¡ xn+1, for y < 1. 2n+1 n=0 j j X 2 Now since x y = < 1 x < 2, j j 2 () j j we conclude ¯ ¯ ¯ ¯ n x ¯1¯ ( 1) = ¡ xn+1, for x < 2. x + 2 2n+1 j j n=0 X (c) For 1 h (x) = , a = 1, 2x + 3 we need to rewrite the denominator in terms of (x 1)as follows: ¡ 1 1 1 = = 2x + 3 2 [(x 1) + 1] + 3 2 (x 1) + 5 ¡ 1 1 ¡ 1 = = 5 [1 + 2 (x 1) /5] 5 1 + 2 (x 1) /5 ¡ ¡ y= 2(x 1)/5 1 1 1 1 ¡ =¡ = yn (for y < 1). 5 1 y 5 n=0 j j ¡ X 2 (x 1) We then substitute y = ¡ back to obtain ¡ 5

1 1 1 h (x) = = yn 2x + 3 5 n=0 X n 1 1 2 (x 1) 2 (x 1) = ¡ (for y = ¡ < 1) 5 ¡ 5 j j 5 n=0 µ ¶ ¯ ¯ X n ¯ ¯ 1 1 2 ¯ ¯ = ( 1)n (x 1)n ¯ ¯ 5 ¡ 5 ¡ n=0 µ ¶ X n 1 ( 1) 2n 5 = ¡ (x 1)n , for x 1 < . 5n+1 ¡ j ¡ j 2 n=0 X Example 5.2. Find Taylor series about a = 0 for 1 (a) f (x) = ; (1 x)2 (b) g (x) = ln (¡1 x) ; (c) h (x) = arcta¡n x.

3 Solution: (a) Di¤erentiate

1 1 = xn, for x < 1, 1 x n=0 j j ¡ X we obtain

1 1 0 1 n 1 n 1 f = = = (x )0 = nx ¡ . 2 1 x (1 x) n=0 n=1 ¡ µ ¡ ¶ X X (b) Take anti- on both sides of

1 1 = xn, for x < 1, 1 x n=0 j j ¡ X we obtain 1 1 1 xn+1 dx = xndx = + C. 1 x n + 1 n=0 n=0 Z ¡ X µZ ¶ X So 1 1 xn+1 ln (1 x) = dx = C. 1 x n + 1 ¡ ¡ ¡ n=0 ¡ Z ¡ X To determine the constant, we insert x = 0 into both sides:

1 xn+1 0 = ln (1 0) = C = C. n + 1 ¡ ¡ "n=0 # ¡ ¡ X x=0 We have to choose C = 0 and

1 xn+1 1 xn ln (1 x) = = . (Memorize it) n + 1 n ¡ ¡ n=0 ¡ n=1 X X (c) Note d 1 h = arctan x = . 0 dx 1 + x2 So 1 h (x) = arctan x = dx. 1 + x2 Z

4 From Example 5.1 (a), we know

1 1 = ( 1)n x2n. 1 + x2 ¡ n=0 X Thus

n 1 1 1 ( 1) arctan x = dx = ( 1)n x2ndx = ¡ x2n+1 + C. 1 + x2 2n + 1 n=0 ¡ n=0 Z X Z X By setting x = 0 above, we …nd C = 0. So

n 1 ( 1) arctan x = ¡ x2n+1. 2n + 1 n=0 X Taylor Series for General Functions. Consider power series expansion

1 n 2 3 f (x) = cn (x a) = c0 + c1 (x a) + c2 (x a) + c3 (x a) + ... (3) n=0 ¡ ¡ ¡ ¡ X for general function f (x) about x = a. Setting x = a, we obtain

f (a) = c0.

Next, we take derivative on (3) so that

1 n 1 2 3 f 0 (x) = cnn (x a) ¡ = c1+c2 2 (x a)+c3 3 (x a) +c4 4 (x a) +... n=1 ¡ ¢ ¡ ¢ ¡ ¢ ¡ X (4) Setting x = a, we have f 0 (a) = c1. We repeat the same process again and again: take derivative again on (4)

1 n 2 2 f 00 (x) = c n (n 1) (x a) ¡ = c 2 1+c 3 2 (x a)+c 4 3 (x a) +... n ¡ ¡ 2¢ ¢ 3¢ ¢ ¡ 4¢ ¢ ¡ n=2 X (5)

5 and x = a to obtain

f 00 (a) f 00 (a) = c 2 1 = c = ; 2 ¢ ¢ ) 2 2! take derivative again on (5)

1 (3) n 3 2 f (x) = cnn (n 1) (n 2) (x a) ¡ = c33 2 1+c44 3 2 (x a)+c55 4 3 (x a) +... n=3 ¡ ¡ ¡ ¢ ¢ ¢ ¢ ¡ ¢ ¢ ¡ X and insert x = a to obtain

(3) (3) f (a) f (a) = c33 2 1 = c3 = . ¢ ¢ ) 3! In general, we have f (n) (a) c = , n = 0, 1, 2, ... n n! here we adopt the convention that 0! = 1. All above process can be carried on as long as any of order of derivative at x = a exists, i.e., f (x) must be a smooth function near a. Then, we have Taylor series expansion formula 1 f (n) (a) f (x) = (x a)n . (Taylor Series) n! n=0 ¡ X When a = 0, it becomes

1 f (n) (0) f (x) = xn, (Maclaurin Series) n! n=0 X we call it Maclaurin Series of f (x) . Example 5.3. Find Maclaurin series for (a) f (x) = ex; (b) g (x) = bx (b > 0) Solution: (a) For f = ex, we know

x x (n) x f 0 = e , f 00 = e , ..., f = e .

Thus f (n) (0) 1 c = = , n n! n!

6 1 f (n) (0) 1 1 ex = xn = xn. (Maclaurin Series For ex) n! n! n=0 n=0 X X This is one of the most useful Taylor series, and must be memorized. (b) We o¤er two methods to solve this problem. First is the direct method by using formula for Maclaurin Series. To this end, we compute

x g0 = b ln b x x x 2 g00 = (b )0 ln b = (b ln b) ln b = b (ln b) , ... g(n) = bx (ln b)n .

So n 1 g(n) (0) 1 (ln b) bx = xn = xn. n! n! n=0 n=0 X X Another method is to use Taylor series for ex above. Write

n x y=x ln b 1 1 1 1 1 (ln b) bx = eln(b ) = e(x ln b) = ey = yn = (x ln b)n = xn. n! n! n! n=0 n=0 n=0 X X X Example 5.4. Find Maclaurin series for (a) f (x) = sin x; (b) g (x) = cos x. Solution: (a) We observe that

f = sin x = f (0) = 0, ) f 0 = cos x = f 0 (0) = 1, ) f" = sin x = f" (0) = 0, ¡ ) f (3) = cos x = f (3) (0) = 1 ¡ ) ¡ f (4) = sin x = f (4) (0) = 0, ) and that this cyclic pattern repeats every 4 times di¤erentiations. In partic- ular, we see that when n is even, i.e., n = 2m, f (n) (0) = 0. When n is odd,

7 i.e., n = 2m + 1, f (n) (0) equals 1 and 1 alternating. Thus, ¡ 1 f (n) (0) sin x = xn n! n=0 X 1 f (n) (0) = xn n! n=0 nX=odd 1 f (2m+1) (0) = x2m+1 (2m + 1)! m=0 X m 1 ( 1) = ¡ x2m+1 (Maclaurin Series for cos x) (2m + 1)! m=0 X x3 x5 x7 = x + + .... ¡ 3! 5! ¡ 7! (b) Maclaurin series for cos x may be derived analogously. Another simple way to …nd Maclaurin series for cos x is to use the above Maclaurin series for sin x. We know that cos x = (sin x)0 . So

m 1 ( 1) 0 cos x = ¡ x2m+1 (2m + 1)! Ãm=0 ! X m 1 ( 1) = ¡ (2m + 1) x2m (2m + 1)! m=0 X m 1 ( 1) = ¡ x2m (Maclaruin Series for cos x) (2m)! m=0 X x2 x4 x6 = 1 + + .... ¡ 2! 4! ¡ 6!

Example 5.5. Some applications. (a) Find Maclaurin series for x sin (2x) ; x2 (b) Find Maclaurin series for e¡ dx; ex 1 x x2/2 (c) Find the lim ¡ ¡R ¡ . x 0 x3 !

8 Solution: (a) Set y = 2x, and use Maclaurin Series for sin x to get

sin (2x) = sin y m 1 ( 1) = ¡ y2m+1 (2m + 1)! m=0 X m 1 ( 1) = ¡ (2x)2m+1 (2m + 1)! m=0 X (2x)3 (2x)5 = (2x) + .... ¡ 3! 5! ¡ So m 1 ( 1) x sin (2x) = x ¡ (2x)2m+1 (2m + 1)! m=0 X m 1 ( 1) 22m+1 = ¡ x2m+2. (2m + 1)! m=0 X (b) Letting y = x2 and using Maclaurin Series for ex, we …nd ¡ x2 y e¡ = e

1 1 = yn n! n=0 X n 1 1 n 1 ( 1) = x2 = ¡ x2n. n! n! n=0 ¡ n=0 X ¡ ¢ X Therefore,

n 1 x2 ( 1) 2n e¡ dx = ¡ x n! Z n=0 Z X n 1 ( 1) = ¡ x2n+1 + C. n! (2n + 1) n=0 X (c) Again, we use Maclaurin Series for ex

1 1 x2 x3 ex = xn = 1 + x + + + O x4 n! 2! 3! n=0 X ¡ ¢ 9 to get x2 x3 ex 1 x = + O x4 ¡ ¡ ¡ 2 3! and consequently ¡ ¢

2 x x e 1 x 1 O (x4) 1 ¡ ¡ ¡ 2 = + = + O (x) . x3 3! x3 6 So 2 x x e 1 x 1 lim ¡ ¡ ¡ 2 = . x 0 x3 6 ! Taylor . Consider Taylor series expansion

1 f (n) (a) f (x) = (x a)n n! ¡ n=0 X for a function f (x) . The partial sum of order n,

n (k) f (a) k Tn (x) = (x a) , k! ¡ k=0 X is called Taylor of order n. This is often used for . When n = 1,

1 (k) f (a) k T (x) = (x a) = f (a) + f 0 (a) (x a) 1 k! ¡ ¡ k=0 X is exactly the of f (x) about x = a, as we learned in I. When n = 2,

2 (k) f (a) k f" (a) 2 T2 (x) = (x a) = f (a) + f 0 (a) (x a) + (x a) k! ¡ ¡ 2! ¡ k=0 X is called Quadratic approximation. In general, Tn (x) is considered as the approximation to f (x) of order n, and this approximation is valid only when x is very close to a.

10 Example 5.6. Find T3 (x) about x = 0 for (a) ex sin x; (b) tan x. Solution. (a) Using Maclaurin expansions, we have

n 1 xn ( 1) x2n+1 ex sin x = ¡ n! (2n + 1)! Ãn=0 ! Ãn=0 ! X X x2 x3 x3 = 1 + x + + + ... x + ... 2 3! ¡ 3! µ ¶ µ ¶ x3 x2 = x + x (x) + (x) + O x4 ¡ 3! 2 µ ¶ x3 ¡ ¢ = x + x2 + + O x4 , 3 ¡ ¢ where

O x4 indicates the sum of all terms being equal or higher order than x4.

So ¡ ¢ x3 T = x + x2 + . 3 3

11 (b) Solution 1. ( 1)n x2n+1 ¡ sin x n=0 (2n + 1)! tan x = = cos x P ( 1)n x2n ¡ n=0 (2n)! x3 P x + O (x5) ¡ 3! = µ ¶ x2 1 + O (x4) ¡ 2! µ ¶ x3 x + O (x5) ¡ 3! x2 = µ ¶ (y = + O x4 ) 1 y 2! ¡ x3 ¡ ¢ = x + O x5 1 + y + y2 + ... ¡ 3! µ ¶ x3 ¡ ¢ ¡ x2 ¢ = x + O x5 1 + + O x4 ¡ 3! 2! µ ¶ µ ¶ x3 ¡ x¢2 ¡ ¢ = x + x + O x4 ¡ 3! 2! µ ¶ µ ¶ x3 ¡ ¢ = x + + O x4 . 3 So ¡ ¢ x3 T = x + . 3 3 Solution 2: We use formula 3 f (k) (0) T (x) = xk. 3 k! k=0 X Now tan 0 = 0, 2 (tan x)0 = sec x, (tan x)0 x=0 = 1 2 j (tan x)00 = 2 tan x sec x, (tan x)00 = 0 jx=0 2 2 (tan x)000 = 2 (tan x)0 sec x + 2 tan x sec x 0

(tan x)000 x=0 = 2 (tan x)0 x=0 = 2. j j ¡ ¢

12 So 3 f (k) (0) 2 x3 T (x) = xk = x + x3 = x + . 3 k! 3! 3 k=0 X Homework (problems marked with * are optional):

1. Find Taylor series and determine the interval of convergence. 3 (a) f (x) = , a = 0 1 x4 ¡x (b) f (x) = , a = 0 4x + 1 (c) f (x) = ln (x + 1) , a = 0 (d) *f (x) = ln x, a = 2 (hint : write ln x = ln (1 (2 x)) ) ¡ ¡ 1 (e) *f (x) = x 1, a = 1 (hint : write x 1 = ) ¡ ¡ 1 (1 x) ¡ ¡ (f) *f (x) = 2x, a = 1

2. Using a Maclaurin series derived in this section to obtain the Maclaurin series for the given function.

x/2 (a) f (x) = e¡ (b) f (x) = x cos (2x) (c) f (x) = sin (x4)

3. Find the Taylor polynomial of degree 3 about the given point a.

x/2 (a) f (x) = cos (2x) e¡ , a = 0. 2x (b) f (x) = , a = 0. 1 x ¡ 4. *Evaluate the inde…nite as a power series, and determine the . 3 (a) * dx 1 x4 ¡ R ln (1 t) (b) * ¡ dt t R 13 5. *Use the …rst 3 terms of a power series to approximate the de…nite integral: 0.4 ln 1 + x2 dx. Z0 ¡ ¢

14