Taylor Series
Taylor Series
Taylor Series
C HAPTER 3
P OWER S ERIES
3.3.
TAYLOR S ERIES
Having explored sequences, series, and power series, we are now ready to return to our original motivation: Taylor polynomials. Recall that the Taylor polynomial of degree n for a, Tn x , is the unique polynomial of degree n which matches f x f x centered at x and its rst n derivatives at x a. Back in Section 1.1, we observed that higher degree Taylor polynomials tended to give better approximations to f x . Then in Section 1.2 we made this observation precise with the Remainder Theorem.
The Remainder Theorem. Suppose that f is n 1 times differentiable and let Rn denote the difference between f x and the Taylor polynomial of degree n for f x centered at a. Then Rn x f x Tn x f
n 1
c x 1!
n 1
Now that we have established the notion of series, we are ready to consider Taylor polynomials of innite degree, which we will call Taylor series . These are a special type of power series.
Taylor Series. Suppose that the function f x is innitely differentiable (smooth) at x a. The Taylor series for f x centered at x a is then f n a x a n. n ! n 0
Assuming that we can compute all the derivatives of f x at x very concrete, but it leaves some unanswered questions:
a, this denition is
Where does the Taylor series for f x converge? When the Taylor series for f x does converge, does it converge to f x ? In general, these two questions must be answered on a function-by-function basis, and such answers revolve around the Remainder Theorem.
Taylor series centered at x 0 are sometimes referred to as Maclaurin series after the Scottish mathematician Colin Maclaurin (16981746).
S ECTION 3.3
TAYLOR S ERIES
119
For our rst case study, we consider the function f x sin x, centered at x 0. Since the derivatives of sin x repeat in the pattern cos x, sin x, cos x, sin x, the sequence of derivatives evaluated at x 0 is 1, 0, 1, 0, . . . . Therefore the Taylor series for sin x centered at x 0 is: 1
n 0 n
x2n 1 2n 1 !
x3 3!
x5 5!
x7 7!
We could apply the Ratio Test to this series (as in Section 3.1) to show that it converges for all x, but there is a more important question: Does this series converge to sin x for all x? By the Remainder Theorem, the difference between sin x and its Taylor polynomial of degree n centered at x 0, Tn x , is sin x Tn x Rn x sin n 1 c n x n 1!
1
for some c between 0 and x. Since the derivatives of sin x only take on values between 1 and 1, we have that xn 1 . Rn x n 1! We would like to show that the Taylor series for sin x converges to sin x for all x, which is ). This is really equivalent to showing that the limit of the remainders Rn x is 0 (as n just an exercise from Section 2.1, although we have delayed it now. Fact 1. For all values of x, lim
n
xn n!
0.
Proof. First let us consider a special case, where x 4. In this case, we are interested in the sequence 4n n! . For the rst 4 terms, this sequence is actually increasing:
n 0 1 2 3 4 4n 1 4 42 43 44 n!
2! 3! 4!
8 10.6666 . . . 10.6666 . . .
But then the sequence starts decreasing. To get the n 5 term, we multiply the n 4 term by 4 5; to get the n 6 term we multiply this by 4 6; to get the n 7 term we multiply this by 4 7, and so on. For n 5, we therefore have the bound 4n n! 4 5
n 4
44 4!
0 as n
. x . We
Our proof for generic x follows the same general approach. Choose an integer m have, for n m, xn n! n n n 1 xn m 1 m m x m 1! mn xn m m 1! .
m terms, all
120
C HAPTER 3
P OWER S ERIES
Ideally we would like to have mn in the denominator, so we multiply top and bottom by mm : xn n! x n mm mn m 1 ! xn mn mm . m 1!
Our goal is to prove that the sequence x n n! converges to 0 by sandwiching it between the constant sequence 0 and the sequence above. Remember that m is not changing, so mm m 1 ! is just a constant. Since m x 0, x m 0. is between 0 and 1, so Example 5 of Section 2.1 shows that the geometric sequence x m n n Therefore, by the Sandwich Theorem, x n! 0 as n for all values of x.
Our next example collects these observations to show that the Taylor series for sin x centered at x 0 converges to sin x.
Solution. Proving this statement is equivalent to showing that for any xed value of x, the remainder term Rn x tends to 0 as n . Fix a value of x. By the Remainder Theorem, our previous bounds, and Fact 1, xn 1 n 1!
Rn x
sin x
Tn x
0 as n
Example 2 is in some sense completely bizarre. Remember that we dened Taylor a (the center). polynomials (and therefore series as well) by mathcing derivatives at x Therefore, this example shows that if a power series matches all of the derivatives of sin x at x 0, then the series is equal to sin x for all values of x. Why should sin x be completely determined by its derivatives at 0? With our limited tools, the best answer we will be able to provide here is that sin x is a very well-behaved function; the technical term for such functions is analytic. cos x, but there is an easier The same approach would work for the function f x way. Now that we know that the Taylor series for sin x centered at x 0 converges to sin x
This type of convergence is known as pointwise convergence, because the Taylor series converges to sin x at each individual point. There is a stronger, more global type of convergence known as uniform convergence.
S ECTION 3.3
TAYLOR S ERIES
121
x2n 1 2n 1 ! 1 x2n 2n 1 !
2n x2n 2n ! x4 4!
1
n 0
x2 2
x6 6!
ex , again centered at x 0. For our next case study, we consider the function f x x x n Since every derivative of e is e itself, f 0 1 for every n, and thus the Taylor series centered at x 0 for ex is xn n! 0 1 x x2 2 x3 3! x4 4! .
Example 3. Show that the Taylor series centered at x values of x. Solution. We want to show that for xed x, Rn x Theorem shows that Rn x ex Tn x n
0 as n ec 1! xn
1
. The Remainder
for some c between 0 and x (here we used the fact that the n 1st derivative of ex is ex itself). We have to be a little careful here about giving a bound for ec , since the bound changes depending on whether x is positive or not: ec ex if x 1 if x 0, 0.
Still, since we are considering a xed value of x, our bound on ec is just a constant, and Fact 1 shows that xn 1 0 as n . n 1! Therefore Rn x 0 as n , proving that the Taylor series for ex centered at x converges to ex for all values of x. 0
122
C HAPTER 3
P OWER S ERIES
Substituting x
1 n! 0
1 1!
1 2!
1 3!
Because n! grows so quickly, this series converges to e exceptionally fast. For example, using just the rst 10 terms, we get e correct to six decimal places:
9 n
e 1 n! 0
2.7182818 . . . 2.7182815 . . .
The speed of this convergence (and it really is fast at n 59, we are adding the reciprocal of the estimated atoms in the universe, about 10 80 ) allows us to prove that e is irrational in Exercises 5052. As with general power series, we are allowed to substitute into Taylor series and to multiply and divide them. This can be quite useful for expressing integrals as power series (our next example), evaluating limits (Example 5), computing derivatives (Example 6), and nding Taylor series for quotients (Example 7). Example 4. Express sin x2 dx as a power series.
x2n 1 , 2n 1 ! x4n 2 . 2n 1 !
so sin x2
n 0
x2 2n
2n 1
1!
1
n 0
x4n 2 2n 1 !
1
n 0
4n
x4n 3 3 2n
1!
C.
It has been proved that the antiderivative of sin x2 dx is not an elementary function, so this one of the nicest possible ways to express this integral.
cos x
1 x4
x2 2
S ECTION 3.3
TAYLOR S ERIES
123
Solution. While this example could be solved with lHopitals Rule, it is easier to use power series. We know that cos x
n 0
x2n 2n !
x2 2
x4 4!
x6 6!
x2 2
x2 2
x4 4!
x6 6! x4
x2 2
0.
xn , n! 0
n 0
2x3 n!
3
n n
Since this is the Taylor series for f x series, we know that it is equal to
e2x centered at x f
n 0 n
n!
xn .
102
by substituting n
102 3
124
C HAPTER 3
102
P OWER S ERIES
Solving for f
0 shows that f
102
We could have solved this problem simply by taking 102 derivatives, but nding the Taylor series is much easier. Example 7. Find the rst four nonzero terms of the Taylor series centered at x function f x tan x. 0 for the
Solution. It would be possible to solve this problem by taking derivatives of tan x, but this approach gets quite messy. An easier method is to use the series we have for sin x and cos x together with the Division Theorem from Section 3.2. Since tan x we can use long division x 1
x2 2 x4 24 x6 720 x3 3 x3 6 x3 2 x3 3 x3 3 2x5 15 x5 120 x5 24 x5 30 x5 6 2x5 15 2x5 15 17x7 315 x7 5040 x7 720 x7 840 x7 72 4x7 315 x7 15 17x7 315
sin x cos x
x 1
x3 3! x2 2!
x5 5! x4 4!
x7 7! x6 6!
x x
to nd that the rst four nonzero terms of the Taylor series centered at x x x3 3 2x5 15 17x7 . 315
0.
We can also use the Taylor series for ex to dene the function ex for more quantities than just real numbers. For example, we can dene ex for complex numbers x. Recall that a complex number is a number of the form a bi where a and b are real numbers, and i is the (imaginary) square-root of 1. This leads to the following formula, which the Nobel Prize winning physicist Richard Feynman (19181988) referred to as one of the most remarkable, almost astounding, formulas in all of mathematics: Example 8 (Eulers Formula). Prove Eulers Formula ei cos i sin .
S ECTION 3.3
TAYLOR S ERIES
125
in n n! 0
i2n 2n 2n ! 0
i2n 1 2n 1 . 2n 1 ! 0
1, i i2 i
2
i,
2
i i
i
4
1 i.
1,
i i
This shows that the powers of i form a periodic sequence i, 1, i, 1, . . . , which allows us to simplify our series for ei above: ei
n 0
1 n 2n 2n !
i
n 0
1 n 2n 1 2n 1 !
cos
i sin .
An alternative proof, using derivatives, is outlined in Exercise 45. A particularly wondrous special case of Eulers Formula, known as Eulers Identity, is, ei 1 0,
an identity relating ve of the most important numbers in all of mathematics. In Exercises 4649 we use a similar approach to dene eM for a matrix M . Eulers formula is also a very convenient way to prove various trigonometric identities. For example, the angle addition formulas, which show how to evaluate sin and cos in terms of sin , sin , cos , and cos , have a particularly straightforward derivation using Eulers formula. As the French mathematician Jacques Hadamard (1865 1963) wrote, the shortest route between two truths in the real domain sometimes passes through the complex domain. Example 9. Derive the angle addition formulas. Solution. We begin with the trigonometric functions we are interested in, convert to exponentials, simply the expression, and then convert back to trigonometric functions: cos i sin e
i
ei e i cos i sin cos sin sin i sin i sin cos cos sin . cos cos
126
C HAPTER 3
P OWER S ERIES
Now equate real and imaginary parts of both sides to see that cos sin as desired. We know from Section 3.1 that power series dene innitely differentiable (smooth) functions when they converge, so not every function is equal to its Taylor series (in fact, a function much be innitely differentiable for us to even dene its Taylor series). Our success in this section and the last with nding Taylor series for innitely differentiable functions suggests a nal question: Is every innitely differentiable function equal to its Taylor seres? The answer is no. A counterexample is provided by the function f x whose plot is shown below. e 0
1 x2
if x if x
0, 0,
It is possible (using lHopitals Rule) to establish that every derivative of this function 0 is 0, so therefore its Taylor series is simply 0, which does not converge to this at x function. Therefore, innite differentiability is a necessary condition for a function to equal its Taylor series, but it is not a sufcient condition.
S ECTION 3.3
TAYLOR S ERIES
127
19.
n 0
n!
n
0 20.
2 n 0
2n 2n !
2x3 centered at x 0 0 1
0 Derive Taylor series for the integrals in Exercises 2124 (centered at x 0). Note that none of these integrals has an answer in terms of elementary functions. 0 0 21. 22. 23. cos x3 x2 sin x dx x e
x2 2
centered at x
centered at x centered at x
dx
dx
Compute the limits in Exercises 916 using Taylor series. sin x x 9. lim x 0 x3 x arctan x 10. lim x 0 x3 11. lim
x
24.
ln x 1 dx x
Use the Remainder Theorem in Exercises 2530. 25. Give an upper bound on the error when us1 x x2 2 x3 6 to approximate ing T3 x x f x e for 0 x 1 2. 26. Give an upper bound on the error when using T1 x x to approximate f x tan x for 4 x 4. 27. Give an upper bound on the error when using 1 2x 1 3 x 1 2 4 x 1 3 to T3 x 1 x2 for 3 4 approximate f x x 5 4. 28. Give an upper bound on the error when using 2 x 4 4 x 4 2 64 to approximate T2 x f x x for 4 x 4.1. 29. Give an upper bound on the error when using x 1 x 12 2 x 1 3 6 to approxT3 x 1 imate f x x ln x for 2 x 3 2. 30. Give an upper bound on the error when using T4 x x x2 2 x3 3 x4 4 to approximate ln 1 x for 0 x 1. f x 31. Prove that xn n! 0 as n for every xed value of x. (Note that this is a bit stronger than Fact 1.)
ex x sin x 2
12. lim
x
arctan x x3
3
13. lim
x
2 cos x x6
14. lim
x
15. lim
x
16. lim
x
Use Taylor series of known functions to evaluate the sums in Exercises 1720. 2n 17. 1n 2n ! n 0 18.
n 0
2n 2n
2n 1
1!
128
C HAPTER 3
P OWER S ERIES
39. Give a bound on the error involved in the estimate in Exercise 38 by observing that R3
12 12 4 12 5 12 6
For Exercises 3235, give the Taylor polynomials of 0) for the specied funcdegree 8 (centered at x tions. 4 32. f x ecos x 33. f x 34. f x 35. f x 1 x x2 sin x3 sin x 1 2x ln cos x
4
12 4
5 1
12
6
12 2
Exercises 3639 investigate another way to bound the error in using Taylor polynomials to approximate functions. Consider rst the example of using T3 x 1 x x2 2 x3 6 to approximate e1 2 . We could of course use the Remainder Theorem for this problem (as is requested in Exercise 25), but since we know that e1
2
n 2
40. Compute the 10th partial sum of this series. 41. Prove that the sum of this series is not 19. 42. Use Eulers formula to prove the two identities cos sin ei 2 ei e 2i
i
12
12
12
12 n 4
n!
another way to estimate this error is simply to bound the tail by comparing it to a geometric series:
12 n n 4 12 4 12 5 12 6
, .
n!
4!
12 4
5!
12 5
6!
12 6
4!
12 4
4 4! 1
12
42 4!
12
4!
12 4
4 1
12
42 .
cos n
i sin n.
for all integers n. 44. Give an example showing that De Moivres Formula does not necessarily hold when n is not an integer. 45. Dene f cos i sin e
i
4!
(This gives an error estimate of about 0.003, whereas the Remainder Theorem shows that the error is at most 0.004.) 36. Bound the error involved in using the Taylor polynomial of degree 5 to approximate sin x near x 1 2 without using the Remainder Theorem. 37. Bound the error involved in using the Taylor polynomial of degree 5 to approximate
1
Compute the derivative of f and use this to give another proof of Eulers Formula.
e
0
x2 2
dx As with complex numbers, we also use the Taylor series for ex to dene eM for matrices square M as I M M2 2! M3 3! ,
without using the Remainder Theorem. 38. Show that the Remainder Theorem cannot give any practical bounds on the error involved in approximating f x ln 1 x at x 1 2 by its Tayx x2 2 x3 3. lor polynomial of degree 3, T4 x
where I denotes the identity matrix (which has 1s along the diagonal and 0s everywhere else). Use
S ECTION 3.3
this to compute eM for the matrices in Exercises 46 49. 1 0 46. M 0 1 47. M 48. M 49. M 1 0 1 0 1 0 1 1 0 1 2 1
TAYLOR S ERIES
129
polynomials to power series (see Exercise 58). The fact he assumed, however, does not hold for arbitrary series, as Exercise 59 shows. It was not until about 150 years later that Karl Weierstrass (18151897) corrected this proof by proving the Weierstrass Factorization (or, Product) Theorem. It should also be noted that Euler gave two other correct proofs for this calculation in the same paper, and a fourth proof in 1741, but his incorrect proof is the one that is best remembered. As the American author Henry Mencken (18801956) wrote, For every problem, there is one solution which is simple, neat, and wrong. 55. Find a series centered at 0 which is equal to
ab Suppose that e were a rational number, so e for positive integers a and b. In Exercises 5052 we will draw a contradiction, thereby proving that e is irrational. This proof is often attributed to Charles Hermite (18221901). 50. Dene n
f x for x 0.
sin x
an
n! e
k
1 k ! 0
, b. 2 .
56. Find all the roots of the power series from Exercise 55. This should involve two steps; rst show that this series has no negative roots, and then nd all the positive roots, which are (by the previous problem) also roots of f x sin x x .
1, and therefore an can not 52. Show that 0 an be an integer, contradicting our assumption that e is rational.
57. If a polynomial of degree 3 has roots r1 , r2 , and c x r1 x r2 x r3 r3 , then it is given by p x for some constant c. By expanding this product, verify that 1 r1 1 r2 1 r3 coefcient of x . constant term
Is there an irrational number which raised to an irrational power is rational? Exercise 54 proves that there is, although it doesnt tell us precisely what it is. I thank Professor Steven Landsburg for making me aware of these problems. 53. Verify that 2 2. (One method is to take the logarithm of both sides.) 54. Using the result of the previous exercise and the fact that 2 is irrational, prove that there is an irrational number which raised to an irrational number is rational.
2
2
(This generalizes to polynomials of any degree.) 58. Assume, as Euler did, that Exercise 57 holds for series to show that 1 r1 1 r2 1 r3 1 6
where r1 , r2 , r3 , . . . are the roots from Exercise 56. 2 1 . Conclude that 2 n 6 n 1 59. The function f x 2 1 1 x has a sin1 2. Derive its power series (centered gle root, x at x 0) and conclude that, contrary to Eulers assumption, Exercise 57 cannot be applied to arbitrary series.
Exercises 5559 present Eulers original computation of 1 n2 , from 1735. While this proof was considered a breakthrough at the time, Euler mistakenly assumed that he could apply a fact about
130
C HAPTER 3
P OWER S ERIES
2x 2n
n
2n 1
1! 2x 2n ! 2
3 2n
1
n 0
2n 1 2n 1 x n2
2n 1
1! 1
n 0 n 6n 2 n2 x
3. x2
n 0
1 xn n!
x2
n 0
n 6n n2 x
2n !
2n !
5. 2x
n 0
n 0
xn 1 n! x n!
2 n n 0 4
7.
1 2 n 0
xn n!
1 2
n 0
x2n 1 2n 1 !
x x 1 6. , so the limit is 1 3! 5! 7! 2x2 2x4 The series is 2 , so the limit is 2. 3! 5! x2 , so the limit is 1. The series is 1 4 2 41x2 The series is , so the limit is 2 140625. 140625 468750 cos 0
nx 6n 2 n
1 3!
19. e 21.
1
n 1
2n !
n
dx
n 1
1
n
x6n 1 6n 1 2n ! x2n 1 2n 1 n! C
23.
n 0
x2n dx 2n n!
1
n 0
2n