taylor polynomials and series

56
Sections 10.1–3 Taylor Polynomials and Series Math E-16 December 19, 2007 Announcements I Matthew Leingang ([email protected]) at your service I Homework for next time: I 10.1: #2,4,5,7,8,10-13,18,26-28,34 I 10.2: #1,6,16,17,21,22,28,32,40 I 10.3: #8-12,20,22,36

Upload: matthew-leingang

Post on 05-Dec-2014

15.408 views

Category:

Technology


2 download

DESCRIPTION

Taylor polynomials are usually good approximations to a function. Can we get "infinite" precision?

TRANSCRIPT

Page 1: Taylor Polynomials and Series

Sections 10.1–3Taylor Polynomials and Series

Math E-16

December 19, 2007

Announcements

I Matthew Leingang ([email protected]) at yourservice

I Homework for next time:I 10.1: #2,4,5,7,8,10-13,18,26-28,34I 10.2: #1,6,16,17,21,22,28,32,40I 10.3: #8-12,20,22,36

Page 2: Taylor Polynomials and Series

Taylor PolynomialsMotivationDerivationExamples

Taylor SeriesDefinitionPower Series and the Convergence IssueFamous Taylor SeriesNew Taylor Series from Old

Page 3: Taylor Polynomials and Series

Motivation

I What is sin(91◦)?

I What is√

4.001?

Page 4: Taylor Polynomials and Series

How does your calculator work?

Suppose you ask your calculator for sin(31◦).

I Does it construct a right triangle with one angle equal to 31◦,then measure opposite-over-hypotenuse?

I Does it construct a unit circle, measure the arc length equalto 31◦, then use the vertical coordinate?

I No, it uses a polynomial approximation. Deep down,calculators can only add and multiply anyway.

Page 5: Taylor Polynomials and Series

Constant Approximation

If f is continuous at a, then

f (x) ≈ f (a)

when x is “close to” a.

Example

I√

4.001 ≈√

4 = 2

I sin(91◦) ≈ sin(90◦) = 1

But we should be able to do better.

Page 6: Taylor Polynomials and Series

Linear Approximation

How can we approximate a function with a line?

DefinitionLet f be a function and a apoint at which f isdifferentiable. Then the linearapproximation to f at a is

L(x) = f (a) + f ′(a)(x − a)

Page 7: Taylor Polynomials and Series

Linear Approximation

How can we approximate a function with a line?

DefinitionLet f be a function and a apoint at which f isdifferentiable. Then the linearapproximation to f at a is

L(x) = f (a) + f ′(a)(x − a)

Page 8: Taylor Polynomials and Series

Example

Estimate these by linear approximation.

(i)√

4.001

(ii) sin(91◦)

Solution (i)

We use f (x) =√

x, a = 4. Then f ′(4) = 14 , so

L(x) = 2 + 14(x − 4)

This means √4.001 ≈ 2 + 1

4 ·1

1000 = 2.00025

Notice(2.00025)2 = 4.001000063

Page 9: Taylor Polynomials and Series

Example

Estimate these by linear approximation.

(i)√

4.001

(ii) sin(91◦)

Solution (i)

We use f (x) =√

x, a = 4. Then f ′(4) = 14 , so

L(x) = 2 + 14(x − 4)

This means √4.001 ≈ 2 + 1

4 ·1

1000 = 2.00025

Notice(2.00025)2 = 4.001000063

Page 10: Taylor Polynomials and Series

Solution (ii)

We use f (x) = sin x, a = 90◦ = π/2. Then f (a) = 1, f ′(x) = cos x,so f ′(a) = 0. This means

L(x) = 1

so the linear approximation is no better than the constant one.

Page 11: Taylor Polynomials and Series

Quadratic Approximation

How can we approximate a function with a parabola?

We arelooking for a function

Q(x) = c0 + c1(x − a) + c2(x − a)2

with Q(a) = f (a), Q ′(a) = f ′(a), Q ′′(a) = f ′′(a). What arec0, c1, c2 in terms of f ?

I Since Q(a) = c0, we need c0 = f (a).

