Lesson 23: Newton's Method

39
. . . . . . Section 4.8 Newton’s Method Math 1a Introduction to Calculus April 4, 2008 Announcements Problem Sessions Sunday, Thursday, 7pm, SC 310 Office hours Tues, Weds, 2–4pm SC 323 Midterm II: 4/11 in class (§4.3 through §4.8)

description

Newton's method allows us to find zeros of functions quickly.

Transcript of Lesson 23: Newton's Method

Page 1: Lesson 23: Newton's Method

. . . . . .

Section4.8Newton’sMethod

Math1aIntroductiontoCalculus

April4, 2008

Announcements

◮ ProblemSessionsSunday, Thursday, 7pm, SC 310◮ OfficehoursTues, Weds, 2–4pmSC 323◮ MidtermII:4/11inclass(§4.3through§4.8)

Page 2: Lesson 23: Newton's Method

. . . . . .

Announcements

◮ ProblemSessionsSunday, Thursday, 7pm, SC 310◮ OfficehoursTues, Weds, 2–4pmSC 323◮ MidtermII:4/11inclass(§4.3through§4.8)

Page 3: Lesson 23: Newton's Method

. . . . . .

Outline

Lasttime

Introduction

Newton’sMethodGraphicallySymbolically

ApplicationsZeroesoffunctionsRootsofequationsConvergence

Flaws(lackof)convergenceconvergencetowhat?

Wow

Page 4: Lesson 23: Newton's Method

. . . . . .

Lasttime: Economics

◮ terms: totalcost, averagecost, marginalcost, revenue,marginalrevenue, profit, marginalprofit

◮ Atthepointofminimalaveragecost, averagecostisequaltomarginalcost

◮ Atthepointofmaximumprofit, marginalrevenueisequaltomarginalcost

Page 5: Lesson 23: Newton's Method

. . . . . .

Outline

Lasttime

Introduction

Newton’sMethodGraphicallySymbolically

ApplicationsZeroesoffunctionsRootsofequationsConvergence

Flaws(lackof)convergenceconvergencetowhat?

Wow

Page 6: Lesson 23: Newton's Method

. . . . . .

TheBabylonianSquareRootExtractor

Toestimatethesquarerootofa:

◮ Makeaguess x

◮ If x =√a, x =

ax

◮ Otherwise, oneof x andaxisbiggerthan

√a and

oneissmaller◮ averageof x and

axis

closerto√a than x

◮ rinse, lather, repeat

Page 7: Lesson 23: Newton's Method

. . . . . .

BSRE inaction

Trytofind√2.

Iteration Guess0 1.00000000001 1.5000000002 1.4166666673 1.4142156864 1.4142135625 1.414213562

Page 8: Lesson 23: Newton's Method

. . . . . .

BSRE inaction

Trytofind√2.

Iteration Guess0 1.00000000001 1.5000000002 1.4166666673 1.4142156864 1.4142135625 1.414213562

Page 9: Lesson 23: Newton's Method

. . . . . .

◮ Numericalmethodsforsolvingequationsareusefulinthe“realworld.”

◮ Newton’smethodisageneralizablemethodfordoingso.

Page 10: Lesson 23: Newton's Method

. . . . . .

Outline

Lasttime

Introduction

Newton’sMethodGraphicallySymbolically

ApplicationsZeroesoffunctionsRootsofequationsConvergence

Flaws(lackof)convergenceconvergencetowhat?

Wow

Page 11: Lesson 23: Newton's Method

. . . . . .

TheProblem

Givenafunction f, find x∗ suchthat f(x∗) = 0.

Page 12: Lesson 23: Newton's Method

. . . . . .

Graphicalillustration

◮ Chooseapoint x0 tostart

◮ If f(x0) ̸= 0, Drawthelinetangenttothegraphof y = f(x) at (x0, f(x0))

◮ Thislineintersectsthex-axisanewpoint, callit x1

◮ Rinse, lather, repeat

..x

