Taylor’s Polynomials & LaGrange Error Review. Maclaurin Series: (generated by f at ) If we want to...

33
QuickTime™ and a decompressor are needed to see this picture. aylor’s Polynomials & LaGrange Error Review

Transcript of Taylor’s Polynomials & LaGrange Error Review. Maclaurin Series: (generated by f at ) If we want to...

Page 1: Taylor’s Polynomials & LaGrange Error Review. Maclaurin Series: (generated by f at ) If we want to center the series (and it’s graph) at some point other.

QuickTime™ and a decompressor

are needed to see this picture.

Taylor’s Polynomials & LaGrange Error Review

Page 2: Taylor’s Polynomials & LaGrange Error Review. Maclaurin Series: (generated by f at ) If we want to center the series (and it’s graph) at some point other.

Maclaurin Series:

(generated by f at )0x =

( ) ( ) ( ) ( ) ( )2 30 00 0

2! 3!

f fP x f f x x x

′′ ′′′′= + + + + ⋅⋅⋅

If we want to center the series (and it’s graph) at some point other than zero, we get the Taylor Series:

Taylor Series:

(generated by f at )x a=

( ) ( ) ( )( ) ( )( ) ( )( )2 3

2! 3!

f a f aP x f a f a x a x a x a

′′ ′′′′= + − + − + − + ⋅⋅⋅

Page 3: Taylor’s Polynomials & LaGrange Error Review. Maclaurin Series: (generated by f at ) If we want to center the series (and it’s graph) at some point other.

-1

0

1

-5 -4 -3 -2 -1 1 2 3 4 5

cosy x= ( )2 4 6 8 10

1 2! 4! 6! 8! 10!

x x x x xP x = − + − + − ⋅⋅⋅

The more terms we add, the better our approximation.

Hint: On the TI-89, the factorial symbol is: ÷

Page 4: Taylor’s Polynomials & LaGrange Error Review. Maclaurin Series: (generated by f at ) If we want to center the series (and it’s graph) at some point other.

example: ( )cos 2y x=

Rather than start from scratch, we can use the function that we already know:

( ) ( ) ( ) ( ) ( ) ( )2 4 6 8 102 2 2 2 2

1 2! 4! 6! 8! 10!

x x x x xP x = − + − + − ⋅⋅⋅

Page 5: Taylor’s Polynomials & LaGrange Error Review. Maclaurin Series: (generated by f at ) If we want to center the series (and it’s graph) at some point other.

When referring to Taylor polynomials, we can talk about number of terms, order or degree.

2 4

cos 12! 4!

x xx = − + This is a polynomial in 3 terms.

It is a 4th order Taylor polynomial, because it was found using the 4th derivative.

It is also a 4th degree polynomial, because x is raised to the 4th power.

The 3rd order polynomial for is , but it is degree 2.

cos x2

12!

x−

The x3 term drops out when using the third derivative.

This is also the 2nd order polynomial.

A recent AP exam required the student to know the difference between order and degree.

Page 6: Taylor’s Polynomials & LaGrange Error Review. Maclaurin Series: (generated by f at ) If we want to center the series (and it’s graph) at some point other.

There are some Maclaurin series that occur often enough that they should be memorized. They are on your formula sheet, but today we are going to look at where they come from.

Maclaurin Series:

(generated by f at )0x =

( ) ( ) ( ) ( ) ( )2 30 00 0

2! 3!

f fP x f f x x x

′′ ′′′′= + + + + ⋅⋅⋅

Page 7: Taylor’s Polynomials & LaGrange Error Review. Maclaurin Series: (generated by f at ) If we want to center the series (and it’s graph) at some point other.

( ) ( ) ( ) ( ) ( )2 30 00 0

2! 3!

f fP x f f x x x

′′ ′′′′= + + + + ⋅⋅⋅( ) 11

11

xx

−= −

( ) 11 x

−−

( ) 21 x

−−

( ) 32 1 x