I SinceQ ′(x) = c1 + 2c2(x − a) =⇒ Q(a) = c1

we need c1 = f ′(a).

I SinceQ ′′(x) = 2c2 = Q(a)

we need c2 = 12 f ′′(a).

Page 12: Taylor Polynomials and Series

Quadratic Approximation

How can we approximate a function with a parabola? We arelooking for a function

Q(x) = c0 + c1(x − a) + c2(x − a)2

with Q(a) = f (a), Q ′(a) = f ′(a), Q ′′(a) = f ′′(a). What arec0, c1, c2 in terms of f ?

I Since Q(a) = c0, we need c0 = f (a).

I SinceQ ′(x) = c1 + 2c2(x − a) =⇒ Q(a) = c1

we need c1 = f ′(a).

I SinceQ ′′(x) = 2c2 = Q(a)

we need c2 = 12 f ′′(a).

Page 13: Taylor Polynomials and Series

Quadratic Approximation

How can we approximate a function with a parabola? We arelooking for a function

Q(x) = c0 + c1(x − a) + c2(x − a)2

with Q(a) = f (a), Q ′(a) = f ′(a), Q ′′(a) = f ′′(a). What arec0, c1, c2 in terms of f ?

I Since Q(a) = c0, we need c0 = f (a).

I SinceQ ′(x) = c1 + 2c2(x − a) =⇒ Q(a) = c1

we need c1 = f ′(a).

I SinceQ ′′(x) = 2c2 = Q(a)

we need c2 = 12 f ′′(a).

Page 14: Taylor Polynomials and Series

DefinitionLet f be a function and a apoint at which f is twicedifferentiable. Then thequadratic approximation tof at a is

Q(x) = f (a)+f ′(a)(x−a)+12 f ′′(a)(x−a)2

Page 15: Taylor Polynomials and Series

Example

Estimate these by quadratic approximation.

I√

4.001

I sin(91◦)

Solution (i)

We use f (x) =√

x, a = 4. Then f ′(4) = 14 and f ′′(4) = − 1

32 , so

Q(x) = 2 + 14(x − 4)− 1

64(x − 4)2

This means

√4.001 ≈ 2 + 1

4 ·1

103 − 164

1106 = 2.000249984

This is the same answer my TI-83 gives for√

4.001.

Page 16: Taylor Polynomials and Series

Example

Estimate these by quadratic approximation.

I√

4.001

I sin(91◦)

Solution (i)

We use f (x) =√

x, a = 4. Then f ′(4) = 14 and f ′′(4) = − 1

32 , so

Q(x) = 2 + 14(x − 4)− 1

64(x − 4)2

This means

√4.001 ≈ 2 + 1

4 ·1

103 − 164

1106 = 2.000249984

This is the same answer my TI-83 gives for√

4.001.

Page 17: Taylor Polynomials and Series

Solution (ii)

We use f (x) = sin x, a = 90◦ = π/2. Then f (a) = 1, f ′(a) = 0,and f ′′(x) = − sin x, so f ′′(a) = −1. This means

Q(x) = 1− 12(x − π)2

sosin(91◦) ≈ 1− 1

2

180

)2 ≈ 0.9998476913

My TI-83 hassin(91◦) = 0.9998476952

which this agrees with up to the ninth place.

Page 18: Taylor Polynomials and Series

In General

How can we approximate a function with a polynomial of degree n?

DefinitionLet f be a function and a a point at which f is n timesdifferentiable. The Taylor Polynomial of degree n for f centeredat a is

Pn(x) = f (a) + f ′(a)(x − a) +f ′′(a)

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

n!(x − a)n

=n∑

k=0

f (k)(a)

k!(x − a)k

(Convention: f (0)(x) = f (x))

Page 19: Taylor Polynomials and Series

In General

How can we approximate a function with a polynomial of degree n?

DefinitionLet f be a function and a a point at which f is n timesdifferentiable. The Taylor Polynomial of degree n for f centeredat a is

Pn(x) = f (a) + f ′(a)(x − a) +f ′′(a)

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

n!(x − a)n

=n∑

k=0

f (k)(a)

k!(x − a)k