.y

.x0 .x1.x2

Page 13: Lesson 23: Newton's Method

. . . . . .

Graphicalillustration

◮ Chooseapoint x0 tostart

◮ If f(x0) ̸= 0, Drawthelinetangenttothegraphof y = f(x) at (x0, f(x0))

◮ Thislineintersectsthex-axisanewpoint, callit x1

◮ Rinse, lather, repeat

..x

.y

.x0

.x1.x2

Page 14: Lesson 23: Newton's Method

. . . . . .

Graphicalillustration

◮ Chooseapoint x0 tostart

◮ If f(x0) ̸= 0, Drawthelinetangenttothegraphof y = f(x) at (x0, f(x0))

◮ Thislineintersectsthex-axisanewpoint, callit x1

◮ Rinse, lather, repeat

..x

.y

.x0

.x1.x2

Page 15: Lesson 23: Newton's Method

. . . . . .

Graphicalillustration

◮ Chooseapoint x0 tostart

◮ If f(x0) ̸= 0, Drawthelinetangenttothegraphof y = f(x) at (x0, f(x0))

◮ Thislineintersectsthex-axisanewpoint, callit x1

◮ Rinse, lather, repeat

..x

.y

.x0 .x1

.x2

Page 16: Lesson 23: Newton's Method

. . . . . .

Graphicalillustration

◮ Chooseapoint x0 tostart

◮ If f(x0) ̸= 0, Drawthelinetangenttothegraphof y = f(x) at (x0, f(x0))

◮ Thislineintersectsthex-axisanewpoint, callit x1

◮ Rinse, lather, repeat

..x

.y

.x0 .x1

.x2

Page 17: Lesson 23: Newton's Method

. . . . . .

Graphicalillustration

◮ Chooseapoint x0 tostart

◮ If f(x0) ̸= 0, Drawthelinetangenttothegraphof y = f(x) at (x0, f(x0))

◮ Thislineintersectsthex-axisanewpoint, callit x1

◮ Rinse, lather, repeat

..x

.y

.x0 .x1.x2

Page 18: Lesson 23: Newton's Method

. . . . . .

Symbolicexpression

Bydefinition, thelinebetween (xn, f(xn)), (xn+1, 0) istangenttothegraphof f(x) at xn.

Thus

f(xn) − 0xn − xn+1

= f′(xn)

So

xn+1 = xn −f(xn)f′(xn)

Iterating thismethodgivesussuccessive“guesses”forazerotothefunction.

Page 19: Lesson 23: Newton's Method

. . . . . .

Symbolicexpression

Bydefinition, thelinebetween (xn, f(xn)), (xn+1, 0) istangenttothegraphof f(x) at xn. Thus

f(xn) − 0xn − xn+1

= f′(xn)

So

xn+1 = xn −f(xn)f′(xn)

Iterating thismethodgivesussuccessive“guesses”forazerotothefunction.

Page 20: Lesson 23: Newton's Method

. . . . . .

Symbolicexpression

Bydefinition, thelinebetween (xn, f(xn)), (xn+1, 0) istangenttothegraphof f(x) at xn. Thus

f(xn) − 0xn − xn+1

= f′(xn)

So

xn+1 = xn −f(xn)f′(xn)

Iterating thismethodgivesussuccessive“guesses”forazerotothefunction.

Page 21: Lesson 23: Newton's Method

. . . . . .

Outline

Lasttime

Introduction

Newton’sMethodGraphicallySymbolically

ApplicationsZeroesoffunctionsRootsofequationsConvergence

Flaws(lackof)convergenceconvergencetowhat?

Wow

Page 22: Lesson 23: Newton's Method

. . . . . .

Squareroots

ExampleUseNewton’smethodtoextract

√2.

SolutionThisisthesameastheBSRE!

Page 23: Lesson 23: Newton's Method

. . . . . .

Squareroots

ExampleUseNewton’smethodtoextract

√2.

SolutionThisisthesameastheBSRE!