−−

( ) 46 1 x

−−

( ) 524 1 x

−−

( ) ( )nf x

List the function and itsderivatives.

Page 8: Taylor’s Polynomials & LaGrange Error Review. Maclaurin Series: (generated by f at ) If we want to center the series (and it’s graph) at some point other.

List the function and itsderivatives.

Evaluate column onefor x = 0.

( ) ( ) ( ) ( ) ( )2 30 00 0

2! 3!

f fP x f f x x x

′′ ′′′′= + + + + ⋅⋅⋅( ) 11

11

xx

−= −

( ) 11 x

−−

( ) 21 x

−−

( ) 32 1 x

−−

( ) 46 1 x

−−

( ) 524 1 x

−−

1

1

2

6 3!=

24 4!=

( ) ( )0nf( ) ( )nf x

2 3 42 31

1 2! 3!

! 4!1

!1

4x x x x

x= + + + + +⋅⋅⋅

2 3 411

1x x x x

x= + + + + +⋅⋅⋅

This is a geometric series witha = 1 and r = x.

Page 9: Taylor’s Polynomials & LaGrange Error Review. Maclaurin Series: (generated by f at ) If we want to center the series (and it’s graph) at some point other.

( )1 1 x−1

1 x−x

x+

2x x−

2x+

2x2 3x x−

3x

3x+ +⋅⋅⋅

We could generate this same series for with polynomial long division:

1

1 x−

Page 10: Taylor’s Polynomials & LaGrange Error Review. Maclaurin Series: (generated by f at ) If we want to center the series (and it’s graph) at some point other.

( ) ( ) ( ) ( ) ( )2 30 00 0

2! 3!

f fP x f f x x x

′′ ′′′′= + + + + ⋅⋅⋅( ) 11

11

xx

−= +

+

( ) 11 x

−+

( ) 21 x

−− +

( ) 32 1 x

−+

( ) 46 1 x

−− +

( ) 524 1 x

−+

1

1−

2

6 3!− =−

24 4!=

( ) ( )0nf( ) ( )nf x

2 3 421

1 2! 3! 4!

3! 4!1 1x x x x

x

−= + + + + +⋅⋅⋅

+−

2 3 411

1x x x x

x= − + − + +⋅⋅⋅

+

This is a geometric series witha = 1 and r = -x.

Page 11: Taylor’s Polynomials & LaGrange Error Review. Maclaurin Series: (generated by f at ) If we want to center the series (and it’s graph) at some point other.

We wouldn’t expect to use the previous two series to evaluate the functions, since we can evaluate the functions directly.

We will find other uses for these series, as well.

They do help to explain where the formula for the sum of an infinite geometric comes from.

A more impressive use of Taylor series is to evaluate transcendental functions.

Page 12: Taylor’s Polynomials & LaGrange Error Review. Maclaurin Series: (generated by f at ) If we want to center the series (and it’s graph) at some point other.

( ) ( ) ( ) ( ) ( )2 30 00 0

2! 3!

f fP x f f x x x

′′ ′′′′= + + + + ⋅⋅⋅( )cos x

( )cos x

( )sin x−

( )cos x−

( )sin x

( )cos x

1

0

1−

0

1

( ) ( )0nf( ) ( )nf x

( ) 2 3 4cos2! 3!

1 0

4!

11 0x x x x x= + + + +

−+ ⋅⋅⋅

( )2 4 6

cos 1 2! 4! 6!

x x xx = − + − ⋅⋅⋅

Both sides are even functions.

Cos (0) = 1 for both sides.→

Page 13: Taylor’s Polynomials & LaGrange Error Review. Maclaurin Series: (generated by f at ) If we want to center the series (and it’s graph) at some point other.

( ) ( ) ( ) ( ) ( )2 30 00 0

2! 3!

f fP x f f x x x

′′ ′′′′= + + + + ⋅⋅⋅( )sin x

( )sin x

( )cos x