(Convention: f (0)(x) = f (x))

Page 20: Taylor Polynomials and Series

Taylor PolynomialsMotivationDerivationExamples

Taylor SeriesDefinitionPower Series and the Convergence IssueFamous Taylor SeriesNew Taylor Series from Old

Page 21: Taylor Polynomials and Series

Take it to the Limit

DefinitionLet f be a function and a a point at which f is infinitelydifferentiable. The Taylor Series of for f centered at a is

T (x) = f (a) + f ′(a)(x − a) +f ′′(a)

2!(x − a)2+

· · ·+ f (n)(a)

n!(x − a)n + . . .

=∞∑

k=0

f (k)(a)

k!(x − a)k

Page 22: Taylor Polynomials and Series

Example

Compute the Taylor Series for f (x) = ln x centered at 1.

Solution

f (x) = ln x f (1) = 0

f ′(x) = x−1 f ′(1) = 1

f ′′(x) = −x−2 f ′′(1) = −1

f ′′′(x) = 2x−3 f ′′′(1) = 2

f (4)(x) = −6x−3 f (4)(1) = −6

. . . . . . . . . . . .

f (k)(x) = (−1)k+1(k − 1)!x−k f (k)(1) = (−1)k+1(k − 1)!

So

T (x) =∞∑

k=1

(−1)k+1(k − 1)!

k!(x − 1)k =

∞∑k=1

(−1)k+1

k(x − 1)k

Page 23: Taylor Polynomials and Series

Example

Compute the Taylor Series for f (x) = ln x centered at 1.

Solution

f (x) = ln x f (1) = 0

f ′(x) = x−1 f ′(1) = 1

f ′′(x) = −x−2 f ′′(1) = −1

f ′′′(x) = 2x−3 f ′′′(1) = 2

f (4)(x) = −6x−3 f (4)(1) = −6

. . . . . . . . . . . .

f (k)(x) = (−1)k+1(k − 1)!x−k f (k)(1) = (−1)k+1(k − 1)!

So

T (x) =∞∑

k=1

(−1)k+1(k − 1)!

k!(x − 1)k =

∞∑k=1

(−1)k+1

k(x − 1)k

Page 24: Taylor Polynomials and Series

Caution

The infinite sum is dangerous!

I Sometimes it gives very good approximations quickly

I Sometimes it gives good approximations slowly

I Sometimes it doesn’t give anything.

To see this, let Pn be the nth degree Taylor Polynomial off (x) = ln x centered at 1. For which x is T (x) = lim

n→∞Pn(x)

meaningful?

Page 25: Taylor Polynomials and Series

n Pn(12) Pn(2) Pn(3)

1 -0.5 1. 2.02 -0.625 0.5 0.03 -0.666667 0.833333 2.666674 -0.682292 0.583333 -1.333335 -0.688542 0.783333 5.066676 -0.691146 0.616667 -5.67 -0.692262 0.759524 12.68578 -0.69275 0.634524 -19.31439 -0.692967 0.745635 37.5746

10 -0.693065 0.645635 -64.8254

Page 26: Taylor Polynomials and Series

n Pn(12) Pn(2) Pn(3)

10 -0.693065 0.645635 -64.825420 -0.693147 0.668771 -34359.730 -0.693147 0.676758 -2.3593×107

40 -0.693147 0.680803 -1.81712×1010

50 -0.693147 0.683247 -1.49113×1013

60 -0.693147 0.684883 -1.27387×1016

70 -0.693147 0.686055 -1.11899×1019

80 -0.693147 0.686936 -1.00322×1022

90 -0.693147 0.687622 -9.13584×1024

100 -0.693147 0.688172 -8.42274×1027

Page 27: Taylor Polynomials and Series

n Pn(12) Pn(2) Pn(3)

100 -0.693147 0.688172 -8.42274×1027

200 -0.693147 0.690653 -5.34752×1057

300 -0.693147 0.691483 -4.52171×1087

400 -0.693147 0.691899 -4.30016×10117

500 -0.693147 0.692148 -4.36161×10147

600 -0.693147 0.692315 -4.60801×10177

