<<

Section 11.10 Taylor Given a f(x), we would like to be able to find a that represents the function. For example, in the last section we noted that we can represent ex by the power series

x2 x3 x4 ex = 1 + x + + + + ..., 2! 3! 4! and the power series converges to ex for any value of x. In this section we will show how to find such a power series representation.

If the function f(x) can be written as a power series on an interval I, then the power series is of the form ∑∞ n f(x) = an(x − a) n=0 2 3 = a0 + a1(x − a) + a2(x − a) + a3(x − a) + ...

The only unknowns above are the coefficients ai; if we can determine their form, then we will know the precise form of the power series for f(x). The way to determine the coefficients is by using the of f; assuming that the power series for f converges on I, we know that its derivatives converge on I as well. We calculate the derivatives below:

2 3 4 f(x) = a0 + a1(x − a) + a2(x − a) + a3(x − a) + a4(x − a) + ...

′ 2 3 n−1 f (x) = a1 + 2a2(x − a) + 3a3(x − a) + 4a4(x − a) + ... + nan(x − a) + ..., ′′ 2 n−2 f (x) = 2a2 + 2 · 3a3(x − a) + 3 · 4a4(x − a) + ... + (n − 1) · nan(x − a) + ..., ′′′ n−2 f (x) = 2 · 3a3 + 2 · 3 · 4a4(x − a) + ... + (n − 2) · (n − 1) · nan(x − a) + ..., and in general, (n) f (x) = n! an + ..., Each of these is a power series centered at x = a, so each one converges for x = a. That means that we can evaluate each of the power series at x = a:

f(a) = a0, ′ f (a) = a1, ′′ f (a) = 2a2, ′′′ f (a) = 2 · 3a3, and in general, (n) f (a) = n! an, since x − a = 0. This tells us the values for the coefficients:

1 Section 11.10

a0 = f(a), ′ a1 = f (a), f ′′(a) a = , 2 2! f ′′′(a) a = , 3 3! and in general f (n)(a) a = . n n!

Definition 0.0.1. Let f be a function with derivatives of all orders throughout some interval containing a as an interior point. Then the generated by f at x = a is given by

∞ ∑ f (k)(a) f ′′(a) (x − a)k = f(a) + f ′(a)(x − a) + (x − a)2 + ... k! 2! k=0 where f (k)(a) is the kth of f evaluated at x = a.

The Taylor series generated by f at x = 0, given by

∞ ∑ f (k)(0) f ′′(0) xk = f(0) + f ′(0)x + x2 + ... k! 2! k=0 is generally called the Maclaurin series generated by f. We must be careful about our interpretation of the above theorem; it is not always the case that the Taylor series of a function f(x) actually converges to f(x) on its entire interval of convergence. In fact, the function f(x) might not be equal to its Taylor series. We will discuss this problem in more detail in the next section.

Example: Find the Taylor series generated by f(x) = ex at x = 0.

Since the Taylor series for f(x) at x = 0 has form

∞ ∑ f (k)(0) f ′′(0) xk = f(0) + f ′(0)x + x2 + ..., k! 2! k=0 we will need to calculate derivatives of ex and evaluate them at x = 0:

2 Section 11.10

f ′(x) = ex f ′(0) = e0 = 1 f ′′(x) = ex f ′′(0) = e0 = 1 . . f (n)(x) = ex f (n)(0) = e0 = 1

So the Taylor series for f(x) = ex at x = 0 is given by

∞ ∑ 1 1 xk = 1 + x + x2 + ... k! 2! k=0 ∞ ∑ 1 Again, at this point we do not know if ex actually equals xk; we will show that the Taylor k! k=0 series does actually equal ex in the next section.

In I, we learned how about linearizations of a function. A linearization of a function f(x) at√ the point x = a is the line to the function at x = a. For example, the function 3 − x − 2 f(x) = x 4 and its linearization at x = 5, given by L(x) = 3 3 , are graphed below:

We like linearizations because they give us a way to approximate a difficult function by√ using a , which is quite simple to work with. Close to x = 5, the function f(x) = 3 x − 4 x − 2 and its linearization 3 3 are nearly indistinguishable, and we may use L(x) as an approximation of f(x). In order to improve the quality of the approximations, we extend this idea to polynomials of higher degree.

