28
Section 9.3 Taylor’s Theorem

Section 9.3 Taylor’s Theorem. When you learn new things, it is a healthy to ask yourself “Why are we learning this? What makes it interesting? What makes

Embed Size (px)

Citation preview

Page 1: Section 9.3 Taylor’s Theorem. When you learn new things, it is a healthy to ask yourself “Why are we learning this? What makes it interesting? What makes

Section 9.3

Taylor’s Theorem

Page 2: Section 9.3 Taylor’s Theorem. When you learn new things, it is a healthy to ask yourself “Why are we learning this? What makes it interesting? What makes

• When you learn new things, it is a healthy to ask yourself “Why are we learning this? What makes it interesting? What makes it relevant to the corpus of knowledge the human race has acquired?”

• This is not a copout or an excuse to justify not wanting to learn new things, but rather a way to put what your learning into perspective and make interesting connections

• Hence, we ask ourselves… what makes Taylor series interesting or useful? Why do we use them?

Why Taylor Series?

Page 3: Section 9.3 Taylor’s Theorem. When you learn new things, it is a healthy to ask yourself “Why are we learning this? What makes it interesting? What makes

• Which is faster for a computer to find for a value of x between -1 and 1?

• Imagine you were doing millions of these calculations per second. The time savings of the polynomial would be immense!

• Of course, the latter polynomial only gives you an approximation of arctan(x).

• In what scenario might someone care how accurate your approximation is?

Taylor Series Are a Tool for Approximation

3 51 x x

tan (x) or x ?3 5

Page 4: Section 9.3 Taylor’s Theorem. When you learn new things, it is a healthy to ask yourself “Why are we learning this? What makes it interesting? What makes

Imagine there’s an asteroid barreling towards Earth. If it hits, it will destroy the planet.

Example 1: Taylor Series as a Tool for Approximation

Page 5: Section 9.3 Taylor’s Theorem. When you learn new things, it is a healthy to ask yourself “Why are we learning this? What makes it interesting? What makes

The world’s best scientists have calculated that a rocket launched at an angle of arctan(0.8) radians will hit the asteroid dead-center.

Page 6: Section 9.3 Taylor’s Theorem. When you learn new things, it is a healthy to ask yourself “Why are we learning this? What makes it interesting? What makes

The problem is that the rocket needs to be launched pronto or else the asteroid is going to hit us. He doesn’t have time to wait around for his computer to calculate the billions of digits of arctan(0.8) for the near-perfect hit…

0.67474094222355266330565209736

Page 7: Section 9.3 Taylor’s Theorem. When you learn new things, it is a healthy to ask yourself “Why are we learning this? What makes it interesting? What makes

But we don’t need to hit this particular asteroid dead center to destroy it. Rather, we just need to make contact to destroy it.

Page 8: Section 9.3 Taylor’s Theorem. When you learn new things, it is a healthy to ask yourself “Why are we learning this? What makes it interesting? What makes

But we don’t need to hit this particular asteroid dead center to destroy it. Rather, we just need to make contact to destroy it.

Page 9: Section 9.3 Taylor’s Theorem. When you learn new things, it is a healthy to ask yourself “Why are we learning this? What makes it interesting? What makes

Our scientists tell us we really only need to be within 5% of the actual value of arctan(0.8) radians to make contact. Anything beyond this will miss…

Page 10: Section 9.3 Taylor’s Theorem. When you learn new things, it is a healthy to ask yourself “Why are we learning this? What makes it interesting? What makes

As long as we can calculate arctan(0.8) within this ±5% range, we’re saved!

Page 11: Section 9.3 Taylor’s Theorem. When you learn new things, it is a healthy to ask yourself “Why are we learning this? What makes it interesting? What makes

3 5

5

x xP (x) x

3 5

1f(x) tan (x)

5P (0.8) 0.6948693f(0.8) 0.67474094222355

Actual Estimate%Error

Actual

5f(0.8) P (0.8)

f(0.8)

2.9831%

Error Actual Estimate 5f(0.8) P (0.8) 0.02012839

Page 12: Section 9.3 Taylor’s Theorem. When you learn new things, it is a healthy to ask yourself “Why are we learning this? What makes it interesting? What makes

We’re saved!! We needed to be within 5% and we were actually within 2.983%!!!!

Page 13: Section 9.3 Taylor’s Theorem. When you learn new things, it is a healthy to ask yourself “Why are we learning this? What makes it interesting? What makes

Example 1

Find the Taylor polynomial of order four for the function at x 0,

and use it to approximate the value of the function at x 0.1.

2 3 44x 8x 16x

2x ...2 3 4

2 3 4x x x

ln(1 x) x ...2 3 4

f(x) ln(1 2x)

2 3 42x 2x 2x

2x( ) ( ) ( )

( ) ...2 3 4

3

2 44

8xP (x) 2x 2x 4x

3

3

2 44

8(0.1)P (0.1) 2(0.1) 2(0.1) 4(0.1)

3 0.22306

2(0.1)f(0.1) ln(1 ) 0.223143551...

ActualError 0.223143551 0.22306 0.000076885