700 -0.693147 0.692433 -5.00727×10207

800 -0.693147 0.692523 -5.55436×10237

900 -0.693147 0.692592 -6.25895×10267

1000 -0.693147 0.692647 -7.14101×10297

Page 28: Taylor Polynomials and Series

Observations

I Pn(12) converges to f (1

2) = − ln 2

I Pn(2) converges to f (2) = ln 2, but more slowly

I Pn(3) does not converge at all!

So in examining this process of approximation by polynomials, wehave to be a little bit careful about what numbers we plug in.

Page 29: Taylor Polynomials and Series

Definition (cf. §9.5)

A power series centered at a is a sum of constants times powersof (x − a):

c0 + c1(xa) + c2(x − a)2 + · · ·+ cn(x − a)n + . . .

Page 30: Taylor Polynomials and Series

Theorem

For a given power series∞∑

n=1

cn(x − a)n there are only three

possiblities:

1. There is a number R such that the series converges when|x − a| < R and diverges when |x − a| > R.

2. The series converges for all x (R =∞)

3. The series converges only when x = a (R = 0).

R is called the radius of convergence of the power series.

Page 31: Taylor Polynomials and Series

Why radius?

An open interval is kind of like a one-dimensional circle:

a− R a a + R

convergence on (a− R, a + R)divergence on (−∞, a− R) and (a + R,∞)at the endpoints—???

Page 32: Taylor Polynomials and Series

Why radius?

An open interval is kind of like a one-dimensional circle:

a− R a a + R

convergence on (a− R, a + R)

divergence on (−∞, a− R) and (a + R,∞)at the endpoints—???

Page 33: Taylor Polynomials and Series

Why radius?

An open interval is kind of like a one-dimensional circle:

a− R a a + R

convergence on (a− R, a + R)

divergence on (−∞, a− R) and (a + R,∞)

at the endpoints—???

Page 34: Taylor Polynomials and Series

Why radius?

An open interval is kind of like a one-dimensional circle:

a− R a a + R

convergence on (a− R, a + R)divergence on (−∞, a− R) and (a + R,∞)

at the endpoints—???

Page 35: Taylor Polynomials and Series

Example

Compute the radius of convergence of the power series

f (x) =∞∑

k=0

xk

Solution

This is a geometric series. We know it converges to1

1− xwhen

|x | < 1, and not when x = 1 or x = −1. So

I The radius of convergence is 1

I The interval of convergence is the open interval (−1, 1)

Page 36: Taylor Polynomials and Series

Example

Compute the radius of convergence of the power series

f (x) =∞∑

k=0

xk

Solution

This is a geometric series. We know it converges to1

1− xwhen

|x | < 1, and not when x = 1 or x = −1. So

I The radius of convergence is 1

I The interval of convergence is the open interval (−1, 1)

Page 37: Taylor Polynomials and Series

Famous Taylor Series

Example

Compute Taylor series centered at zero for the following functions:

I ex

I sin x

I cos x

I (1 + x)p

Page 38: Taylor Polynomials and Series

Example

Compute the Taylor series centered at zero for f (x) = ex

Solution

f (x) = ex f (0) = 1

f ′(x) = ex f ′(0) = 1

f ′′(x) = ex f ′′(0) = 1

f ′′′(x) = ex f ′′′(0) = 1

. . . . . . . . . . . .

f (k)(x) = ex f (k)(0) = 1

So

T (x) =∞∑

k=0

xk

k!

Page 39: Taylor Polynomials and Series

Example

Compute the Taylor series centered at zero for f (x) = ex

Solution

f (x) = ex f (0) = 1

f ′(x) = ex f ′(0) = 1

f ′′(x) = ex f ′′(0) = 1

f ′′′(x) = ex f ′′′(0) = 1

. . . . . . . . . . . .

f (k)(x) = ex f (k)(0) = 1

So

T (x) =∞∑

k=0

xk

k!

Page 40: Taylor Polynomials and Series

FactThe Taylor series for the function f (x) = ex converges for all x toex .

The convergence is because the factorials k! grow much fasterthan the exponentials xk . It’s a little more work to say that itconverges to ex .