( )sin x−

( )cos x−

( )sin x

0

1

0

1−

0

( ) ( )0nf( ) ( )nf x

( ) 2 3 4sin2

0 1 00 1

! 3! 4!x x x x x

−= + + + + + ⋅⋅⋅

( )3 5 7

sin 3! 5! 7!

x x xx x= − + − ⋅⋅⋅

Both sides are odd functions.

Sin (0) = 0 for both sides.→

Page 14: Taylor’s Polynomials & LaGrange Error Review. Maclaurin Series: (generated by f at ) If we want to center the series (and it’s graph) at some point other.

2 3 411

1x x x x

x= − + − + +⋅⋅⋅

+

2

1

1 x+

If we start with this function:

and substitute for , we get:2x x 2 4 6 8

2

11

1x x x x

x= − + − + +⋅⋅⋅

+

This is a geometric series with a = 1 and r = -x2.

If we integrate both sides:

2 4 6 82

1 1

1dx x x x x dx

x= − + − + +⋅⋅⋅

+∫ ∫

( )3 5 7

1tan 3 5 7

x x xx x− = − + − + ⋅⋅⋅

This looks the same as the series for sin (x), but without the factorials. →

Page 15: Taylor’s Polynomials & LaGrange Error Review. Maclaurin Series: (generated by f at ) If we want to center the series (and it’s graph) at some point other.

( ) ( ) ( ) ( ) ( )2 30 00 0

2! 3!

f fP x f f x x x

′′ ′′′′= + + + + ⋅⋅⋅( )ln 1 x+

( )ln 1 x+

( ) 11 x

−+

( ) 21 x

−− +

( ) 32 1 x

−+

( ) 46 1 x

−− −

0

1

1−

2

6 3!− =−

( ) ( )0nf( ) ( )nf x

( ) 2 3 4ln 12

1

! 3! 4

20 1

!

3!x x x x x+ = + + +

−+

−+ ⋅⋅⋅

( )2 3 4

ln 12 3 4

x x xx x+ = − + − + ⋅⋅⋅

Page 16: Taylor’s Polynomials & LaGrange Error Review. Maclaurin Series: (generated by f at ) If we want to center the series (and it’s graph) at some point other.

( ) ( ) ( ) ( ) ( )2 30 00 0

2! 3!

f fP x f f x x x

′′ ′′′′= + + + + ⋅⋅⋅xe

xe

xe

xe

xe

xe

1

1

1

1

1

( ) ( )0nf( ) ( )nf x

2 3 41 1 11 1

2! 3! 4!xe x x x x= + + + + +⋅⋅⋅

2 3 4

12! 3! 4!

x x x xe x= + + + + +⋅⋅⋅

Page 17: Taylor’s Polynomials & LaGrange Error Review. Maclaurin Series: (generated by f at ) If we want to center the series (and it’s graph) at some point other.

Finding Truncation Error in a Taylor Polynomial

Graph the function y1 = ln (1 + x) and it’s corresponding Taylor Polynomial

y

2 = x -

x2

2 +

x3

3 -

x4

4 +

x5

5

Page 18: Taylor’s Polynomials & LaGrange Error Review. Maclaurin Series: (generated by f at ) If we want to center the series (and it’s graph) at some point other.

Finding Truncation Error in a Taylor Polynomial

Graph the function y1 = ln (1 + x) and it’s corresponding Taylor Polynomial

2 3 4 5

2

x x x xy = x - + - -

2 3 4 5

Page 19: Taylor’s Polynomials & LaGrange Error Review. Maclaurin Series: (generated by f at ) If we want to center the series (and it’s graph) at some point other.

To find the error between the functions, graph y3 = abs (y2 – y1).

Finding Truncation Error in a Taylor Polynomial

Page 20: Taylor’s Polynomials & LaGrange Error Review. Maclaurin Series: (generated by f at ) If we want to center the series (and it’s graph) at some point other.

