taylor and maclaurin seriestaylor/math10560/lecturematerial/...if a= 0 the series in question is the...

29
Taylor and MacLaurin Series November 18, 2019 1 / 29

Upload: others

Post on 20-Jan-2020

23 views

Category:

Documents


4 download

TRANSCRIPT

Page 1: Taylor and MacLaurin Seriestaylor/Math10560/LectureMaterial/...If a= 0 the series in question is the MacLaurin series of f. I Example This result is saying that if f(x) = ex has a

Taylor and MacLaurin SeriesNovember 18, 2019

1 / 29

Page 2: Taylor and MacLaurin Seriestaylor/Math10560/LectureMaterial/...If a= 0 the series in question is the MacLaurin series of f. I Example This result is saying that if f(x) = ex has a

So Far

We saw previously that some functions are equal to a power series onthe interval of convergence of the power series. For example

1

1− x=

∞∑n=0

xn = 1 + x+ x2 + x3 + · · · =

∞∑n=0

xn for x ∈ (−1, 1)

ln(1 + x) =

∞∑n=0

(−1)nxn+1

n+ 1= x− x2

2+x3

3− x4

4+ · · · for x ∈ (−1, 1]

arctan(x) =

∞∑n=0

(−1)nx2n+1

2n+ 1= x− x

3

3+x5

5− x

7

7−· · · for x ∈ (−1, 1]

ex =

∞∑n=0

xn

n!= 1 + x+

x2

2!+x3

3!· · · for x ∈ (−∞,∞)

In this section, we will develop a method to find power seriesexpansions/representations for a wider range of functions and devise amethod to identify the values of x for which the function equals thepower series expansion.

2 / 29

Page 3: Taylor and MacLaurin Seriestaylor/Math10560/LectureMaterial/...If a= 0 the series in question is the MacLaurin series of f. I Example This result is saying that if f(x) = ex has a

Definition

We say that f(x) has a power series expansion at a if

f(x) =

∞∑n=0

cn(x− a)n for all x such that |x− a| < R

for some R > 0. Of course we would like to find the largest R thatwill work.

Note f(x) has a power series expansion at 0 if

f(x) =

∞∑n=0

cnxn for all x such that |x| < R

for some R > 0.

Example We see that f(x) =1

1− x, g(x) = ln(1 + x),

h(x) = arctan(x) and exp(x) = ex all have powers series expansions at0.

3 / 29

Page 4: Taylor and MacLaurin Seriestaylor/Math10560/LectureMaterial/...If a= 0 the series in question is the MacLaurin series of f. I Example This result is saying that if f(x) = ex has a

Questions

Sometimes a function has a power series expansion at a point a andsometimes it does not. One of the benefits of the existence of such anexpansion is that we can approximate values of the function with apolynomial. Another is that we can actually find the sum of someseries.Our main questions are

I Q1. If a function f(x) has a power series expansion at a, can wetell what that power series expansion is?

I Q2. For which values of x do the values of f(x) and the sum ofthe power series expansion coincide?

I We will see that in answer to question 1, we can give a preciseformula for the power series.

I We will examine the error in estimation by partial sums toanswer question 2.

4 / 29

Page 5: Taylor and MacLaurin Seriestaylor/Math10560/LectureMaterial/...If a= 0 the series in question is the MacLaurin series of f. I Example This result is saying that if f(x) = ex has a

Taylor and MacLaurin Series

Definition If f(x) is a function with infinitely many derivatives at a,the Taylor Series of the function f(x) at/about a is the power series

Tf,a(x) =

∞∑n=0

f (n)(a)

n!(x− a)n

= f(a) +f ′(a)

1!(x− a) +

f (2)(a)

2!(x− a)2 +

f (3)(a)

3!(x− a)3 + · · ·

If a = 0 this series is called the MacLaurin Series of the functionf :

∞∑n=0

f (n)(0)

n!xn = f(0) +

f ′(0)

1!x+

