newton’s method finds zeros efficiently finds zeros of an equation: –solves f(x)=0 why do we...

37

Upload: emilee-blakely

Post on 19-Jan-2016

215 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Newton’s Method finds Zeros Efficiently finds Zeros of an equation: –Solves f(x)=0 Why do we care?
Page 2: Newton’s Method finds Zeros Efficiently finds Zeros of an equation: –Solves f(x)=0 Why do we care?

Newton’s Method finds Zeros

• Efficiently finds Zeros of an equation:– Solves f(x)=0

• Why do we care?

Page 3: Newton’s Method finds Zeros Efficiently finds Zeros of an equation: –Solves f(x)=0 Why do we care?

Newton’s Method finds Zeros

• Efficiently finds Zeros of an equation:– Solves f(x)=0

• Why do we care?– Can make any “solve for value” problem (f(x)=a)

into a “find a zero” problem (f(x)-a=0).– Factor Polynomials– Find minima and maxima (Where does f´(x)=0?)– Find singular points (Where does 1/f(x) blow up?)

Page 4: Newton’s Method finds Zeros Efficiently finds Zeros of an equation: –Solves f(x)=0 Why do we care?

2 2 4 6

60

40

20

20

40

60

Newton’s Method: Graphical Form

Page 5: Newton’s Method finds Zeros Efficiently finds Zeros of an equation: –Solves f(x)=0 Why do we care?

2 2 4 6

60

40

20

20

40

60

This is the function

It has only one zero, at

x = ??

Page 6: Newton’s Method finds Zeros Efficiently finds Zeros of an equation: –Solves f(x)=0 Why do we care?

2 2 4 6

60

40

20

20

40

60

This is the function

It has only one zero, at

x = 1

Page 7: Newton’s Method finds Zeros Efficiently finds Zeros of an equation: –Solves f(x)=0 Why do we care?

2 2 4 6

60

40

20

20

40

60

Newton’s Method is as follows:

1) Guess a point. Let’s use xo=4.

Page 8: Newton’s Method finds Zeros Efficiently finds Zeros of an equation: –Solves f(x)=0 Why do we care?

2 2 4 6

60

40

20

20

40

60

Newton’s Method is as follows:

1) Guess a point. Let’s use xo=4.

2) At that point on the graph,

Page 9: Newton’s Method finds Zeros Efficiently finds Zeros of an equation: –Solves f(x)=0 Why do we care?

2 2 4 6

60

40

20

20

40

60

Newton’s Method is as follows:

1) Guess a point. Let’s use x=4.

2) At that point on the graph,

Draw the tangent.

Page 10: Newton’s Method finds Zeros Efficiently finds Zeros of an equation: –Solves f(x)=0 Why do we care?

2 2 4 6

60

40

20

20

40

60

Newton’s Method is as follows:

1) Guess a point. Let’s use x=4.

2) At that point on the graph,

Draw the tangent.

3) Follow the tangent to the x-axis:

Page 11: Newton’s Method finds Zeros Efficiently finds Zeros of an equation: –Solves f(x)=0 Why do we care?

2 2 4 6

60

40

20

20

40

60

Newton’s Method is as follows:

1) Guess a point. Let’s use xo=4.

2) At that point on the graph,

Draw the tangent.

3) Follow the tangent to the x-axis:

That’s our new guess.

Page 12: Newton’s Method finds Zeros Efficiently finds Zeros of an equation: –Solves f(x)=0 Why do we care?

2 2 4 6

60

40

20

20

40

60

Repeat those steps,

Until the answer doesn’t change:

That’s the root!

Page 13: Newton’s Method finds Zeros Efficiently finds Zeros of an equation: –Solves f(x)=0 Why do we care?

2 2 4 6

60

40

20

20

40

60

Remember our steps:

1) Guess a point: in this case, xo=4.

Newton’s Method: Algebraic Form

Page 14: Newton’s Method finds Zeros Efficiently finds Zeros of an equation: –Solves f(x)=0 Why do we care?