Page 24: Lesson 23: Newton's Method

. . . . . .

A cubic

ExampleFindthezeroesof

y = x3 − 3x2 + 2x + 0.3

Use VANDER toexperiment.

Page 25: Lesson 23: Newton's Method

. . . . . .

A cubic

ExampleFindthezeroesof

y = x3 − 3x2 + 2x + 0.3

Use VANDER toexperiment.

Page 26: Lesson 23: Newton's Method

. . . . . .

Rootsofequations

ExampleUseNewton’smethodtofindanumericalsolutiontotheequation

cos(x) = x

SolutionRewritetheequationsothat cos x− x = 0, andapplyNewton’sMethodtothefunction f(x) = cos x− x.

Page 27: Lesson 23: Newton's Method

. . . . . .

Rootsofequations

ExampleUseNewton’smethodtofindanumericalsolutiontotheequation

cos(x) = x

SolutionRewritetheequationsothat cos x− x = 0, andapplyNewton’sMethodtothefunction f(x) = cos x− x.

Page 28: Lesson 23: Newton's Method

. . . . . .

Applications

◮ Themethodofbisectioncanfindrootswithconvergencelike 2−n

◮ Newton’smethodcanfindrootswithconvergencelike 2−2n

Page 29: Lesson 23: Newton's Method

. . . . . .

Outline

Lasttime

Introduction

Newton’sMethodGraphicallySymbolically

ApplicationsZeroesoffunctionsRootsofequationsConvergence

Flaws(lackof)convergenceconvergencetowhat?

Wow

Page 30: Lesson 23: Newton's Method

. . . . . .

(lackof)convergence

ExampleUseNewton’smethodtofindthezeroof

f(x) =

{√x x ≥ 0

−√x x ≤ 0

SinceNf(x) = −x

wejustcyclearoundtheroot.

Page 31: Lesson 23: Newton's Method

. . . . . .

(lackof)convergence

ExampleUseNewton’smethodtofindthezeroof

f(x) =

{√x x ≥ 0

−√x x ≤ 0

SinceNf(x) = −x

wejustcyclearoundtheroot.

Page 32: Lesson 23: Newton's Method

. . . . . .

UseNewton’smethodtofindthezeroof

Example

f(x) = x1/3

SinceNf(x) = −2x

wedivergefromtheroot!

Page 33: Lesson 23: Newton's Method

. . . . . .

UseNewton’smethodtofindthezeroof

Example

f(x) = x1/3

SinceNf(x) = −2x

wedivergefromtheroot!

Page 34: Lesson 23: Newton's Method

. . . . . .

ExampleFindthezero(es)of

y = x3 − 3x2 + 2x + 0.4

A localminimumvalueclosetozerowillscrewupconvergence.

Page 35: Lesson 23: Newton's Method

. . . . . .

ExampleFindthezero(es)of

y = x3 − 3x2 + 2x + 0.4

A localminimumvalueclosetozerowillscrewupconvergence.

Page 36: Lesson 23: Newton's Method

. . . . . .

ExampleExperimentwiththefunction

f(x) = x3 − 3x2 + 2x + 0.3

Weseethatwedon’talwaysconvergetothenearestroot.

Page 37: Lesson 23: Newton's Method

. . . . . .

ExampleExperimentwiththefunction

f(x) = x3 − 3x2 + 2x + 0.3

Weseethatwedon’talwaysconvergetothenearestroot.

Page 38: Lesson 23: Newton's Method

. . . . . .

Outline

Lasttime

Introduction

Newton’sMethodGraphicallySymbolically

ApplicationsZeroesoffunctionsRootsofequationsConvergence

Flaws(lackof)convergenceconvergencetowhat?

Wow

Page 39: Lesson 23: Newton's Method

. . . . . .

◮ Wecanrepeatthismethodwith complex numbers◮ Thebasinsofattractionhavebeautifulstructure.◮ Trythe NewtonBasinGeneration applet