Definition 0.0.2. Let f be a function with derivatives of order k for k = 1, 2,...,N in some interval containing a as an interior point. Then for any integer n from 0 to N, the Taylor polynomial of order n generated by f at x = a is the polynomial

f ′′(a) f (n)(a) P (x) = f(a) + f ′(a)(x − a) + (x − a)2 + ... + (x − a)n. n 2! n!

3 Section 11.10 Notice that this polynomial (which has a finite number of terms) is simply a truncation of the Taylor series for f(x); we get the kth Taylor polynomial by erasing all terms from the Taylor series so that n > k. As we will see in the next example, the Taylor polynomials of f(x) become better and better approximations of f(x) as we increase the number of terms in the polynomial.

Example: Given f(x) = cos x, find its Taylor polynomials P0(x), P1(x), P2(x), and P3(x) and its Taylor π series centered at x = 2 . The desired Taylor polynomials are given by π P = f( ) 0 2 π π π P = f( ) + f ′( )(x − ) 1 2 2 2 π π π f ′′( π ) π P = f( ) + f ′( )(x − ) + 2 (x − )2 2 2 2 2 2! 2 π π π f ′′( π ) π f ′′′( π ) π P = f( ) + f ′( )(x − ) + 2 (x − )2 + 2 (x − )3 3 2 2 2 2! 2 3! 2

π So we need to calculate the derivatives of f at 2 :

π f(x) = cos x f( ) = 0 2 π f ′(x) = − sin x f ′( ) = −1 2 π f ′′(x) = − cos x f ′′( ) = 0 2 π f ′′′(x) = sin x f ′′′( ) = 1. 2

So the Taylor polynomials are given by

π P (x) = f( ) = 0 0 2 π π π π P (x) = f( ) + f ′( )(x − ) = −(x − ) 1 2 2 2 2 π π π f ′′( π ) π π π P (x) = f( ) + f ′( )(x − ) + 2 (x − )2 = −(x − ) + 0 = −(x − ) 2 2 2 2 2! 2 2 2 π π π f ′′( π ) π f ′′′( π ) π π 1 π P (x) = f( ) + f ′( )(x − ) + 2 (x − )2 + 2 (x − )3 = −(x − ) + (x − )3. 3 2 2 2 2! 2 3! 2 2 3! 2

π Below is a graph of f(x) = cos x and P1(x) (which is just the linearization of cos x at x = 2 ):

4 Section 11.10

The graph below shows f(x) and P3(x):

Notice that, as we add more terms, the Taylor polynomial seems to become a better and better approximation of the function. In order to find the Taylor series, we need to find

∞ ∑ f (k)( π ) π π π π f ′′( π ) π 2 (x − )k = f( ) + f ′( )(x − ) + 2 (x − )2 + ... k! 2 2 2 2 2! 2 k=0 We end up with

π π π f ′′( π ) π π 1 π f( ) + f ′( )(x − ) + 2 (x − )2 + ... = 0 + −(x − ) + 0 + (x − )3 + ... 2 2 2 2! 2 2 3! 2 π 1 π 1 π = −(x − ) + (x − )3 − (x − )5 + ... ; 2 3! 2 5! 2

so the Taylor series may be written as

∞ ∑ (−1)n+1 π (x − )2n+1. (2n + 1)! 2 n=0 Convergence of Taylor Series

5 Section 11.10 We have one question left to answer: given a function f(x) and the Taylor series generated by f at x = a, does the Taylor series converge to f(x)? In other words, does the equal sign in

∞ ∑ f (k)(a) f(x) = (x − a)k k! k=0 make sense? We will see how to answer that question in this section.

Theorem 0.0.3. Taylor’s Formula If f(x) 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 ′′′(a) f (n)(a) f(x) = f(a) + f ′(a)(x − a) + (x − a)2 + (x − a)3 + ... + (x − a)n + R (x) 2! 3! n! n where f (n+1)(c) R (x) = (x − a)n+1 n (n + 1)! for some c between a and x.

Notice that the theorem rewrites f(x) as f(x) = Pn(x) + Rn(x), the nth Taylor polynomial of f plus the remainder function Rn(x). In effect, the theorem says that plugging x into f is almost the same as plugging x into the nth Taylor polynomial; the remainder function is the difference between f(x) and Pn(x). If the Taylor series generated by f actually converges to f, then the remainder function should approach 0 as the Taylor polynomials approach the Taylor series:

Definition 0.0.4. If Rn(x) → 0 as n → ∞, for all x in I, then the Taylor series generated by f(x) at x = a converges to f on I, and we write

∞ ∑ f (k)(a) f(x) = (x − a)k. k! k=0

Example: Show that the Taylor series generated by ex at x = 0, given by

∞ ∑ xn n! n=0 converges to ex for all x.

Using Taylor’s formula, we may write

x2 x3 xn ex = 1 + x + + + ... + + R (x), 2! 3! n! n

6 Section 11.10 where f (n+1)(c) ec R (x) = xn+1 = xn+1 n (n + 1)! (n + 1)! for some c between a and x.

We need to calculate c e n+1 lim Rn(x) = lim x . n→∞ n→∞ (n + 1)! We will need to break the into three cases:

1. x > 0

2. x = 0

3. x < 0

c x 1. If x > 0, then 0 < c < x means that 1 < e < e . So Rn(x) is given by ec ex R (x) = xn+1 < xn+1, n (n + 1)! (n + 1)!

and we know that 1 ex xn+1 < R (x) < xn+1. (n + 1)! n (n + 1)!

Recall that we need to calculate lim Rn(x); the Squeeze Theorem will apply here if the limits n→∞ on each side of the inequalities happen to be equal. Let’s calculate the limit of the term on the far left:

1 xn+1 lim xn+1 = lim n→∞ (n + 1)! n→∞ (n + 1)! = 0

by the theorem in section 8.1. Now let’s calculate the limit on the far right of the inequality above:

ex xn+1 lim xn+1 = ex lim n→∞ (n + 1)! n→∞ (n + 1)! = ex · 0 = 0.

So by the Squeeze Theorem, lim Rn(x) = 0. n→∞

7 Section 11.10 2. If x = 0, then since x2 x3 xn ex = 1 + x + + + ... + + R (x), 2! 3! n! n then on one hand we know that 0 0 0 e0 = 1 + 0 + + + ... + + R (0) = 1 + R (0); 2! 3! n! n n 0 but we also know that e = 1, so we have 1 = 1 + Rn(0), which means that Rn(0) = 0. 3. If x < 0, then x < c < 0, and 0 < ex < ec < 1. With

c e n+1 1 n+1 0 < |Rn(x)| = x < x , (n + 1)! (n + 1)! we can again use the Squeeze Theorem to show that

lim Rn(x) = 0. n→∞

x x We conclude that lim Rn(x) = 0 for every x, so the Taylor series for e converges to e for n→∞ every x; thus we are justified in writing ∞ ∑ 1 ex = xk. k! k=0

Two Taylor series that we will see quite often are the series for sin x and for cos x.

The function f(x) = sin x has Taylor series ∞ ∑ x2n+1 x3 x5 x7 sin x = (−1)n = x − + − ..., (2n + 1)! 3! 5! 7! n=0 and the series converges to sin x for all x.

The function f(x) = cos x has Taylor series ∞ ∑ x2n x2 x4 x6 cos x = (−1)n = 1 − + − ..., (2n)! 2! 4! 6! n=0 and the series converges to cos x for all x.

Applications of Taylor Series

Taylor series behave very well on their intervals of convergence.

Theorem 0.0.5. If the Taylor series Tf (x) converges to f(x) on the interval I and the Taylor series Tg(x) converges to g(x) on the same interval, then the Taylor series for the function f(x)  g(x) is given by Tf (x)  Tg(x), and this Taylor series converges to f(x)  g(x) on I.

8 Section 11.10 In essence, the theorem says that we can add or subtract Taylor series on a common interval of convergence, and the result is again a Taylor series. We may also multiply a Taylor series by a constant without changing it too much:

Theorem 0.0.6. If the Taylor series Tf (x) converges to f(x) on the interval I and c is any constant, then the Taylor series for the function cf(x) is given by cTf (x), and this Taylor series converges to cf(x) on I.

Examples: ex − 1 − x Evaluate lim . x→0 x2