2 2 4 6

60

40

20

20

40

60

Remember our steps:

1) Guess a point: in this case, xo=4.

(xo,0)

Page 15: Newton’s Method finds Zeros Efficiently finds Zeros of an equation: –Solves f(x)=0 Why do we care?

2 2 4 6

60

40

20

20

40

60

Remember our steps:

1) Guess a point: in this case, xo=4.

2) At that point on the graph,

(xo,0)

(xo, f(xo))

Page 16: Newton’s Method finds Zeros Efficiently finds Zeros of an equation: –Solves f(x)=0 Why do we care?

2 2 4 6

60

40

20

20

40

60

Remember our steps:

1) Guess a point: in this case, xo=4.

2) At that point on the graph,

Draw the tangent.

(xo,0)

(xo, f(xo))Slope: f´(xo)

Page 17: Newton’s Method finds Zeros Efficiently finds Zeros of an equation: –Solves f(x)=0 Why do we care?

2 2 4 6

60

40

20

20

40

60

Remember our steps:

1) Guess a point: in this case, xo=4.

2) At that point on the graph,

Draw the tangent.

3) Follow the tangent to the x-axis:

That’s our new guess.

(xo,0)

(xo, f(xo))Slope: f´(xo)

(xo-??,0)

Page 18: Newton’s Method finds Zeros Efficiently finds Zeros of an equation: –Solves f(x)=0 Why do we care?

2 2 4 6

60

40

20

20

40

60

(xo,0)

(xo, f(xo))Slope: f´(xo)

(xo-??, f(xo)-f(xo))

Page 19: Newton’s Method finds Zeros Efficiently finds Zeros of an equation: –Solves f(x)=0 Why do we care?

2 2 4 6

60

40

20

20

40

60

(xo,0)

(xo, f(xo))Slope: f´(xo)

Page 20: Newton’s Method finds Zeros Efficiently finds Zeros of an equation: –Solves f(x)=0 Why do we care?

2 2 4 6

60

40

20

20

40

60

(xo,0)

(xo, f(xo))Slope: f´(xo)

Newton’s Method iterates to find a zero:

(“iterate” means feed the answer

back in to find the next answer)

At each step,

Page 21: Newton’s Method finds Zeros Efficiently finds Zeros of an equation: –Solves f(x)=0 Why do we care?

2 2 4 6

60

40

20

20

40

60

(xo,0)

(xo, f(xo))

Newton’s Method iterates to find a zero:At each step,

(x2,0)(x3,0) (x1,0)

Page 22: Newton’s Method finds Zeros Efficiently finds Zeros of an equation: –Solves f(x)=0 Why do we care?

4 2 2 4

20

10

10

20

30

40

50

Your Turn

f(x)=(x+3)(x+1)(x-1)(x-3)

Your Turn

Page 23: Newton’s Method finds Zeros Efficiently finds Zeros of an equation: –Solves f(x)=0 Why do we care?

4 2 2 4

20

10

10

20

30

40

50

1) Start with the point written on

your worksheet

2) At that point on the graph,

Draw the tangent.

3) Follow the tangent to the x-axis:

That’s our new guess.

Your Turn

Repeat those steps,

Until the result doesn’t change:

That’s the root!f(x)=(x+3)(x+1)(x-1)(x-3)

Page 24: Newton’s Method finds Zeros Efficiently finds Zeros of an equation: –Solves f(x)=0 Why do we care?

Approximating Zeros

• Newton’s Method isn’t the only way:– Use 1 guess, derivative

• Newton’s Method

– Use 2 guesses, interval must contain a zero• Bisection Method• Secant Method• False Position Method

• Computers & Calculators:– One of the interval methods

Page 25: Newton’s Method finds Zeros Efficiently finds Zeros of an equation: –Solves f(x)=0 Why do we care?

Why does the TI-89 Lie?!• Bust out your calculators and find

