Lesson 23: Newton's Method

Preview:

DESCRIPTION

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

Citation preview

. . . . . .

Section4.8Newton’sMethod

Math1aIntroductiontoCalculus

April4, 2008

Announcements

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

. . . . . .

Announcements

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

. . . . . .

Outline

Lasttime

Introduction

Newton’sMethodGraphicallySymbolically

ApplicationsZeroesoffunctionsRootsofequationsConvergence

Flaws(lackof)convergenceconvergencetowhat?

Wow

. . . . . .

Lasttime: Economics

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

◮ Atthepointofminimalaveragecost, averagecostisequaltomarginalcost

◮ Atthepointofmaximumprofit, marginalrevenueisequaltomarginalcost

. . . . . .

Outline

Lasttime

Introduction

Newton’sMethodGraphicallySymbolically

ApplicationsZeroesoffunctionsRootsofequationsConvergence

Flaws(lackof)convergenceconvergencetowhat?

Wow

. . . . . .

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

. . . . . .

BSRE inaction

Trytofind√2.

Iteration Guess0 1.00000000001 1.5000000002 1.4166666673 1.4142156864 1.4142135625 1.414213562

. . . . . .

BSRE inaction

Trytofind√2.

Iteration Guess0 1.00000000001 1.5000000002 1.4166666673 1.4142156864 1.4142135625 1.414213562

. . . . . .

◮ Numericalmethodsforsolvingequationsareusefulinthe“realworld.”

◮ Newton’smethodisageneralizablemethodfordoingso.

. . . . . .

Outline

Lasttime

Introduction

Newton’sMethodGraphicallySymbolically

ApplicationsZeroesoffunctionsRootsofequationsConvergence

Flaws(lackof)convergenceconvergencetowhat?

Wow

. . . . . .

TheProblem

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

. . . . . .

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

. . . . . .

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

. . . . . .

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

. . . . . .

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

. . . . . .

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

. . . . . .

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

. . . . . .

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.

. . . . . .

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.

. . . . . .

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.

. . . . . .

Outline

Lasttime

Introduction

Newton’sMethodGraphicallySymbolically

ApplicationsZeroesoffunctionsRootsofequationsConvergence

Flaws(lackof)convergenceconvergencetowhat?

Wow

. . . . . .

Squareroots

ExampleUseNewton’smethodtoextract

√2.

SolutionThisisthesameastheBSRE!

. . . . . .

Squareroots

ExampleUseNewton’smethodtoextract

√2.

SolutionThisisthesameastheBSRE!

. . . . . .

A cubic

ExampleFindthezeroesof

y = x3 − 3x2 + 2x + 0.3

Use VANDER toexperiment.

. . . . . .

A cubic

ExampleFindthezeroesof

y = x3 − 3x2 + 2x + 0.3

Use VANDER toexperiment.

. . . . . .

Rootsofequations

ExampleUseNewton’smethodtofindanumericalsolutiontotheequation

cos(x) = x

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

. . . . . .

Rootsofequations

ExampleUseNewton’smethodtofindanumericalsolutiontotheequation

cos(x) = x

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

. . . . . .

Applications

◮ Themethodofbisectioncanfindrootswithconvergencelike 2−n

◮ Newton’smethodcanfindrootswithconvergencelike 2−2n

. . . . . .

Outline

Lasttime

Introduction

Newton’sMethodGraphicallySymbolically

ApplicationsZeroesoffunctionsRootsofequationsConvergence

Flaws(lackof)convergenceconvergencetowhat?

Wow

. . . . . .

(lackof)convergence

ExampleUseNewton’smethodtofindthezeroof

f(x) =

{√x x ≥ 0

−√x x ≤ 0

SinceNf(x) = −x

wejustcyclearoundtheroot.

. . . . . .

(lackof)convergence

ExampleUseNewton’smethodtofindthezeroof

f(x) =

{√x x ≥ 0

−√x x ≤ 0

SinceNf(x) = −x

wejustcyclearoundtheroot.

. . . . . .

UseNewton’smethodtofindthezeroof

Example

f(x) = x1/3

SinceNf(x) = −2x

wedivergefromtheroot!

. . . . . .

UseNewton’smethodtofindthezeroof

Example

f(x) = x1/3

SinceNf(x) = −2x

wedivergefromtheroot!

. . . . . .

ExampleFindthezero(es)of

y = x3 − 3x2 + 2x + 0.4

A localminimumvalueclosetozerowillscrewupconvergence.

. . . . . .

ExampleFindthezero(es)of

y = x3 − 3x2 + 2x + 0.4

A localminimumvalueclosetozerowillscrewupconvergence.

. . . . . .

ExampleExperimentwiththefunction

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

Weseethatwedon’talwaysconvergetothenearestroot.

. . . . . .

ExampleExperimentwiththefunction

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

Weseethatwedon’talwaysconvergetothenearestroot.

. . . . . .

Outline

Lasttime

Introduction

Newton’sMethodGraphicallySymbolically

ApplicationsZeroesoffunctionsRootsofequationsConvergence

Flaws(lackof)convergenceconvergencetowhat?

Wow

. . . . . .

◮ Wecanrepeatthismethodwith complex numbers◮ Thebasinsofattractionhavebeautifulstructure.◮ Trythe NewtonBasinGeneration applet

Recommended