Movatterモバイル変換


[0]ホーム

URL:


Jump to content
WikibooksThe Free Textbook Project
Search

Calculus/Newton's Method

From Wikibooks, open books for an open world
<Calculus
← Extrema and Points of InflectionCalculusRelated Rates →
Newton's Method

Newton's Method (also called the Newton-Raphson method) is a recursive algorithm for approximating the root of a differentiable function. We know simple formulas for finding the roots of linear and quadratic equations, and there are also more complicated formulae for cubic and quartic equations. At one time it was hoped that there would be formulas found for equations of quintic and higher-degree, though it was later shown byNeils Henrik Abel that no such equations exist. The Newton-Raphson method is a method for approximating the roots of polynomial equations of any order. In fact the method works for any equation, polynomial or not, as long as the function is differentiable in a desired interval.

Newton's Method

Letf(x){\displaystyle f(x)} be a differentiable function. Select a pointx0{\displaystyle x_{0}} based on a first approximation to the root, arbitrarily close to the function's root. To approximate the root you then recursively calculate using:

xn+1=xnf(xn)f(xn){\displaystyle x_{n+1}=x_{n}-{\frac {f(x_{n})}{f'(x_{n})}}}

As you recursively calculate, thexn+1{\displaystyle x_{n+1}}'s often become increasingly better approximations of the function's root.

In order to explain Newton's method, imagine thatx0{\displaystyle x_{0}} is already very close to a 0 off(x){\displaystyle f(x)} . We know that if we only look at points very close tox0{\displaystyle x_{0}} thenf(x){\displaystyle f(x)} looks like its tangent line. Ifx0{\displaystyle x_{0}} was already close to the place wheref(x){\displaystyle f(x)} was 0, and nearx0{\displaystyle x_{0}} we know thatf(x){\displaystyle f(x)} looks like its tangent line, then we hope the 0 of the tangent line atx0{\displaystyle x_{0}} is a better approximation thenx0{\displaystyle x_{0}} itself.

The equation for the tangent line tof(x){\displaystyle f(x)} atx0{\displaystyle x_{0}} is given by

y=f(x0)(xx0)+f(x0){\displaystyle y=f'(x_{0})\cdot (x-x_{0})+f(x_{0})}

Now we sety=0{\displaystyle y=0} and solve forx{\displaystyle x} .

0=f(x0)(xx0)+f(x0){\displaystyle 0=f'(x_{0})\cdot (x-x_{0})+f(x_{0})}
f(x0)=f(x0)(xx0){\displaystyle -f(x_{0})=f'(x_{0})\cdot (x-x_{0})}
f(x0)f(x0)=(xx0){\displaystyle {\frac {-f(x_{0})}{f'(x_{0})}}=(x-x_{0})}
x=f(x0)f(x0)+x0{\displaystyle x={\frac {-f(x_{0})}{f'(x_{0})}}+x_{0}}

This value ofx{\displaystyle x} we feel should be a better guess for the value ofx{\displaystyle x} wheref(x)=0{\displaystyle f(x)=0} . We choose to call this value ofx1{\displaystyle x_{1}} , and a little algebra we have

x1=x0f(x0)f(x0){\displaystyle x_{1}=x_{0}-{\frac {f(x_{0})}{f'(x_{0})}}}

If our intuition was correct andx1{\displaystyle x_{1}} is in fact a better approximation for the root off(x){\displaystyle f(x)} , then our logic should apply equally well atx1{\displaystyle x_{1}} . We could look to the place where the tangent line atx1{\displaystyle x_{1}} is zero. We callx2{\displaystyle x_{2}} , following the algebra above we arrive at the formula

x2=x1f(x1)f(x1){\displaystyle x_{2}=x_{1}-{\frac {f(x_{1})}{f'(x_{1})}}}

And we can continue in this way as long as we wish. At each step, if your current approximation isxn{\displaystyle x_{n}} our new approximation will bexn+1=xnf(xn)f(xn){\displaystyle x_{n+1}=x_{n}-{\frac {f(x_{n})}{f'(x_{n})}}} .

Examples

[edit |edit source]

Find the root of the functionf(x)=x2{\displaystyle f(x)=x^{2}}.

Figure 1: A few iterations of Newton's method applied toy=x2{\displaystyle y=x^{2}} starting withx0=4{\displaystyle x_{0}=4} . The blue curve isf(x){\displaystyle f(x)} . The other solid lines are the tangents at the various iteration points.

x0=4x1=x0f(x0)f(x0)=4168=2x2=x1f(x1)f(x1)=244=1x3=x2f(x2)f(x2)=112=12x4=x3f(x3)f(x3)=12141=14x5=x4f(x4)f(x4)=1411612=18x6=x5f(x5)f(x5)=1816414=116x7=x6f(x6)f(x6)=125618=132{\displaystyle {\begin{aligned}x_{0}&=&4\\x_{1}&=&x_{0}-{\frac {f(x_{0})}{f'(x_{0})}}=4-{\frac {16}{8}}=2\\x_{2}&=&x_{1}-{\frac {f(x_{1})}{f'(x_{1})}}=2-{\frac {4}{4}}=1\\x_{3}&=&x_{2}-{\frac {f(x_{2})}{f'(x_{2})}}=1-{\frac {1}{2}}={\frac {1}{2}}\\x_{4}&=&x_{3}-{\frac {f(x_{3})}{f'(x_{3})}}={\frac {1}{2}}-{\frac {\frac {1}{4}}{1}}={\frac {1}{4}}\\x_{5}&=&x_{4}-{\frac {f(x_{4})}{f'(x_{4})}}={\frac {1}{4}}-{\frac {\frac {1}{16}}{\frac {1}{2}}}={\frac {1}{8}}\\x_{6}&=&x_{5}-{\frac {f(x_{5})}{f'(x_{5})}}={\frac {1}{8}}-{\frac {\frac {1}{64}}{\frac {1}{4}}}={\frac {1}{16}}\\x_{7}&=&x_{6}-{\frac {f(x_{6})}{f'(x_{6})}}={\frac {\frac {1}{256}}{\frac {1}{8}}}={\frac {1}{32}}\end{aligned}}}

As you can seexn{\displaystyle x_{n}} is gradually approaching 0 (which we know is the root off(x){\displaystyle f(x)}) . One can approach the function's root with arbitrary accuracy.

Answer:f(x)=x2{\displaystyle f(x)=x^{2}} has a root atx=0{\displaystyle x=0}.

Notes

[edit |edit source]
Figure 2: Newton's method applied to the function
f(x)={x4,for x44x,for x<4{\displaystyle f(x)={\begin{cases}{\sqrt {x-4}},&{\text{for }}x\geq 4\\-{\sqrt {4-x}},&{\text{for }}x<4\end{cases}}}
starting withx0=2{\displaystyle x_{0}=2} .

This method fails whenf(x)=0{\displaystyle f'(x)=0} . In that case, one should choose a new starting place. Occasionally it may happen thatf(x)=0{\displaystyle f(x)=0} andf(x)=0{\displaystyle f'(x)=0} have a common root. To detect whether this is true, we should first find the solutions off(x)=0{\displaystyle f'(x)=0} , and then check the value off(x){\displaystyle f(x)} at these places.

Newton's method also may not converge for every function, take as an example:

f(x)={xr,for xrrx,for ,x<r{\displaystyle f(x)={\begin{cases}{\sqrt {x-r}},&{\text{for }}x\geq r\\-{\sqrt {r-x}},&{\text{for }},x<r\end{cases}}}

For this function choosing anyx1=rh{\displaystyle x_{1}=r-h} thenx2=r+h{\displaystyle x_{2}=r+h} would cause successive approximations to alternate back and forth, so no amount of iteration would get us any closer to the root than our first guess.

Figure 3: Newton's method, when applied to the functionf(x)=x5x+1{\displaystyle f(x)=x^{5}-x+1} with initial guessx0=0{\displaystyle x_{0}=0} , eventually iterates between the three points shown above.

Newton's method may also fail to converge on a root if the function has a local maximum or minimum that does not cross the x-axis. As an example, considerf(x)=x5x+1{\displaystyle f(x)=x^{5}-x+1} with initial guessx0=0{\displaystyle x_{0}=0} . In this case, Newton's method will be fooled by the function, which dips toward the x-axis but never crosses it in the vicinity of the initial guess.

See also

[edit |edit source]

Wikimedia Commons has media related to:Newton Method

← Extrema and Points of InflectionCalculusRelated Rates →
Newton's Method

Navigation:Main Page ·Precalculus ·Limits ·Differentiation ·Integration ·Parametric and Polar Equations ·Sequences and Series ·Multivariable Calculus ·Extensions ·References

Retrieved from "https://en.wikibooks.org/w/index.php?title=Calculus/Newton%27s_Method&oldid=3509962"
Categories:

[8]ページ先頭

©2009-2025 Movatter.jp