Page 41: Taylor Polynomials and Series

FactThe Taylor series for the function f (x) = ex converges for all x toex .

The convergence is because the factorials k! grow much fasterthan the exponentials xk . It’s a little more work to say that itconverges to ex .

Page 42: Taylor Polynomials and Series

Example

Compute the Taylor series centered at zero for f (x) = sin x .

Solution

f (x) = sin x f (0) = 0

f ′(x) = cos x f ′(0) = 1

f ′′(x) = − sin x f ′′(0) = 0

f ′′′(x) = − cos x f ′′′(0) = −1

f (4)(x) = cos x f (4)(0) = 1

And repeat! So

T (x) =∞∑

k=0k odd

±xk

k!=∞∑

m=0

(−1)mx2m+1

(2m + 1)!= x − x3

3!+

x5

5!− · · ·

This turns out to converge for all x to sin x.

Page 43: Taylor Polynomials and Series

Example

Compute the Taylor series centered at zero for f (x) = sin x .

Solution

f (x) = sin x f (0) = 0

f ′(x) = cos x f ′(0) = 1

f ′′(x) = − sin x f ′′(0) = 0

f ′′′(x) = − cos x f ′′′(0) = −1

f (4)(x) = cos x f (4)(0) = 1

And repeat! So

T (x) =∞∑

k=0k odd

±xk

k!=∞∑

m=0

(−1)mx2m+1

(2m + 1)!= x − x3

3!+

x5

5!− · · ·

This turns out to converge for all x to sin x.

Page 44: Taylor Polynomials and Series

Example

Compute the Taylor series centered at zero for f (x) = cos x .

Solution

f (x) = cos x f (0) = 1

f ′(x) = − sin x f ′(0) = 0

f ′′(x) = − cos x f ′′(0) = −1

f ′′′(x) = sin x f ′′′(0) = 0

f (4)(x) = sin x f (4)(0) = 0

And repeat! So

T (x) =∞∑

k=0k even

±xk

k!=∞∑

m=0

(−1)mx2m

(2m)!= 1− x2

2!+

x4

4!− · · ·

This turns out to converge for all x to cos x.

Page 45: Taylor Polynomials and Series

Example

Compute the Taylor series centered at zero for f (x) = cos x .

Solution

f (x) = cos x f (0) = 1

f ′(x) = − sin x f ′(0) = 0

f ′′(x) = − cos x f ′′(0) = −1

f ′′′(x) = sin x f ′′′(0) = 0

f (4)(x) = sin x f (4)(0) = 0

And repeat! So

T (x) =∞∑

k=0k even

±xk

k!=∞∑

m=0

(−1)mx2m

(2m)!= 1− x2

2!+

x4

4!− · · ·

This turns out to converge for all x to cos x.

Page 46: Taylor Polynomials and Series

Example (The Binomial Series)

Compute the Taylor series centered at zero for f (x) = (1 + x)p,where p is any number (not just a whole number).

Solution

f (x) = (1 + x)p f (0) = 1

f ′(x) = p(1 + x)p−1 f ′(0) = p

f ′′(x) = p(p − 1)(1 + x)p−2 f ′′(0) = p(p − 1)

f ′′′(x) = p(p − 1)(p − 2)(1 + x)p−3 f ′′′(0) = p(p − 1)(p − 2)

. . . . . . . . . . . .

So

T (x) = 1 + px +p(p − 1)

2x2 + . . .

=∞∑

k=0

p(p − 1)(p − 2) · · · (p − k + 1)

k!xk

Page 47: Taylor Polynomials and Series

Example (The Binomial Series)

Compute the Taylor series centered at zero for f (x) = (1 + x)p,where p is any number (not just a whole number).

Solution

f (x) = (1 + x)p f (0) = 1

f ′(x) = p(1 + x)p−1 f ′(0) = p

f ′′(x) = p(p − 1)(1 + x)p−2 f ′′(0) = p(p − 1)

f ′′′(x) = p(p − 1)(p − 2)(1 + x)p−3 f ′′′(0) = p(p − 1)(p − 2)