To find the error between the functions, graph y3 = abs (y2 – y1).

Where is the error the smallest?

Finding Truncation Error in a Taylor Polynomial

Page 21: Taylor’s Polynomials & LaGrange Error Review. Maclaurin Series: (generated by f at ) If we want to center the series (and it’s graph) at some point other.

Use Table to see where truncation error is least on (-1,1)

Page 22: Taylor’s Polynomials & LaGrange Error Review. Maclaurin Series: (generated by f at ) If we want to center the series (and it’s graph) at some point other.

Finding Error in a Taylor Polynomial

Graph the function y1 = sin x and it’s corresponding Taylor Polynomial and find the interval in which the

Taylor polynomial is accurate to the thousandths place.

3

2

xy = x -

6

Page 23: Taylor’s Polynomials & LaGrange Error Review. Maclaurin Series: (generated by f at ) If we want to center the series (and it’s graph) at some point other.

Finding Error in a Taylor Polynomial

The third order Taylor Polynomial for y = sin x is accurate to the thousandths place on the interval (-.65, .65). Graph

y3 = abs (y1(x) – y2(x)), and y4 = .001.

Page 24: Taylor’s Polynomials & LaGrange Error Review. Maclaurin Series: (generated by f at ) If we want to center the series (and it’s graph) at some point other.

Taylor series are used to estimate the value of functions (at least theoretically - now days we can usually use the calculator or computer to calculate directly.)

An estimate is only useful if we have an idea of how accurate the estimate is.

When we use part of a Taylor series to estimate the value of a function, the end of the series that we do not use is called the remainder. If we know the size of the remainder, then we know how close our estimate is.

Page 25: Taylor’s Polynomials & LaGrange Error Review. Maclaurin Series: (generated by f at ) If we want to center the series (and it’s graph) at some point other.

For a geometric series, this is easy:

ex. 2: Use to approximate over .2 4 61 x x x+ + + 2

1

1 x−( )1,1−

Since the truncated part of the series is: ,8 10 12 x x x+ + + ⋅⋅⋅

the truncation error is , which is .8 10 12 x x x+ + + ⋅⋅⋅8

21

x

x−

When you “truncate” a number, you drop off the end.

Of course this is also trivial, because we have a formula that allows us to calculate the sum of a geometric series directly.

Page 26: Taylor’s Polynomials & LaGrange Error Review. Maclaurin Series: (generated by f at ) If we want to center the series (and it’s graph) at some point other.

Taylor’s Theorem with Remainder

If f has derivatives of all orders in an open interval I containing a, then for each positive integer n and for each x

in I:

( ) ( ) ( )( ) ( ) ( )( ) ( ) ( ) ( )2

2! !

nn

n

f fa af f f Rx a a x a x a x a xn

′′′= + + + ⋅⋅⋅ +− − −

Lagrange Form of the Remainder

( )( ) ( )( ) ( )

11

1 !

nn

n

f cR x x a

n

++

= −+

Remainder after partial sum Sn

where c is between

a and x.

Page 27: Taylor’s Polynomials & LaGrange Error Review. Maclaurin Series: (generated by f at ) If we want to center the series (and it’s graph) at some point other.

Lagrange Form of the Remainder

( )( ) ( )( ) ( )

11

1 !

nn

n

f cR x x a

n

++

= −+

Remainder after partial sum Sn

where c is between

a and x.

This is also called the remainder of order n or the error term.

Note that this looks just like the next term in the series, but

“a” has been replaced by the number “c” in .( ) ( )1nf c+

This seems kind of vague, since we don’t know the value of c,

but we can sometimes find a maximum value for .( ) ( )1nf c+

Page 28: Taylor’s Polynomials & LaGrange Error Review. Maclaurin Series: (generated by f at ) If we want to center the series (and it’s graph) at some point other.

This is called Taylor’s Inequality.

Taylor’s InequalityNote that this is not the formula that is in our book. It is from another textbook.