Page 14: Section 9.3 Taylor’s Theorem. When you learn new things, it is a healthy to ask yourself “Why are we learning this? What makes it interesting? What makes

Example 1

Find the Taylor polynomial of order four for the function at x 0,

and use it to approximate the value of the function at x 0.1.

2 3 44x 8x 16x

2x ...2 3 4

2 3 4x x x

ln(1 x) x ...2 3 4

f(x) ln(1 2x)

2 3 42x 2x 2x

2x( ) ( ) ( )

( ) ...2 3 4

3

2 44

8xP (x) 2x 2x 4x

3

3

2 44

8(0.1)P (0.1) 2(0.1) 2(0.1) 4(0.1)

3 0.22306

2(0.1)f(0.1) ln(1 ) 0.223143551...

ActualError 0.223143551 0.22306 0.000076885

Page 15: Section 9.3 Taylor’s Theorem. When you learn new things, it is a healthy to ask yourself “Why are we learning this? What makes it interesting? What makes

Example 2

8

2

Find a formula for the truncation error if we use P (x) to approximate

1f(x) on( 1,1).

1 x

2 4 6 8 10 121 x x x x x x ...

2 3 4 511 x x x x x ...

1 x

2 3 4 5 6

2 2 2 2 2 21 x x x x x x ...f(x)

8 8P (x) R (x)

10 12 14 168R (x) x x x x ...

10

2

x

1 ( x )

10

2

x

1 x

Page 16: Section 9.3 Taylor’s Theorem. When you learn new things, it is a healthy to ask yourself “Why are we learning this? What makes it interesting? What makes

All of our examples so far have problem with them:

In the Asteroid Problem (and Example 1), we computed the (Actual – Estimate)/Actual to find our error of our approximation. Why did we find an ESTIMATE if checking if it was accurate enough to use required us to compute the ACTUAL value??And Example 2 didn’t need

a Taylor series expansion in the first place… It was just 1/(1+x2)

Page 17: Section 9.3 Taylor’s Theorem. When you learn new things, it is a healthy to ask yourself “Why are we learning this? What makes it interesting? What makes

Example 3: An Error ESTIMATE for arctan(0.8)

3 5

5

5

x xf(x)=arctan(x) P (x) x is used when x is near zero. ESTIMATE

3 5the error of using P (0.8) to approximate arctan(0.8).

3 5

5

x xP (x) x

3 5

EstimateThis!7 9 11 13

5

x x x xR (x) ...

7 9 11 13

1

3 5 7 9

Notice at x=0.8, the Taylor series for tan (x) is an alternating series:

(0.8) (0.8) (0.8) (0.8)f(0.8) (0.8) ...

3 5 7 9

Each new term bounces us above or below the

exact value, and eachsubsequent"bounce" gets

us a little closer to the actual value...

That is, the error can be no more than

the next term in the series evaluated at

x=0.8...

Page 18: Section 9.3 Taylor’s Theorem. When you learn new things, it is a healthy to ask yourself “Why are we learning this? What makes it interesting? What makes

Example 3: An Error ESTIMATE for arctan(0.8)

3 5

5

5

x xf(x)=arctan(x) P (x) x is used when x is near zero. ESTIMATE

3 5the error of using P (0.8) to approximate arctan(0.8).

7

5

xR (x) (Thenext term)

7

7

5

0.8R (0.8) 0.02995931

7

5This says that our approximation P (0.8)of arctan(0.8)

is at most 0.02995931 units off. This gives a maximum

percent error of 4.646%. The world is saved!

Page 19: Section 9.3 Taylor’s Theorem. When you learn new things, it is a healthy to ask yourself “Why are we learning this? What makes it interesting? What makes

We needed to be within 5% and we have an estimate that says our error is NO WORSE than 4.646%!

Page 20: Section 9.3 Taylor’s Theorem. When you learn new things, it is a healthy to ask yourself “Why are we learning this? What makes it interesting? What makes

Alternating Series Remainder Estimate

2

(3) (n)3 n

n

f''(a)f(x) f(a) f'(a)(x a) (x a)

2!f (a) f (a)

(x a) ... (x a) R (x)3! n!

(n 1) n 1

n

f (a)(x a)MaximumPossibleError : R (x)

(n 1)!

(n) n2

n

(n 1) n 1

f''(a) f (a)(x a)Theerror for P (x) f(a) f'(a)(x a) (x a) ...

2! n!f (a)(x a)

is no more than the next value in the series, , as long (n 1)!

as the series alternates AT YOUR CHOSEN VALUEOFx.

Page 21: Section 9.3 Taylor’s Theorem. When you learn new things, it is a healthy to ask yourself “Why are we learning this? What makes it interesting? What makes

Example 4: What If We Don’t Alternate?

2x 2The approximation f(x)=e 1 2x 2x is used when x is small. Find a bound for

the maximum error when x <0.1. Then graph.

22P (x) 1 2x 2x .

2Weareestimating R (x) ,but we don't alternate this time! That is,

the next term isn't enough:

3 4 n

2

(2x) (2x) (2x)R (x) ... ...

3! 4! n!

3

2