• TI-89: input x^2 into the first y-input. Graph that equation. Then hit F5 followed by 2:Zero and then type in -1 and 1. Wait 30 seconds or more.

• TI-83:input x^2 into the first y-input. Graph that equation. Push second Calc and then choose your bounds but do not choose 0 as your guess.

Page 26: Newton’s Method finds Zeros Efficiently finds Zeros of an equation: –Solves f(x)=0 Why do we care?

Roots can be Dangerous!

• TI-83 uses numerical method combined with secants.

• TI-89 uses a complex algorithm that forms a rounding error from going from 14 decimal places to 16 decimal places back and forth.

Page 27: Newton’s Method finds Zeros Efficiently finds Zeros of an equation: –Solves f(x)=0 Why do we care?

How can we Break it?• How can we make Newton’s Method Fail?• (Newton’s Method:

– Want to find roots of an equation– Using an initial guess,

– Iterate the equation

– Until result doesn’t change)

Page 28: Newton’s Method finds Zeros Efficiently finds Zeros of an equation: –Solves f(x)=0 Why do we care?

How can we Break it?• Ask a stupid question

– No real roots– Roots at infinity

• Break the equation:

Page 29: Newton’s Method finds Zeros Efficiently finds Zeros of an equation: –Solves f(x)=0 Why do we care?

How can we Break it?• Ask a stupid question

– No real roots– Roots at infinity

• Break the equation:

– Function that is not continuous– Function that doesn’t have derivative– Function that doesn’t change sign at root

• Equivalently: derivative is zero at the root.

• Use a foolish initial guess– What happens?

Page 30: Newton’s Method finds Zeros Efficiently finds Zeros of an equation: –Solves f(x)=0 Why do we care?

• Do all initial guesses go to a root?– Do some go off to infinity?– Do some bounce around forever?

• What root does each initial guess lead to?

What happens when you guess Foolishly?

Page 31: Newton’s Method finds Zeros Efficiently finds Zeros of an equation: –Solves f(x)=0 Why do we care?

4 2 2 4

20

10

10

20

30

40

50

Are there Foolish Guesses?Let’s make a map: • Each person grab a post-it note that

corresponds to the root you found:• Put it up, on the axis, at the point of

your initial guess.

f(x)=(x+3)(x+1)(x-1)(x-3)

Page 32: Newton’s Method finds Zeros Efficiently finds Zeros of an equation: –Solves f(x)=0 Why do we care?

Complex Map of GuessesLet’s extend to complex plane: look at function

• Where does this have zeros?

Page 33: Newton’s Method finds Zeros Efficiently finds Zeros of an equation: –Solves f(x)=0 Why do we care?

4 2 2 4

20

10

10

20

30

40

50

f(x)=(x+3)(x+1)(x-1)(x-3)

Page 34: Newton’s Method finds Zeros Efficiently finds Zeros of an equation: –Solves f(x)=0 Why do we care?

-2 -1.5 -1 -0.5 0.5 1 1.5 2

-2

-1.5

-1

-0.5

0.5

1

1.5

2

Complex Map of GuessesLet’s extend to complex plane: look at function

• Where does this have zeros? (At 1, -1, i, -i)

Page 35: Newton’s Method finds Zeros Efficiently finds Zeros of an equation: –Solves f(x)=0 Why do we care?

Complex Map of GuessesYou might think the map of guesses looks like this:

Page 36: Newton’s Method finds Zeros Efficiently finds Zeros of an equation: –Solves f(x)=0 Why do we care?

Complex Map of GuessesIn fact, it looks like this:

Page 37: Newton’s Method finds Zeros Efficiently finds Zeros of an equation: –Solves f(x)=0 Why do we care?

Complex Map of Guesses

This is a “Newton’s Method” fractal

• Type of ‘Julia Set’ Fractal• At each point of boundary, EVERY color touches!

• Program to explore this and other fractals:

http://xaos.sourceforge.net/