Lagrange Form of the Remainder

( )( ) ( )( ) ( )

11

1 !

nn

n

f cR x x a

n

++

= −+

If M is the maximum value of on the interval

between a and x, then:

( ) ( )1nf x+

( ) ( )1

1 !n

n

MR x x a

n+≤ −

+

Page 29: Taylor’s Polynomials & LaGrange Error Review. Maclaurin Series: (generated by f at ) If we want to center the series (and it’s graph) at some point other.

ex. 2: Prove that , which is the Taylor

series for sin x, converges for all real x.

( )( )

2 1

0 1!2 1

kk

k

x

k

+∞

= −+

Since the maximum value of sin x or any of it’s

derivatives is 1, for all real x, M = 1.

( )( )

110

!1n

nR x xn

+∴ ≤ −+ ( )

1

!1

nx

n

+

=+

( )

1

lim 0!1

n

n

x

n

+

→∞=

+

so the series converges.

Taylor’s Inequality

( ) ( )1

1 !n

n

MR x x a

n+≤ −

+→

Page 30: Taylor’s Polynomials & LaGrange Error Review. Maclaurin Series: (generated by f at ) If we want to center the series (and it’s graph) at some point other.

ex. 5: Find the Lagrange Error Bound when is used

to approximate and .

2

2

xx −

( )ln 1 x+ 0.1x ≤

( ) ( )ln 1f x x= +

( ) ( ) 11f x x

−′ = +

( ) ( ) 21f x x

−′′ = − +

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

( ) ( ) ( ) ( ) ( )22

0 00

1 2!

f ff f x x Rx x

′ ′′= + + +

Remainder after 2nd order term

( ) ( )2

202

xf x Rx x= + − +

On the interval , decreases, so

its maximum value occurs at the left end-point.

[ ].1,.1− ( )3

2

1 x+

( )3

2

1 .1M =

+ − ( )3

2

.9= 2.74348422497≈

Page 31: Taylor’s Polynomials & LaGrange Error Review. Maclaurin Series: (generated by f at ) If we want to center the series (and it’s graph) at some point other.

ex. 5:2

2

xx −

( )ln 1 x+ 0.1x ≤

On the interval , decreases, so

its maximum value occurs at the left end-point.

[ ].1,.1− ( )3

2

1 x+

( )3

2

1 .1M =

+ − ( )3

2

.9= 2.74348422497≈

Taylor’s Inequality

( ) ( )1

1 !n

n

MR x x a

n+≤ −

+

( )32.7435 .1

3!nR x ≤

( ) 0.000457nR x ≤

Lagrange Error Bound

x ( )ln 1 x+

2

2

xx − error

.1 .0953102 .095 .000310

.1− .1053605− .105− .000361

Error is less than error bound. →

Find the Lagrange Error Bound when is used to

approximate and .

Page 32: Taylor’s Polynomials & LaGrange Error Review. Maclaurin Series: (generated by f at ) If we want to center the series (and it’s graph) at some point other.

Example using Taylor’s Theorem with Remainder

For approximately what values of x can you replace sin x by with an error magnitude no greater than 1 x 10-3 ?

( ) ( )5

5

- 34

5

Since f c = cos c 1, then

xR (x) 1 x 10

5!

x .12

x .65

≤ ≤

x - x3

3!

Page 33: Taylor’s Polynomials & LaGrange Error Review. Maclaurin Series: (generated by f at ) If we want to center the series (and it’s graph) at some point other.

Taylor’s Theorem with Remainder

( )n

7n

100 100 100 100 100 100 100Ex : lim = ... ... ...

n+1 ! 1 2 3 100 101 10→∞g g g g g g

Taylor’s Theorem with Remainder works well with the functions y = sin x and y = cos x because |f (n+1)(c)| ≤ 1.

Note: Factorial growth in the denominator is larger than the exponential growth in the numerator.

Since | Rn(x)| 0 then the Taylor Series converges as n → ∞