<<

Taylor Week 10

10.1 Definition

Recall the definition of a Taylor Series

Definition Let f have of all orders on some I containing c. Then the Taylor Series of f centered at c is the infinite series

∞ X f (n)(c) (x − c)n n! n=0 (this is sometimes called the Maclaurin series of f if c = 0). We say that the series converges to f if lim Rn(x) = 0 for all x in I. In this case we may say n→∞

∞ X f (n)(c) f(x) = (x − c)n n! n=0 for x in I.

Note: There is a bit of nuance here. For a Taylor series to converge to f(x), we need that the of Taylor pn gives us |f(x) − pn(x)| → 0. This is different than saying that the Taylor series converges as a . It is possible to have a Taylor series converge as a power series and to not match in value the series which gave rise to it. See Problem 7 HERE.

Examples

∞ X xn (a) ex = for all x. n! n=0 We have already seen that the Taylor Series is given by the above and that as a power series it converges for all x. It is just a matter of showing that that it converges to the ex. Recall that we must show (n+1) f (γ) n+1 lim Rn(x) = lim (x − c) = 0. n→∞ n→∞ (n + 1)!

It may be useful to use that if |f (n+1)(γ)| ≤ M for all x in I, then

M |R (x)| ≤ |x − c|n+1 n (n + 1)!

Since f (n+1)(x) = ex for all x,

γ e n+1 lim Rn(x) = lim x n→∞ n→∞ (n + 1)!

an For any fixed number a, lim = 0. Therefore n→∞ n!

lim Rn(x) = 0 for all x n→∞

Therefore the equality between the function and power series is valid for all x.

∞ X x2n+1 (b) sin x = (−1)n for all x. (2n + 1)! n=0 f(0) = 0

1 Taylor Series Week 10

f 0(x) = cos x =⇒ f 0(0) = 1 f 00(x) = − sin x =⇒ f 00(0) = 0 f 000(x) = − cos x =⇒ f 000(0) = −1 f 0000(x) = sin x =⇒ f 0000(0) = 0 and so the pattern will repeat.

What we have then is this. The even powered derivatives are all zero. Therefore only odd powers of x will appear in the expansion. The odd powers of x will alternate in sign. Hence the Taylor series is

∞ X x2n+1 (−1)n (2n + 1)! n=0

which converges for all x by the . To show that it converges to sin x, recall that | sin x| ≤ 1 and | cos x| ≤ 1 so

1 n+1 0 ≤ lim |Rn(x)| ≤ lim x = 0 n→∞ n→∞ (n + 1)!

=⇒ lim |Rn(x)| = 0 =⇒ lim Rn(x) = 0 n→∞ n→∞

∞ X x2n (c) cos x (−1)n for all x. (2n)! n=0 " ∞ # ∞ ∞ d d X x2n+1 X d  x2n+1  X x2n cos x = [sin x] = (−1)n = (−1)n = (−1)n dx dx (2n + 1)! dx (2n + 1)! (2n)! n=0 n=0 n=0

∞ 1 X (d) = (1 − x)−1 = xn for −1 < x < 1. 1 − x n=0 Looking at derivatives here,

1 f 0(x) = (−1)(1 − x)−2(−1) = (1 − x)−2 = =⇒ f 0(0) = 1 (1 − x)2 2 f 00(x) = (−2)(1 − x)−3(−1) = 2(1 − x)−3 = =⇒ f 00(0) = 2 (1 − x)3 3 · 2 f 000(x) = (−3)2(1 − x)−4(−1) = 3 · 2(1 − x)−4 = =⇒ f 000(0) = 3 · 2 (1 − x)4 ↓ n! f (n)(x) = (−n)(n − 1)!(1 − x)−n−1(−1) = n!(1 − x)−n−1 = =⇒ f (n)(0) = n! (1 − x)n+1

Therefore the Taylor Series is ∞ ∞ X n! X xn = xn n! n=0 n=0 1 which converges for −1 < x < 1. We need show that it converges to the function . This is actually 1 − x difficult to do here with the form of the remainder which we have. In fact, in general this process can be difficult. We will usually just take for granted the the Taylor series converges to the correct function. However, you should be aware that this is an assumption.

2 Taylor Series Week 10

10.2 Euler’s Formula

Around 1740 Euler discovered the identity

eiθ = cos θ + i sin θ √ where i = −1 and θ is any .

We can prove this fact if you believe that the Taylor series formulas hold for imaginary numbers.