. . . . . . . . . . . .

So

T (x) = 1 + px +p(p − 1)

2x2 + . . .

=∞∑

k=0

p(p − 1)(p − 2) · · · (p − k + 1)

k!xk

Page 48: Taylor Polynomials and Series

New Taylor Series from Old

Big Time Theorem

We can integrate and differentiate power series, and the ROC stays

the same: If f (x) =∞∑

k=0

ck(x − a)k has radius of convergence R,

that is, if

f (x) =∞∑

k=0

ck(x − a)k when |x − a| < R,

then

f ′(x) =∞∑

k=1

kck(x − a)k−1 when |x − a| < R,

and∫f (x) dx =

∞∑k=0

1

k + 1ck(x − a)k+1 + C when |x − a| < R.

Page 49: Taylor Polynomials and Series

This is really saying two things:

1. The power series which is differentiated (or integrated)term-by-term has the same radius of convergence as theoriginal power series.

2. It converges to the thing we want: the derivative orantiderivative of f

Page 50: Taylor Polynomials and Series

The other big theorem

If f has any power series representation near a, then it is equal tothe Taylor Series.

Page 51: Taylor Polynomials and Series

Example

Compute the Taylor series centered at 0 for arctan x .

Solution

First, we’ll find the Taylor Series for1

1 + x2. It’s geometric:

1

1 + x2=

1

1− (−x2)=∞∑

k=0

(−x2)k =∞∑

k=0

(−1)kx2k .

This converges when∣∣x2∣∣ < 1 ⇐⇒ |x | < 1, so the ROC is 1.

Now arctan is the antiderivative:

arctan x =

∫ ∞∑k=0

(−1)kx2k dx =∞∑

k=0

(−1)k

∫x2k dx =

∞∑k=0

(−1)kx2k+1

(2k + 1)

And the ROC of this 1, too.

Page 52: Taylor Polynomials and Series

Example

Compute the Taylor series centered at 0 for arctan x .

Solution

First, we’ll find the Taylor Series for1

1 + x2. It’s geometric:

1

1 + x2=

1

1− (−x2)=∞∑

k=0

(−x2)k =∞∑

k=0

(−1)kx2k .

This converges when∣∣x2∣∣ < 1 ⇐⇒ |x | < 1, so the ROC is 1.

Now arctan is the antiderivative:

arctan x =

∫ ∞∑k=0

(−1)kx2k dx =∞∑

k=0

(−1)k

∫x2k dx =

∞∑k=0

(−1)kx2k+1

(2k + 1)

And the ROC of this 1, too.

Page 53: Taylor Polynomials and Series

Cool result

This means if

∞∑k=0

(−1)k

(2k + 1)= 1− 1

3+

1

5− 1

7+ · · ·

converges (and it does), it converges to

arctan(1) =π

4

Page 54: Taylor Polynomials and Series

Example

I Compute the Taylor series centered at 0 for f (x) = x7 sin(x3).

I Find f (2008)(0).

Solution

x7 sin(x3) = x7∞∑

m=0

(−1)m(x3)2m+1

(2m + 1)!= x7

∞∑m=0

(−1)mx6m+3

(2m + 1)!

=∞∑

m=0

(−1)mx6m+10

(2m + 1)!

Page 55: Taylor Polynomials and Series

Example

I Compute the Taylor series centered at 0 for f (x) = x7 sin(x3).

I Find f (2008)(0).

Solution

x7 sin(x3) = x7∞∑

m=0

(−1)m(x3)2m+1

(2m + 1)!= x7

∞∑m=0

(−1)mx6m+3

(2m + 1)!

=∞∑

m=0

(−1)mx6m+10

(2m + 1)!

Page 56: Taylor Polynomials and Series

To find f (2008)(0), note

∞∑m=0

(−1)mx6m+10

(2m + 1)!=∞∑

k=0

f (k)(0)xk

k!

Equating the coefficients of x2008 will get us what we want. If6m + 10 = 2008, then m = 333. So

f (2008)(0)

2008!=

(−1)333

667!

and thus

f (2008)(0) = −2008!

667!