Taylor Series Given a function f(x), we would like to be able to find a power series that represents the function. For example, in the last section we noted that we can represent e x by the power series e x = + x + x2 + x! + x4 4! +..., and the power series converges to e x 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 f(x) = a n (x a) n = a 0 + a (x a) + a 2 (x a) 2 + a (x a) +... The only unknowns above are the coefficients a i ; 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 derivatives 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: f(x) = a 0 + a (x a) + a 2 (x a) 2 + a (x a) + a 4 (x a) 4 +... f (x) = a + 2a 2 (x a) + a (x a) 2 + 4a 4 (x a) +... + na n (x a) n +..., f (x) = 2a 2 + 2 a (x a) + 4a 4 (x a) 2 +... + (n ) na n (x a) n 2 +..., f (x) = 2 a + 2 4a 4 (x a) +... + (n 2) (n ) na n (x a) n 2 +..., and in general, f (n) (x) = n! a n +..., 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) = a 0, f (a) = a, f (a) = 2a 2, f (a) = 2 a, and in general, f (n) (a) = n! a n, since x a = 0. This tells us the values for the coefficients:
a 0 = f(a), a = f (a), and in general a 2 = f (a), a = f (a),! a n = f (n) (a). n! Definition 0.0.. Let f be a function with derivatives of all orders throughout some interval containing a as an interior point. Then the Taylor series generated by f at x = a is given by f (k) (a) (x a) k = f(a) + f (a)(x a) + f (a) (x a) 2 +... where f (k) (a) is the kth derivative of f evaluated at x = a. The Taylor series generated by f at x = 0, given by f (k) (0) x k = f(0) + f (0)x + f (0) x 2 +... 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) = e x at x = 0. Since the Taylor series for f(x) at x = 0 has form f (k) (0) x k = f(0) + f (0)x + f (0) x 2 +..., we will need to calculate derivatives of e x and evaluate them at x = 0: 2
f (x) = e x f (0) = e 0 = f (x) = e x f (0) = e 0 =. f (n) (x) = e x f (n) (0) = e 0 = So the Taylor series for f(x) = e x at x = 0 is given by xk = + x + x2 +... Again, at this point we do not know if e x actually equals series does actually equal e x in the next section. xk ; we will show that the Taylor In Calculus I, we learned how about linearizations of a function. A linearization of a function f(x) at the point x = a is the line tangent to the function at x = a. For example, the function f(x) = x 4 and its linearization at x = 5, given by L(x) = x 2, are graphed below: We like linearizations because they give us a way to approximate a difficult function by using a linear function, which is quite simple to work with. Close to x = 5, the function f(x) = x 4 and its linearization x 2 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 =, 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 P n (x) = f(a) + f (a)(x a) + f (a) (x a) 2 +... + f (n) (a) (x a) n. n!
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 P 0 (x), P (x), P 2 (x), and P (x) and its Taylor series centered at x = π 2. The desired Taylor polynomials are given by P 0 = f( π 2 ) P = f( π 2 ) + f ( π 2 )(x π 2 ) P 2 = f( π 2 ) + f ( π 2 )(x π 2 ) + f ( π 2 ) (x π 2 )2 P = f( π 2 ) + f ( π 2 )(x π 2 ) + f ( π 2 ) (x π 2 )2 + f ( π 2 ) (x π! 2 ) So we need to calculate the derivatives of f at π 2 : f(x) = cos x f( π 2 ) = 0 f (x) = sin x f ( π 2 ) = f (x) = cos x f ( π 2 ) = 0 f (x) = sin x f ( π 2 ) =. So the Taylor polynomials are given by P 0 (x) = f( π 2 ) = 0 P (x) = f( π 2 ) + f ( π 2 )(x π 2 ) = (x π 2 ) P 2 (x) = f( π 2 ) + f ( π 2 )(x π 2 ) + f ( π 2 ) (x π 2 )2 = (x π 2 ) + 0 = (x π 2 ) P (x) = f( π 2 ) + f ( π 2 )(x π 2 ) + f ( π 2 ) (x π 2 )2 + f ( π 2 ) (x π! 2 ) = (x π 2 ) +! (x π 2 ). Below is a graph of f(x) = cos x and P (x) (which is just the linearization of cos x at x = π 2 ): 4
The graph below shows f(x) and P (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 We end up with f (k) ( π 2 ) (x π 2 )k = f( π 2 ) + f ( π 2 )(x π 2 ) + f ( π 2 ) (x π 2 )2 +... f( π 2 ) + f ( π 2 )(x π 2 ) + f ( π 2 ) (x π 2 )2 +... = 0 + (x π 2 ) + 0 +! (x π 2 ) +... = (x π 2 ) +! (x π 2 ) 5! (x π 2 )5 +... ; so the Taylor series may be written as Convergence of Taylor Series ( ) n+ (2n + )! (x π 2 )2n+. 5
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(x) = f (k) (a) (x a) k make sense? We will see how to answer that question in this section. Theorem 0.0.. 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(x) = f(a) + f (a)(x a) + f (a) where for some c between a and x. (x a) 2 + f (a)! R n (x) = f (n+) (c) (x a)n+ (n + )! (x a) +... + f (n) (a) (x a) n + R n (x) n! Notice that the theorem rewrites f(x) as f(x) = P n (x) + R n (x), the nth Taylor polynomial of f plus the remainder function R n (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 P n (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 R n (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(x) = f (k) (a) (x a) k. Example: Show that the Taylor series generated by e x at x = 0, given by converges to e x for all x. Using Taylor s formula, we may write x n n! e x = + x + x2 + x! +... + xn n! + R n(x), 6
where for some c between a and x. We need to calculate R n (x) = f (n+) (c) (n + )! xn+ = We will need to break the limit into three cases:. x > 0 2. x = 0. x < 0 e c (n + )! xn+ lim R e c n(x) = lim (n + )! xn+.. If x > 0, then 0 < c < x means that < e c < e x. So R n (x) is given by and we know that R n (x) = e c (n + )! xn+ < (n + )! xn+ < R n (x) < e x (n + )! xn+, e x (n + )! xn+. Recall that we need to calculate lim R n(x); the Squeeze Theorem will apply here if the limits on each side of the inequalities happen to be equal. Let s calculate the limit of the term on the far left: lim (n + )! xn+ = lim = 0 x n+ (n + )! by the theorem in section 8.. Now let s calculate the limit on the far right of the inequality above: lim e x (n + )! xn+ = e x lim = e x 0 = 0. x n+ (n + )! So by the Squeeze Theorem, lim R n(x) = 0. 7
2. If x = 0, then since e x = + x + x2 + x! +... + xn n! + R n(x), then on one hand we know that e 0 = + 0 + 0 + 0! +... + 0 n! + R n(0) = + R n (0); but we also know that e 0 =, so we have = + R n (0), which means that R n (0) = 0.. If x < 0, then x < c < 0, and 0 < e x < e c <. With 0 < R n (x) = e c (n + )! xn+ < (n + )! xn+, we can again use the Squeeze Theorem to show that lim R n(x) = 0. We conclude that lim R n(x) = 0 for every x, so the Taylor series for e x converges to e x for every x; thus we are justified in writing e x = xk. 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 sin x = ( ) n x2n+ (2n + )! = x x! + x5 5! x7 7!..., and the series converges to sin x for all x. The function f(x) = cos x has Taylor series cos x = ( ) n x2n and the series converges to cos x for all x. (2n)! = x2 + x4 4! x6 6!..., Applications of Taylor Series Taylor series behave very well on their intervals of convergence. Theorem 0.0.5. If the Taylor series T f (x) converges to f(x) on the interval I and the Taylor series T g (x) converges to g(x) on the same interval, then the Taylor series for the function f(x) ± g(x) is given by T f (x) ± T g (x), and this Taylor series converges to f(x) ± g(x) on I. 8
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 T f (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 ct f (x), and this Taylor series converges to cf(x) on I. Examples: e x x Evaluate lim x 0 x 2. Notice that the limit above yields the indeterminate form 0 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 e x is given by e x = + x + x2 + x! +... ; in addition, it is easy to see that the Taylor series for x is just x. So e x x can be rewritten as Then e x x = ( + x + x2 + x x2 +...) x =! + x! + x4 4! +... e x x x 2 + x lim x 0 x 2 = lim x 0! + x4 x 2 4! +... = lim x 0 2 + x! + x2 4! +... = 2. Find the Taylor series for cos 2 x. Since cos 2 + cos 2x x = = 2 2 + cos 2x, 2 it will not be difficult to find the required series. Since cos x = ( ) n x2n (2n)!, we can replace x with 2x to see that cos 2x = ( ) n (2x)2n (2n)!. 9
So + cos 2x 2 = 2 + cos 2x 2 = 2 + ( ) n (2x)2n 2 (2n)! = 2 + 4x2 ( + 6x4 64x6...) 2 4! 6! = 2 + ( 2 2x2 + 8x4 4! 2x6 6! = 2x2 + 8x4 2x6... 4! 6! = + ( ) n 22n x 2n. (2n)! n=...) The Binomial Series We have learned the power series representations for the functions e x, 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 ( + 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. Definition 0.0.7. Given a real numbers m and nonnegative integer k, the number ( m k ), read m choose k, is given by m(m )(m 2)... (m k + ) if k, and ( m 0 ) is defined to be. For example, to determine ( 7 4), we have m = 7 and k = 4. Then m k + = 4 ( ) 7 = 7 6 5 4 4 4! = 5. ( With m = and k =, we compute ( ) by noting that m k + = + = 7 ) ; so is given by ( ) = ( ) ( 4 ) ( 7 )! = 4 8. 0
Theorem 0.0.8. The function ( + x) m, where m is a constant, has power series representation ( ) m + x k, k k= called the binomial series. The power series converges to ( + x) m when < x <, that is ( ) m ( + x) m = + x k for all x so that < x <. k k= Two different cases emerge depending on the form of m. If m 0 is an integer, then for k > m, ( ) m m (m ) (m 2)... (m m)... (m k + ) = = 0. 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 8 + x. If we rewrite the function in the form 8 + x = 8( + x8 ) = 2 + x 8 = 2( + x 8 ), it becomes clear that it may be represented with the binomial series. Since ( ) m ( + x) m = + x k k with m =, we have x 8 + x = 2( + 8 ) ( = 2( + = 2( + ) x 8 +! x 8 + k= ( ) ( x ( 2 8 )2 + 2 ( x 8 )2 + ) ( x 8 ) +...) 2 5! = 2( + x 8 9 (x 8 )2 + 5 8 (x 8 ) +...) = 2( + x 24 x2 576 + 5x 4472 +...) = 2 + x 2 x2 288 + 5x 2076 +... ( x 8 ) +...)