1 M 13-Lecture Contents: 1) Taylor Polynomials 2) Taylor Series Centered at x a 3) Applications of Taylor Polynomials Taylor Series The previous section served as motivation and gave some useful expansion. However, we must now generalize the approach in order to be able to represent other function as infinite sums of polynomials. That is, given a differentiable function f(x), for which sequence of constants (a k ) k can we write f(x) a k x k? Lets say we want this expression for x near zero. Then letting x notice that f() a k () k a, which fixes the constant a f(). Similarly if we differentiate notice that f (x) a k (x k ) a k kx k 1 a k kx k 1. Once again letting x we obtain f () Continuing in this manner we see that which gives at x And f () k2 k1 a k k() k 1 a 1 a 1 f (). k1 f (x) f (x) a k k(k 1)x k 2, k2 a k k(k 1)() k 2 2a 2 a 2 f (). 2 a k k(k 1)(k 2)x k 3, k3
2 which gives at x In general, we see that Therefore f () k3 a k k(k 1)(k 2)() k 2 3 2a 3 a 3 f (). f (k) () a k a k f (k) (). f(x) f (k) () x k, holds for all values of x for which the series converges (known as the interval of convergence). The series on the right hand side is known as the Taylor series of f(x). Because we have evaluated all the coefficients by the substitution x, we say that the resulting power series is the Taylor series of the function centered at x, which is sometimes also called the Maclaurin series. Furthermore, we call T N (x) the Taylor Polynomial of degree N of f(x). N f (k) () x k, Ex: Find the Taylor series of e x centered at x. Solution: Notice that for any k the k-th derivate of f(x) e x is f (k) (x) e x so that a k f (k) () e 1. Therefore the Taylor series of e x centered at x is given by e x x k, and this Taylor polynomial expansion holds for any x where the series converges. To investigate this, we use the ratio test ρ lim a k+1 k a k lim (x k+1 /(k + 1)!) k (x k /) x k+1 lim k x k (k + 1)! lim x k k + 1,
3 so this limit is less than 1 (i.e., ρ < 1) for any x. Therefore this Taylor expansion holds for any x, so that the interval of convergence is the whole line (, ). Notice that we can use known Taylor expansions to derive new ones, for example replacing x with x 2 in our expansion above we obtain e x2 (x 2 ) k Ex: Find the Taylor series of sin(x) centered at x. x 2k. Solution: We must compute the terms a k for all k. We obtain a f() sin(x) x a 1 f () cos(x) x 1 a 2 f () 2! a 3 f () a 4 f (4) () 4! sin(x) x 2 cos(x) x sin(x) x 4! 1 After this notice that the derivatives will repeat, and notice that all the even terms are. This so far gives sin(x) a k x k a k x k a 2k+1 x 2k+1. k is odd. Now to find a pattern in the constants pertaining to odd indices, from above we have so that in general a 2k+1 ( 1)k (2k+1)! and thus sin(x) a 1 1 a 3 1 a 5 1 5! a 7 1 7! a 9 1 9! a 2k+1 x 2k+1 (2k + 1)! x2k+1.
4 Notice that sin(x) is an odd function and as a results its Taylor Polynomial only involves the odd polynomials. Challenge Question: Derive the Taylor Polynomial for cos(x) centered at. (notice that cos(x) is an even function, so its Taylor polynomial should only contain even polynomials). The accuracy of these truncated Taylor series (i.e., their partial sums) is illustrated in Figure 1. Notice that as we increase the degree of our polynomial the approximation becomes more accurate. Fig. 1. Plots of the function y sin(x) and various of its Taylor Polynomials of degree n, T n(x). (top) Plot of sin(x) and T (x). (middle) Plot of sin(x) and T 3(x). (bottom) Plot of sin(x) and T 9(x). Taylor Series Centered at x a
5 All Taylor series discussed so far were centered at x. Now we want to extend the concept of Taylor series to derive a polynomial representation of a function f(x) centered at an arbitrary point x a. The crucial idea for the derivation of the Taylor series was that f(x) and its derivatives are subsequently evaluated at x in order to obtain polynomials that represent better and better approximations of f(x) in the vicinity of. In exactly the same spirit we can approximate f(x) at an arbitrary point x a: f (k) (a) f(x) (x a) k, which once again holds wherever the series converges (i.e., in the interval of convergence). Alternatively, you can imagine to translate f(x) horizontally by distance a and apply the Taylor expansion centered at y for the translated function f(y) with y x a. Applications of Taylor Polynomials Aside from the use of Taylor Polynomials to approximate values of functions, we can also use them to compute integrals that cannot be done with our integration techniques. Ex: Compute sin(x2 )dx. Solution: Notice that the antiderivative of sin(x 2 ) is not easy to compute (substitution and integration by parts won t work). Instead we the Taylor Polynomial we derive and replace x with x 2 to obtain sin(x 2 ) (2k + 1)! (x2 ) 2k+1 (2k + 1)! x4k+2. This gives sin(x 2 )dx [ x 4k+3 (2k + 1)! 4k + 3 ( 1) Notice that this series is alternating and k (2k + 1)! x4k+2 dx ] 1 (4k+3)(2k+1)! (2k + 1)! x 4k+2 dx (4k + 3)(2k + 1)!. 1 is monotonically decreasing with (4k+3)(2k+1)! limit zero so that this series does converge by the alternating series test. Therefore, our integral evaluates to sin(x 2 )dx (4k + 3)(2k + 1)!.312...
6 Challenge Question: Find the antiderivative of e x2 important function (known as the Gaussian) with no elementary antiderivative). (known as the error function). (This is a very We can also use Taylor Polynomials to solve differential equations that cannot be solved via separation of variables. Ex: Solve the differential equation dy dx x2 y + 1, y() 1 Solution: Indeed notice that this differential equation cannot be solved via separation of variables. Instead let us expand our solution as From the intial condition we see that y y() 1 Then from the differential equation we see that This gives constaints dy dx a k x k. a k () k a 1. dy dx x2 y + 1 a k x k x 2 a k x k + 1 a k dy dx xk a k kx k 1 k1 k2 a k x k+2 + 1 a k x k+2 + 1 a 1 + 2a 2 x + a k+1 (k + 1)x k 1 + a k 2 x k. a 1 1 a 2 k2 and a k+1 (k + 1) a k 2 a k+1 a k 2 k + 1
7 which generates a sequence: a 1 a 1 1 a 2 a 3 a 3 1 3 a 4 a 1 4 1 4 a 5 a 2 5 a 6 a 3 6 1 3 6 a 7 a 4 7 1 4 7 a 8 a 5 8 a 9 a 6 9 1 3 6 9 a 1 a 7 1 1 4 7 1 a 11 a 8 11 So in general the constants that define the solution y a kx k are given by a 3k+1 a 3k 1 3 n n!, k 1 1 4 7... (3(k 1) + 1) (3k + 1), k a 3k+2, k and so y a k x k a 3k x 3k + a 3k+1 x 3k+1 + a 3k+2 x 3k+2 x 3k 3 k + x 3k+1 1 4 7... (3k + 1) Super Challenge Question: Find a closed expression for the function f(x) x3k 3 k.