0 i = 1  1 0 if 4 divides n i = i  i if n divided by 4 has remainder 1 i2 = −1 =⇒ in = 3 −1 if n divided by 4 has remainder 2 i = −i  −i if n divided by 4 has remainder 3 i4 = 1

Therefore

∞ ∞ ∞ X iθ)n X θ2n X θ2n+1 eiθ = = (−1)n + i (−1)n = cos θ + i sin θ n! (2n)! (2n + 1)! n=0 n=0 n=0 In particular then,

eiπ = cos π + i sin π = −1 + 0 = −1 =⇒ eiπ + 1 = 0 This is Euler’s Identity (though a lot of other things can also bear that name). It is sometimes called the most beautiful formula in mathematics.

10.3 Leibniz Formula

Say you wanted to approximate the value of π. How could you do it? A bunch of ways of course. One would be to think of a function which outputs π as a value, expand it in a Taylor series, and and calculate finitely π many terms to approximate it. What function outputs π? Well arctan(1) = 4 . We have derived that ∞ X x2n+1 x3 x5 x7 arctan x = (−1)n = x − + − + ... |x| < 1 2n + 1 3 5 7 n=0 So now plug in x = 1 to give

∞ π X 1 1 1 1 = arctan 1 = (−1)n = 1 − + − + ... 4 2n + 1 3 5 7 n=0 This is known as Leibniz’s Formula. Multiplying both sides by 4 gives an estimate for π. If we take 4 terms for example,

 1 1 1 π = 4 1 − + − ≈ 2.8592 3 5 7 You’ll notice that this isn’t particularly close. That is because the series converges very slowly so this isn’t a practical method for finding π. If we take 100 terms the is 3.13159290356 which isn’t even right in the hundredths place. However, in theory at least it works.

3 Taylor Series Week 10

10.4 Calculating .

Taylor series can be used to find / approximate the value of certain integrals which cannot be computed using the method you are familiar with since they do not have anti-derivatives which can be written in terms of elementary functions.

R 1 x2 (a) 0 e dx

We cannot compute the of this function. Instead, we will replace the function by its power series.

∞ X xn ex = x ∈ (−∞, ∞) n! n=0 ∞ 2 n ∞ 2n 2 X (x ) X x =⇒ ex = = x ∈ (−∞, ∞) n! n! n=0 n=0 Therefore, Z 1 Z 1 ∞ 2n ∞ Z 1 2n ∞ 2n+1 1 2 X x X x X x ex dx = dx = dx = n! n! (2n + 1) · n! 0 0 0 n=0 n=0 0 n=0 This power series we’re getting in some sense is the antiderivative of the function. We have no other way of expressing it other than as the power series so it is of limited usefulness. To get a value for the , we now just plug in the x-values and subtract. Again, since the sum is infinite that is also not super helpful. Instead we restrict to some finite number of terms to get an approximation. If we want a better approximation we can just take more terms.

1 3 5 7 Z 2 x x x 1 1 1 1 x e dx ≈ x + + + = 1 + + + ≈ 1.457 0 3 · 1! 5 · 2! 7 · 3! 0 3 · 1! 5 · 2! 7 · 3! For reference the true value is about 1.46265. We can also integrate our error term at this point so get an idea of how accurate this estimate is. That won’t be included here, but this approximation is rather useless if we don’t know if the approximation is good for our application. Integrals of this type are called Gaussian Integrals. They are fundamental in probability and statistical/quantum mechanics. sin x (b) R 1 dx 0 x

Once again this function has no elementary integral. We use the Taylor series.

∞ X x2n+1 sin x = (−1)n x ∈ (−∞, ∞) (2n + 1)! n=0 ∞ sin x X x2n =⇒ = (−1)n x ∈ (−∞, ∞) x (2n + 1)! n=0 So,

∞ ∞ ∞ Z 1 sin x Z 1 X x2n X Z 1 x2n X x2n+1 1 dx = (−1)n dx = (−1)n dx = (−1)n x (2n + 1)! (2n + 1)! (2n + 1) · (2n + 1)! 0 0 0 n=0 n=0 0 n=0

To approximate this take a few terms,

4 Taylor Series Week 10

Z 1 sin x x3 x5 1 1 1

dx ≈ x − + = 1 − + ≈ 0.94611 0 x 3 · 3! 5 · 5! 0 3 · 3! 5 · 5! which compares favorable to the true value of approximately 0.94608.

R 1 2 (c) 0 sin x dx

Plug x2 into the Taylor series of sin x to get

∞ X x4n+2 sin x2 = (−1)n x ∈ (−∞, ∞) (2n + 1)! n=0 and therefore that