0 Notice that the limit above yields the indeterminate form 0 , so we could use L’Hopital’s rule to evaluate it. However, we can use series to do the same thing: we know that the Taylor series for ex is given by x2 x3 ex = 1 + x + + + ... ; 2! 3! in addition, it is easy to see that the Taylor series for −1 − x is just −1 − x. So ex − 1 − x can be rewritten as x2 x3 x2 x3 x4 ex − 1 − x = (1 + x + + + ...) − 1 − x = + + + ... 2! 3! 2! 3! 4! Then

2 3 4 ex − 1 − x x + x + x + ... lim = lim 2! 3! 4! x→0 x2 x→0 x2 1 x x2 = lim + + + ... x→0 2 3! 4! 1 = . 2

Find the Taylor series for cos2 x.

Since 1 + cos 2x 1 1 cos2 x = = + cos 2x, 2 2 2 it will not be difficult to find the required series. Since

∞ ∑ x2n cos x = (−1)n , (2n)! n=0 we can replace x with 2x to see that

∞ ∑ (2x)2n cos 2x = (−1)n . (2n)! n=0

9 Section 11.10 So 1 + cos 2x 1 1 = + cos 2x 2 2 2 ∞ 1 1 ∑ (2x)2n = + (−1)n 2 2 (2n)! n=0 1 1 4x2 16x4 64x6 = + (1 − + − ...) 2 2 2! 4! 6! 1 1 2x2 8x4 32x6 = + ( − + − ...) 2 2 2! 4! 6! 2x2 8x4 32x6 = 1 − + − ... 2! 4! 6! ∞ ∑ 22n−1x2n = 1 + (−1)n . (2n)! n=1

The We have learned the power series representations for the functions ex, sin x, and cos x. In this section, we will learn the power series representation for an entire class of functions: every function of the form (1 + x)m can be represented by a Taylor series known as the Binomial Series. Before we look at this series in detail we need a bit of new notation. ( ) m Definition 0.0.7. Given a real numbers m and nonnegative integer k, the number k , read ”m choose k”, is given by m(m − 1)(m − 2) · ... · (m − k + 1) ( ) k! ≥ m if k 1, and 0 is defined to be 1.

( ) For example, to determine 7 , we have m = 7 and k = 4. Then m − k + 1 = 4 4 ( ) 7 7 · 6 · 5 · 4 = 4 4! = 35.

(− 1 ) − 1 3 − − 1 − − 7 With m = 3 and k = 3, we compute 3 by noting that m k + 1 = 3 3 + 1 = 3 ; so (− 1 ) 3 3 is given by ( ) − 1 (− 1 ) · (− 4 ) · (− 7 ) 3 = 3 3 3 3 3! 14 = − . 81

10 Section 11.10 Theorem 0.0.8. The function (1 + x)m, where m is a constant, has power series representation ∞ ( ) ∑ m 1 + xk, k k=1 called the binomial series. The power series converges to (1 + x)m when −1 < x < 1, that is ∞ ( ) ∑ m (1 + x)m = 1 + xk for all x so that − 1 < x < 1. k k=1

Two different cases emerge depending on the form of m. If m ≥ 0 is an integer, then for k > m, ( ) m m · (m − 1) · (m − 2) · ... · (m − m) · ... · (m − k + 1) = = 0. k k! In other words, the binomial series will have a finite number of terms. For any value of m other than a nonnegative integer, the binomial series will have an infinite number of terms.

Examples: √ Find the power series for 3 8 + x.

If we rewrite the function in the form √ √ √ 3 x x x 1 8 + x = 3 8(1 + ) = 2 3 1 + = 2(1 + ) 3 , 8 8 8 it becomes clear that it may be represented with the binomial series. Since ∞ ( ) ∑ m (1 + x)m = 1 + xk k k=1 1 with m = 3 , we have √ 3 x 1 8 + x = 2(1 + ) 3 (8 ) ( ) ( ) 1 x 1 x 1 x = 2(1 + 3 + 3 ( )2 + 3 ( )3 + ...) 1 8 2 8 3 8 − − − 1 x 1 · 2 x 1 · 2 · 5 x = 2(1 + 3 · + 3 3 · ( )2 + 3 3 3 · ( )3 + ...) 1! 8 2! 8 3! 8 1 x 1 x 5 x = 2(1 + · − · ( )2 + · ( )3 + ...) 3 8 9 8 81 8 x x2 5x3 = 2(1 + − + + ...) 24 576 41472 x x2 5x3 = 2 + − + + ... 12 288 20736

11