f (2)(0)

2!x2 +

f (3)(0)

3!x3 + · · ·

These series are always defined if f is infinitely differentiable at a.The big question is what is the relation of the value of the series at xto the value of the function at x.

5 / 29

Page 6: Taylor and MacLaurin Seriestaylor/Math10560/LectureMaterial/...If a= 0 the series in question is the MacLaurin series of f. I Example This result is saying that if f(x) = ex has a

Matching derivatives

The Taylor series of f at a is given by

Tf,a(x) =

∞∑n=0

f (n)(a)

n!(x− a)n

I If Tf,a(x) is defined in an open interval around a, then Tf,a(x) isinfinitely differentiable at a, since it is a power series.

I T(k)f,a (x) =

∞∑n=k

n(n− 1) · · ·(n− (k − 1)

)f (n)(a)

n!(x− a)n−k

I T(k)f,a (x) =

∞∑n=k

f (n)(a)

(n− k)!(x− a)n−k

I In particular T(k)f,a (a) = f (k)(a) for all integers k > 0.

I It follows that the Taylor series centered at a of a Taylor seriescentered at a equals the original series.

6 / 29

Page 7: Taylor and MacLaurin Seriestaylor/Math10560/LectureMaterial/...If a= 0 the series in question is the MacLaurin series of f. I Example This result is saying that if f(x) = ex has a

Example (MacLaurin Series.)

Find the MacLaurin Series of the function f(x) = ex.Find the radius of convergence of this series.

I We need to calculate the derivatives and evaluate them at 0.

I f(x) = ex, f ′(x) = ex, f ′′(x) = ex, . . . , f (n)(x) = ex.

I f (n)(0) = e0 = 1.

I The MacLaurin series for f(x) = ex is given by∞∑

n=0

f (n)(0)

n!xn =

∞∑n=0

1

n!xn

I Recall that in a previous lecture we showed that this seriesconverges for all values of x and converged to ex.

I Because this series converges for all values of x, we have thefollowing important limit:

limn→∞

xn

n!= 0 for all values of x.

7 / 29

Page 8: Taylor and MacLaurin Seriestaylor/Math10560/LectureMaterial/...If a= 0 the series in question is the MacLaurin series of f. I Example This result is saying that if f(x) = ex has a

Example (MacLaurin Series)

Find the MacLaurin Series of the function f(x) = sinx.Find the radius of convergence of this series.

I We need to calculate the derivatives and evaluate them at 0.I f (0)(x) = sinx, f (1)(x) = cosx,f (2)(x) = − sinx, f (3)(x) = − cosx,f4(x) = sinx , and now it repeats.

I f (n)(0) =