∞ ∞ Z 1 X Z 1 x4n+2 X x4n+3 1 sin x2 dx = (−1)n = (−1)n (2n + 1)! (4n + 3) · (2n + 1)! 0 0 n=0 0 n=0

If we take the first five terms our error is less that 10−6,

Z 1 1 1 1 1 1 sin x2 dx ≈ − + − + ≈ 0.310268303 0 3 42 1320 75600 6894720 Integrals of this sort are common in optics and called Fresnel integrals. I’ve heard that they also have something to do with the way to make a car turn a corner quickly, but I know nothing about that.

10.5 Evaluating Limits

Taylor series can also be useful in evaluating limits as x → 0, both to allow us to find limits which may have otherwise been difficult or inaccessible and also to speak meaningfully about the rate of convergence. We show some examples of the former.

sin x (a) lim x→0 x

We already know this limit. But let’s do it via Taylor series anyway.

∞ X x2n+1 (−1)n (2n + 1)! ∞ n 2n 2 4 6 sin x n=0 X (−1) x x x x lim = lim = lim = lim 1 − + + − ... = 1 x→0 x x→0 x x→0 (2n + 1)! x→0 3! 5! 7! n=0 There’s some circular reasoning involved in this approach so we haven’t proven anything though. x2ex (b) lim x→0 cos x − 1

2 3 2 x x  4 5 2 x x 1 + x + + + ... 2 3 x x x e 2! 3! x + x + 2! + 3! + ... lim = lim   = lim 2 4 6 x→0 cos x − 1 x→0 x2 x4 x6 x→0 − x + x − x − ... 1 − 2! + 4! − 6! − ... − 1 2! 4! 6!

Factor out x2 from top and bottom to give

5 Taylor Series Week 10

2 1 + x + x + x3 + ... 1 = lim 2! 3! = = −2 x→0 1 x2 x4 − 1 − 2! + 4! − 6! − ... 2 −1 + cos x + 1 x sin x (c) lim 2 x→0 −1 + cosh x2

Replace the trig functions by their Taylor series,

 2 4 6   3 5 7  1 x x x 1 x x x −1 + cos x − x sin x −1 + 1 − 2! + 4! − 6! + ... + 2 x x − 3! + 5! − 7! + ... 2 = −1 + cosh x2 x4 x8  −1 + 1 + 2! + 4! + ... x2 x4 x6  x2 x4 x6 x8  − 2! + 4! − 6! + ... + 2 − 2·3! + 2·5! − 2·7! + ... = x4 x8 2! + 4! + ...

6 2 ( 1 − 1 )x4 − ( 1 − 1 ) x + ... ( 1 − 1 ) − ( 1 − 1 ) x + ... = 4! 2·3! 6! 2·5! 6! = 4! 2·3! 6! 2·5! 6! 4 1 x4  1 x4  x 2! + 4! + ... 2! + 4! + ... Taking the limit now as x → ∞ gives us 1 1 4! − 2·3! 1 1 = − 2! 12 10.6 Determining the Sum of an Infinite Series

Up until now we’ve only been able to find the exact sums of which either telescope or are geometric. For any other series we could only determine an approximate value. With Taylor series at our disposal though, the sums of some series will be accessible to us. The rough idea is to evaluate both sides P n of a Taylor series expression f(x) = an(x − c) at some x value. The right hand side will be an infinite series and the left hand side will be the value to which the series converges.

Examples For each of the convergent series below determine the exact sum.

∞ X 1 1 1 1 (a) = 1 + + + + ... n! 2 6 24 1 To start we want a function whose Taylor series looks something like the series above. Recall that ∞ X xn x2 x3 x4 ex = = 1 + x + + + + ... n! 2 6 4 n=0

This is similar to our series if we plug in x = 1 to get rid of the x0s.

∞ X 1n 1 1 1 =⇒ e = = 1 + 1 + + + + ... n! 2 6 4 n=0 The difference is that there is an extra term of 1 on the right hand side. So subtract it away.

∞ X 1n 1 1 1 =⇒ e − 1 = −1 + = 1 + + + + ... n! 2 6 4 n=0 Therefore the sum of the series is e − 1 .

6 Taylor Series Week 10

∞ X 1 1 1 1 (b) (−1)n = −1 + − + − ... n 2 3 4 1 Recall that ∞ X xn x2 x3 x4 ln(x + 1) = (−1)n+1 = x − + − + ... n 2 3 4 n=1 So we’ll almost get our series on the right hand side if we plug in x = 1.The signs will be wrong though so we should also multiply by −1.