(2x)R (x) Some AdditionalSmallStuff

3!

Don't sweat the small stuff, we have a theorem to take care of it...

Page 22: Section 9.3 Taylor’s Theorem. When you learn new things, it is a healthy to ask yourself “Why are we learning this? What makes it interesting? What makes

Remainder Estimate Theorem

(n 1) n 1

n

f (a)(x a)R (x) Some Additional Small Stuff

(n 1)!

2

(3) (n)3 n

n

f''(a)f(x) f(a) f'(a)(x a) (x a)

2!f (a) f (a)

(x a) ... (x a) R (x)3! n!

(n 1) n 1

n

f (c)(x a)MaximumPossibleError : R (x)

(n 1)!

Taylor'sTheorem:We can overcome this "extra small stuff"

by replacing "a" with"c" for somecbetween"a" and"x."

Page 23: Section 9.3 Taylor’s Theorem. When you learn new things, it is a healthy to ask yourself “Why are we learning this? What makes it interesting? What makes

Example 42x 2

3The approximation f(x)=e P (x) 1 2x 2x is used when x is small. Find a bound

for the maximum error when x <0.1. Then graph.

(n 1) n 1

n

f (c)(x a)R (x)

(n 1)!

(3) 3

2

f (c)xR (x)

3!

(3) 3 3 2c 3f (c)x 2 e x3! 3!

3 2(0.1) 32 e (0.1)3!

0.001628537

2R (x) 0.001628537

(MaximumPOSSIBLEError)

2x

Pick a c that makes this

as large as possible. e

is increasing on -0.1<x<0.1,

so this will be biggest at 0.1.

3 2xf'''(x) 2 e

Page 24: Section 9.3 Taylor’s Theorem. When you learn new things, it is a healthy to ask yourself “Why are we learning this? What makes it interesting? What makes

Example 42x 2

3The approximation f(x)=e P (x) 1 2x 2x is used when x is small. Find a bound

for the maximum error when x <0.1. Then graph.

2R (x) 0.001628537

(MaximumPOSSIBLEError)

3f(0.1) P (0.1) 0.00140275

(ACTUALError)

Page 25: Section 9.3 Taylor’s Theorem. When you learn new things, it is a healthy to ask yourself “Why are we learning this? What makes it interesting? What makes

Example 5

2x x xThe approximation f(x)=ln 1 is used when x is small. Use the Remainder

2 2 8

Estimation Theorem to get a bound for the maximum error when x <0.1. Then graph.

2

2

x xP (x) .

2 8 2Weareestimating R (x) .(3) 3f (c)x

Wecanfindourmaximumpossibleerror with .3!

Onthe interval [-0.1,0.1],ourmax error willbeat x 0.1or x 0.1.

(3)3

2f (t)

(x 2)

35

2 3

x 0.1:

2 ( 0.1)R (x) 4.860 10

3!( 0.1 2)

35

2 3

x 0.1

2 (0.1)R (x) 3.599 10

3!(0.1 2)

5ESTIMATEDMaximumError on Interval :4.860 10

Page 26: Section 9.3 Taylor’s Theorem. When you learn new things, it is a healthy to ask yourself “Why are we learning this? What makes it interesting? What makes

Example 5

xf(x)=ln 1

2

2

2

x xP (x)

2 8

35

2 3

x 0.1:

2 ( 0.1)R (x) 4.860 10

3!( 0.1 2)

f(-0.1)=-0.05129329...

2

2

( 0.1) ( 0.1)P ( 0.1) 0.05125

2 8

5

ActualError :

f( 0.1) P( 0.1) 4.329 10

Page 27: Section 9.3 Taylor’s Theorem. When you learn new things, it is a healthy to ask yourself “Why are we learning this? What makes it interesting? What makes

Example 5

35

2 3

x 0.1:

2 ( 0.1)R (x) 4.860 10

3!( 0.1 2)

5Actual error is4.3 10 ,whichiswithin our bound.

2x x xy ln 1

2 2 8

Page 28: Section 9.3 Taylor’s Theorem. When you learn new things, it is a healthy to ask yourself “Why are we learning this? What makes it interesting? What makes

MEMORIZE!!

2

0

2

0

2 3

0

3 5 2 1 2 1

11 ... ... (| | 1)

1

11 ... ( ) ... ( ) (| | 1)

1

1 ... ... (for all real )2! 3! ! !

sin( ) ... ( 1) ... ( 1) (fo3! 5! (2 1)! (2 1)!

n n

n

n n

n

n nx

n

n nn n

x x x x xx

x x x x xx

x x x xe x x

n n

x x x xx x

n n

0

2 4 2 2

0

2 31 1

1

3 5 2 11

r all real )

cos( ) 1 ... ( 1) ... ( 1) (for all real )2! 4! (2 )! (2 )!

ln(1 ) ... ( 1) ... ( 1) ( 1 1)2 3

tan ( ) ... ( 1) ... ( 13 5 (2 1)

n

n nn n

n

n nn n

n

nn

x

x x x xx x

n n

x x x xx x x

n n

x x xx x

n

2 1

0

) (| | 1)(2 1)

nn

n

xx

n