{0 n even

(−1)k n = 2k + 1 odd

I When we plug in the values for f (n)(0) from above, we get thatthe MacLaurin series for f(x) = sinx is given by

0 +x

1!+ 0 +

(−1)x3

3!+ 0 +

x5

5!+ 0 +

(−1)x7

7!· · ·

I which we can write with summation notation skipping the 0’s as

∞∑n=0

(−1)nx2n+1

(2n+ 1)!

I The ratio test shows the interval of convergence is (−∞,∞).8 / 29

Page 9: Taylor and MacLaurin Seriestaylor/Math10560/LectureMaterial/...If a= 0 the series in question is the MacLaurin series of f. I Example This result is saying that if f(x) = ex has a

Example (Taylor series expansion of ex at 1)

Find the Taylor series expansion of the function f(x) = ex at a = 1.Find the radius of convergence of this series.

I We calculate the derivatives of f(x) and evaluate them at 1.

I f (n)(x) = ex and so f (n)(1) = e1 = e.

I The Taylor series for f(x) = ex at a = 1 is given by∞∑

n=0

f (n)(1)

n!(x− 1)n =

∞∑n=0

e

n!(x− 1)n

I To check the radius of convergence of this series, we use the ratio

test, limn→∞

∣∣∣∣∣an+1

an

∣∣∣∣∣ = limn→∞

|x− 1|n+1/(n+ 1)!

|x− 1|n/(n)!= lim

n→∞

|x− 1|(n+ 1)

= 0

for all values of x so the radius of convergence is ∞ and theinterval of convergence is (−∞,∞).

9 / 29

Page 10: Taylor and MacLaurin Seriestaylor/Math10560/LectureMaterial/...If a= 0 the series in question is the MacLaurin series of f. I Example This result is saying that if f(x) = ex has a

Answer to Q1

Theorem If f has a power series expansion at a, that is if

f(x) =

∞∑n=0

cn(x− a)n for all x such that |x− a| < R

for some R > 0, then that power series is the Taylor series of f at a.There is no choice for the coefficients, we must have

cn =f (n)(a)

n!and f(x) =

∞∑n=0

f (n)(a)

n!(x− a)n

for all x such that |x− a| < R.

If a = 0 the series in question is the MacLaurin series of f .

I Example This result is saying that if f(x) = ex has a powerseries expansion at 0, then that power series expansion must bethe MacLaurin series of ex which is

1 + x+x2

2!+x3

3!+ · · ·

10 / 29

Page 11: Taylor and MacLaurin Seriestaylor/Math10560/LectureMaterial/...If a= 0 the series in question is the MacLaurin series of f. I Example This result is saying that if f(x) = ex has a

However the result is not saying that ex =

∞∑n=0

xn

n!sums to this

series. To prove that we need to use Taylor’s theorem below or someother argument (like uniqueness of solutions to differential equationswhich we used previously for ex).

11 / 29

Page 12: Taylor and MacLaurin Seriestaylor/Math10560/LectureMaterial/...If a= 0 the series in question is the MacLaurin series of f. I Example This result is saying that if f(x) = ex has a

Answer to question 1

I Example The result also says that IF f(x) = ex has a powerseries expansion at 1, then that power series expansion must be

e+ e(x− 1) +e(x− 1)2

2!+e(x− 1)3

3!+ · · · =

∞∑n=0

e(x− 1)n

n!

However, we must use Taylor’s theorem on the remainder to showthat this series sums to f(x) = ex for all values of x.

I Example Also we have that IF sinx has a power seriesexpansion at 0, then that power series expansion must be∞∑

n=0

(−1)nx2n+1

(2n+ 1)!= x− x3

3!+x5

5!− x7

7!+ . . . .

12 / 29

Page 13: Taylor and MacLaurin Seriestaylor/Math10560/LectureMaterial/...If a= 0 the series in question is the MacLaurin series of f. I Example This result is saying that if f(x) = ex has a

Q2: When does f(x) =∞∑n=0

f (n)(a)

n!(x− a)n ?

Our second question now becomes:For which values of x does the Taylor series of f at a converge tof(x)?

There is an issue here. Recall h(x) =

{e−

1x2 x > 0

0 x 6 0.

We claimed that h is infinitely differentiable and that h(n)(0) = 0 forall n. Hence the MacLaurin series for h is the power series z(x) = 0.Clearly h(x) = z(x) for x 6 0 and h(x) 6= z(x) for x > 0.

13 / 29

Page 14: Taylor and MacLaurin Seriestaylor/Math10560/LectureMaterial/...If a= 0 the series in question is the MacLaurin series of f. I Example This result is saying that if f(x) = ex has a

Q2: When does f(x) =∞∑n=0

f (n)(a)

n!(x− a)n ?

For any value of x, the Taylor series of the function f(x) about x = aconverges to f(x) when the partial sums of the series (Tn(x) below)converge to f(x) . We let

Rn(x) = f(x)− Tn(x) ,

where

Tn(x) = f(a) +f ′(a)

1!(x− a) +

f (2)(a)

2!(x− a)2 + · · ·+ f (n)(a)

n!(x− a)n.

Tn(x) given above is called the nth Taylor polynomial of f at aand Rn(x) is called the remainder of the Taylor series.

14 / 29

Page 15: Taylor and MacLaurin Seriestaylor/Math10560/LectureMaterial/...If a= 0 the series in question is the MacLaurin series of f. I Example This result is saying that if f(x) = ex has a

Theorem

Let f(x), Tn(x) and Rn(x) be as above. If

limn→∞

Rn(x) = 0 for |x− a| < R,

then f is equal to the sum of its Taylor series on the interval|x− a| < R.

To use this theorem we need some control over Rn(x).

Theorem Rn(x) =f (n+1)(ξ)

(n+ 1)!(x− a)n+1 for some number ξ between

x and a.

15 / 29

Page 16: Taylor and MacLaurin Seriestaylor/Math10560/LectureMaterial/...If a= 0 the series in question is the MacLaurin series of f. I Example This result is saying that if f(x) = ex has a

Taylor’s Theorem on the remainder

The following theorem is crucial in calculating limn→∞

Rn(x) on an

interval around a:

Taylor’s Inequality If |f (n+1)(x)| 6Mn+1 for |x− a| 6 d then theremainder Rn(x) of the Taylor Series satisfies the inequality

|Rn(x)| 6 Mn+1

(n+ 1)!|x− a|n+1 for |x− a| 6 d.

I Example: Taylor’s Inequality applied to sinx. Iff(x) = sinx, then for any n, f (n+1)(x) is either ± sinx or ± cosx.In either case |f (n+1)(x)| 6 1 for all values of x. Therefore, withMn+1 = 1 and a = 0 and d any number, Taylor’s inequality tells

us that |Rn(x)| 6 1

(n+ 1)!|x|n+1 for |x| 6 d (=∞ here).

I Example: Taylor’s Inequality applied to ex. If h(x) = ex,then for any value of n, h(n+1)(x) = ex. Now if d is any number,I know that |h(n+1)(x)| = |ex| < ed for all x with |x| < d. Henceapplying Taylor’s inequality to the MacLaurin series for ex (with

a = 0) we get that |Rn(x)| 6 ed

(n+ 1)!|x|n+1 for |x| 6 d.

16 / 29

Page 17: Taylor and MacLaurin Seriestaylor/Math10560/LectureMaterial/...If a= 0 the series in question is the MacLaurin series of f. I Example This result is saying that if f(x) = ex has a

Answers to Question 2

Example Prove that sinx is equal to the sum of its MacLaurinseries for all x, that is, show that

sinx =

∞∑n=0

(−1)nx2n+1

(2n+ 1)!= x− x3

3!+x5

5!− x7

7!+ · · ·

for all x.I I need to show that for any value of x, the remainderRn(x) = sin(x)− Tn(x) has the property that lim

n→∞|Rn(x)| = 0.

I When we apply Taylor’s theorem to the remainder (as shown

above), we get |f (n+1)(x)| 6 1 and |Rn(x)| 6 |x|n+1

(n+ 1)!for all x.

I Therefore 0 6 limn→∞

|Rn(x)| 6 limn→∞

|x|n+1

(n+ 1)!= 0 for all x.

I Therefore

sinx =

∞∑n=0

(−1)nx2n+1

(2n+ 1)!= x− x3

3!+x5

5!− x7

7!+ · · ·

for all x.17 / 29

Page 18: Taylor and MacLaurin Seriestaylor/Math10560/LectureMaterial/...If a= 0 the series in question is the MacLaurin series of f. I Example This result is saying that if f(x) = ex has a

To use this technique you basically need to do the following. First youare going to have to be able to compute the higher derivatives for f ,at least at a.

Then, as a practical matter for every x in the interval you are goingto need to find numbers M and n0 such that

∣∣f (n)(x)| 6M for all

integers n > n0 and all x in the interval. Then limn→∞

M |x− a|n

n!= 0 so

f(x) =

∞∑n=0

f (n)(a)

n!(x− a)n.

Realistically finding closed formulas for all the higher derivatives of fis only possible for certain f . Workable examples are ex, sin(x),cos(x) and polynomials.

Doubters might like to try f(x) = eex

. We will work out (1 + x)k a bitlater in this lecture.

18 / 29

Page 19: Taylor and MacLaurin Seriestaylor/Math10560/LectureMaterial/...If a= 0 the series in question is the MacLaurin series of f. I Example This result is saying that if f(x) = ex has a

Power series expansion of cosx

Example Find a power series representation for cosx. We could findthe MacLaurin series for cos(x) by the same method we used for

sin(x) but it is easier to used sin(x)

dx= cos(x).

I We have sinx =

∞∑n=0

(−1)nx2n+1

(2n+ 1)!

I

cosx =d sin(x)

dx=

∞∑n=0

(−1)n(2n+ 1)x2n

(2n+ 1)!

I Therefore

cosx =

∞∑n=0

(−1)nx2n

(2n)!

To be sure you start your Taylor series correctly for derivatives andintegrals you can write out the first few terms of the original series,differentiate or integrate the resulting polynomial and see where youshould start.

19 / 29

Page 20: Taylor and MacLaurin Seriestaylor/Math10560/LectureMaterial/...If a= 0 the series in question is the MacLaurin series of f. I Example This result is saying that if f(x) = ex has a

Apps (Summing series)

We have

ex =

∞∑n=0

xn

n!= 1 + x+

x2

2!+x3

3!+x4

4!+ · · ·

for all x.

I Therefore

e =

∞∑n=0

1

n!= 1 + 1 +

1

2!+

1

3!+

1

4!+ · · ·

I and

e2 =

∞∑n=0

2n

n!= 1 + 2 +

22

2!+

23

3!+

24

4!+ · · ·

I and1

e=

∞∑n=0

(−1)n

n!= 1− 1 +

1

2!− 1

3!+

1

4!+ · · ·

20 / 29

Page 21: Taylor and MacLaurin Seriestaylor/Math10560/LectureMaterial/...If a= 0 the series in question is the MacLaurin series of f. I Example This result is saying that if f(x) = ex has a

Apps (Finding Limits)

Example use power series to find the limit

limx→0

cos(x5)− 1

x10

(This is a long computation if you use L’Hopital’s rule. You will haveto differentiate cos(x5) ten times.)

I

cos(x5) =

∞∑n=0

(−1)n(x5)2n

2n!=

∞∑n=0

(−1)nx10n

2n!

I and hence we have

cos(x5)− 1 = −x10

2!+x20

4!− x30

6!· · ·

I Thereforecos(x5)− 1

x10= − 1

2!+x10

4!− x20

6!· · ·

I and limx→0

cos(x5)− 1

x10= −1

2since power series (with real x values)

are continuous functions.21 / 29

Page 22: Taylor and MacLaurin Seriestaylor/Math10560/LectureMaterial/...If a= 0 the series in question is the MacLaurin series of f. I Example This result is saying that if f(x) = ex has a

In general, if you have a L’Hopital’s rule problem of form0

0, try

writingf(x)

g(x)=p(x)

q(x)where p(x) and q(x) are Taylor series centered

at a for f and g respectively. Suppose p(x) = p0(x− a)n0 + · · · andq(x) = q0(x− a)m0 + · · · are the initial terms. Then

limx→a

f(x)

g(x)=p0q0

limx→a

(x− a)n0−m0 .

22 / 29

Page 23: Taylor and MacLaurin Seriestaylor/Math10560/LectureMaterial/...If a= 0 the series in question is the MacLaurin series of f. I Example This result is saying that if f(x) = ex has a

The binomial series

The most difficult example we will work out is a MacLaurin series forf(x) = (1 + x)k for real numbers k.f (1)(x) = k(1 + x)k−1; f (2)(x) = k(k − 1)(1 + x)k−2;f (3)(x) = k(k − 1)(k − 2)(1 + x)k−3; . . .

f (n)(x) = k(k − 1) · · ·(k − (n− 1)

)(1 + x)k−n

If k is a positive integer, then f (n)(x) = 0 for n > k.Define (

k

0

)= 1 and

(k

n

)=k(k − 1) · · ·

(k − (n− 1)

)n!

Then the MacLaurin series for (1 + x)k is

∞∑n=0

(k

n

)xn

If k is a positive integer, the binomial series is a polynomial and theresult is the binomial theorem which you may have seen in an algebracourse.

23 / 29

Page 24: Taylor and MacLaurin Seriestaylor/Math10560/LectureMaterial/...If a= 0 the series in question is the MacLaurin series of f. I Example This result is saying that if f(x) = ex has a

The binomial series continued

Assume k is not a positive integer. Then there are two issues:

1. What is the radius of convergence of

∞∑n=0

(k

n

)xn?

2. Does the binomial series converge to (1 + x)k?

By the ratio test

limn→∞

∣∣∣∣∣(

kn+1

)Rn+1(

kn

)Rn

∣∣∣∣∣ = limn→∞

|k···(k−n)|(n+1)!

|k···(k−(n−1))|n!

Rn+1

Rn= lim

n→∞

|k − n|n+ 1

R =

limn→∞

n− kn+ 1

R = R

Hence the radius of convergence is 1.The actual interval of convergence is tricky to work out. The answeris the following:

[−1, 1] if k > 0, (−1, 1] if − 1 < k < 0, (−1, 1) if k 6 −1

Convergence at an endpoint is absolute in the first case.24 / 29

Page 25: Taylor and MacLaurin Seriestaylor/Math10560/LectureMaterial/...If a= 0 the series in question is the MacLaurin series of f. I Example This result is saying that if f(x) = ex has a

To prove the series converges to (1 + x)k consider the differentialequation

(1 + x)y′ = ky

This is a linear equation and so by our theory, there is a uniquesolution y with y(0) = 1.

If y =

∞∑n=0

(k

n

)xn,

y′ =

∞∑n=1

n

(k

n

)xn−1 =

∞∑n=1

k

(k − 1

n− 1

)xn−1 = k

∞∑n=0

(k − 1

n

)xn

Check (k − 1

n− 1

)+

(k − 1

n

)=

(k

n

)

25 / 29

Page 26: Taylor and MacLaurin Seriestaylor/Math10560/LectureMaterial/...If a= 0 the series in question is the MacLaurin series of f. I Example This result is saying that if f(x) = ex has a

Then

(1 + x)y′ = k

∞∑n=0

(k − 1

n

)xn + k

∞∑n=0

(k − 1

n

)xn+1 =

k + k

∞∑n=1

(k − 1

n

)xn + k

∞∑n=1

(k − 1

n− 1

)xn =

k + k

∞∑n=1

((k − 1

n

)+

(k − 1

n− 1

))xn = k

∞∑n=0

(k

n

)xn = ky

Also y(0) = 1 so

(1 + x)k =

∞∑n=0

(k

n

)xn at least for x ∈ (−1, 1)

26 / 29

Page 27: Taylor and MacLaurin Seriestaylor/Math10560/LectureMaterial/...If a= 0 the series in question is the MacLaurin series of f. I Example This result is saying that if f(x) = ex has a

Well Known Power Series expansions

27 / 29

Page 28: Taylor and MacLaurin Seriestaylor/Math10560/LectureMaterial/...If a= 0 the series in question is the MacLaurin series of f. I Example This result is saying that if f(x) = ex has a

Products and quotients: product

We can use “polynomial multiplication” and “polynomial longdivision” to work out the first few terms of many other power series.

28 / 29

Page 29: Taylor and MacLaurin Seriestaylor/Math10560/LectureMaterial/...If a= 0 the series in question is the MacLaurin series of f. I Example This result is saying that if f(x) = ex has a

Products and quotients: division

29 / 29