∞ X 1 1 1 1 − ln(2) = (−1)n = −1 + − + − ... n 2 3 4 n=1

This gives us that the sum is − ln 2 .

∞ X n 1 2 3 (c) = + + + ... 7n 7 49 343 n=1 This one is more difficult than the previous. What you may want to notice is that the series is n times 1 1 a with r = 7 . Now geometric series are generated by the function 1−x so we should begin there.

∞ 1 X = xn = 1 + x + x2 + x3 + ... 1 − x n=0 How to get that that multiplication by n though? We can’t just multiply by n because it is not a fixed number. However, we can take the !

∞ 1 X = nxn−1 = 1 + 2x + 3x2 + ... (1 − x)2 n=0

1 If we plug in x = 7 we almost have the series but the n values do not match. To do so we need to bump the exponent of x up by 1. To do so multiply by x.

∞ x X = nxn = x + 2x2 + 3x3 + ... (1 − x)2 n=0

1 To get the value of our sum we now just need to evaluate at x = 7 ,

1 1 49 7 7 = · = 1 2 (1 − 7 ) 7 36 36

∞ X n + 1 3 4 5 (d) = 1 + 2 + + + + ... n! 2 6 24 n=0 The in the denominator is suggestive of the series for ex.

∞ X xn x2 x3 ex = = 1 + x + + + ... n! 2 3 n=0

7 Taylor Series Week 10

There’s no x-value to plug in to give us the n+1 in the numerator so that needs to come from somewhere else. Again, we can’t just multiply by n + 1. We can take a derivative but that will give us n instead of n + 1. The solution is to multiply by x first, then take the derivative.

∞ X xn+1 x3 x4 xex = = x + x2 + + + ... n! 2 3 n=0

" ∞ # ∞ d d X xn+1 X (n + 1)xn 3x2 4x3 (1 + x)ex = [xex] = = = 1 + 2x + + + ... dx dx n! n! 2 3 n=0 n=0

Once we set x = 1 we will have our desired series. Therefore the value of the series is 2e .

8 Taylor Series Week 10

10.7 The

Fix some constant m. If we expand the function f(x) = (1 + x)m in a Taylor series centered at 0 we get the series,

m(m − 1) m(m − 1)(m − 2) m(m − 1)(m − 2)(m − 3) (1 + x)m = 1 + mx + x2 + x3 + x4 + ... 2! 3! 4! ∞ X m = 1 + xn (|x| < 1) n n=1

m where n is the binomial coefficient and is defined by m m(m − 1)(m − 2) ... (m − n + 1) = . n n!

The ratio test verifies that is indeed 1. Expressions akin to (1 + x)m pop up in physics a lot and we can truncate the Taylor series to obtain valid for small |x|.

1 Example Expand (1 + x) 2 using the binomial series.

−1 −3 −1 −3 −5 −1 −3 −5 −7 − 1 1 2 2 2 2 2 2 3 2 2 2 2 4 (1 + x) 2 = 1 + − x + x + x + x + ... 2 2! 3! 4! x 3x2 5x3 35x4 = 1 − + − + + ... 2 8 16 128 In the theory of special relativity, the Lorentz factor γ describes the factor by which time and length are stretched for moving objects. It is defined by 1 γ = q v2 1 − c2

where v is the velocity of the object and c is the speed of light in a vacuum. Generally objects are traveling 2 2 v v significantly slower than light so is small and we can generally approximate by plugging in x = − c2 c2 and taking the first two terms

1 1 v2 ≈ 1 + 2 q v2 2 c 1 − c2

9 Taylor Series Week 10

Common Taylor Series

Function Taylor Series c = 0 Interval of Convergence

∞ 1 X xn (−1, 1) 1 − x n=0

∞ X xn ex (−∞, ∞) n! n=0

∞ X x2n+1 sin x (−1)n (−∞, ∞) (2n + 1)! n=0

∞ X x2n cos x (−1)n (−∞, ∞) (2n)! n=0

↑ Memorize all of these ↑

↓ No need to memorize these ↓

∞ X xn ln(1 + x) (−1)n+1 (−1, 1] n n=1

∞ X x2n+1 arctan x (−1)n [−1, 1] 2n + 1 n=0

∞ X x2n+1 sinh x (−∞, ∞) (2n + 1)! n=0

∞ X x2n cosh x (−∞, ∞) (2n)! n=0

∞ X k(k − 1)(k − 2) ... (k − n + 1) (1 + x)k xn (−1, 1) n! n=0

10