You are on page 1of 23

In numerca anayss, Newton's method (aso known as the NewtonRaphson

method), named after Isaac Newton and |oseph Raphson, s a method for
ndng successvey better approxmatons to the roots (or zeroes) of a rea-
vaued functon.
x : f(x) = 0 \,.
The NewtonRaphson method n one varabe s mpemented as foows:
Gven a functon | dened over the reas x, and ts dervatve |', we begn wth
a rst guess x0 for a root of the functon f. Provded the functon satses a
the assumptons made n the dervaton of the formua, a better
approxmaton x1 s
x_{1} = x_0 - \frac{f(x_0)}{f'(x_0)} \,.
Geometrcay, (x1, 0) s the ntersecton wth the x-axs of the tangent to the
graph of f at (x0, f (x0)).
The process s repeated as
x_{n+1} = x_n - \frac{f(x_n)}{f'(x_n)} \,
unt a sumcenty accurate vaue s reached.
Ths agorthm s rst n the cass of Househoder's methods, succeeded by
Haey's method. The method can aso be extended to compex functons and
to systems of equatons.The dea of the method s as foows: one starts wth
an nta guess whch s reasonaby cose to the true root, then the functon s
approxmated by ts tangent ne (whch can be computed usng the toos of
cacuus), and one computes the x-ntercept of ths tangent ne (whch s
easy done wth eementary agebra). Ths x-ntercept w typcay be a
better approxmaton to the functon's root than the orgna guess, and the
method can be terated.
Suppose | : |a, b| R s a dherentabe functon dened on the nterva |a, b|
wth vaues n the rea numbers R. The formua for convergng on the root can
be easy derved. Suppose we have some current approxmaton xn. Then we
can derve the formua for a better approxmaton, xn+1 by referrng to the
dagram on the rght. The equaton of the tangent ne to the curve y = |(x) at
the pont x=xn s
y = f'(x_n) \, (x-x_n) + f(x_n),
where, |' denotes the dervatve of the functon |.
The x-ntercept of ths ne (the vaue of x such that y=0) s then used as the
next approxmaton to the root, xn+1. In other words, settng y to zero and x
to xn+1 gves
0 = f'(x_n) \, (x_{n+1}-x_n) + f(x_n).
Sovng for xn+1 gves
x_{n+1} = x_n - \frac{f(x_n)}{f'(x_n)}. \,\!
We start the process oh wth some arbtrary nta vaue x0. (The coser to the
zero, the better. But, n the absence of any ntuton about where the zero
mght e, a "guess and check" method mght narrow the possbtes to a
reasonaby sma nterva by appeang to the ntermedate vaue theorem.)
The method w usuay converge, provded ths nta guess s cose enough
to the unknown zero, and that |'(x0) = 0. Furthermore, for a zero of
mutpcty 1, the convergence s at east quadratc (see rate of convergence)
n a neghbourhood of the zero, whch ntutvey means that the number of
correct dgts roughy at east doubes n every step. More detas can be
found n the anayss secton beow.
The Househoder's methods are smar but have hgher order for even faster
convergence. However, the extra computatons requred for each step can
sow down the overa performance reatve to Newton's method, partcuary
f f or ts dervatves are computatonay expensve to evauate.
Hstory|edt|
The name "Newton's method" s derved from Isaac Newton's descrpton of a
speca case of the method n De anays per aequatones numero termnorum
nntas (wrtten n 1669, pubshed n 1711 by Wam |ones) and n De
metods uxonum et sererum nntarum (wrtten n 1671, transated and
pubshed as Method of Fuxons n 1736 by |ohn Coson). However, hs
method dhers substantay from the modern method gven above: Newton
appes the method ony to poynomas. He does not compute the successve
approxmatons x_n, but computes a sequence of poynomas, and ony at
the end arrves at an approxmaton for the root x. Fnay, Newton vews the
method as purey agebrac and makes no menton of the connecton wth
cacuus. Newton may have derved hs method from a smar but ess precse
method by Veta. The essence of Veta's method can be found n the work of
the Persan mathematcan Sharaf a-Dn a-Tus, whe hs successor |amshd
a-Kash used a form of Newton's method to sove xP - N = 0 to nd roots of
N (Ypma 1995). A speca case of Newton's method for cacuatng square
roots was known much earer and s often caed the Babyonan method.
Newton's method was used by 17th-century |apanese mathematcan Sek
Kowa to sove snge-varabe equatons, though the connecton wth cacuus
was mssng.
Newton's method was rst pubshed n 1685 n A Treatse of Agebra both
Hstorca and Practca by |ohn Was. In 1690, |oseph Raphson pubshed a
smped descrpton n Anayss aequatonum unversas. Raphson agan
vewed Newton's method purey as an agebrac method and restrcted ts use
to poynomas, but he descrbes the method n terms of the successve
approxmatons xn nstead of the more compcated sequence of poynomas
used by Newton. Fnay, n 1740, Thomas Smpson descrbed Newton's
method as an teratve method for sovng genera nonnear equatons usng
cacuus, essentay gvng the descrpton above. In the same pubcaton,
Smpson aso gves the generazaton to systems of two equatons and notes
that Newton's method can be used for sovng optmzaton probems by
settng the gradent to zero.
Arthur Cayey n 1879 n The Newton-Fourer magnary probem was the rst
to notce the dmcutes n generazng Newton's method to compex roots of
poynomas wth degree greater than 2 and compex nta vaues. Ths
opened the way to the study of the theory of teratons of ratona functons.
Practca consderatons|edt|
Newton's method s an extremey powerfu technque-n genera the
convergence s quadratc: as the method converges on the root, the
dherence between the root and the approxmaton s squared (the number of
accurate dgts roughy doubes) at each step. However, there are some
dmcutes wth the method.
Dmcuty n cacuatng dervatve of a functon|edt|
Newton's method requres that the dervatve be cacuated drecty. An
anaytca expresson for the dervatve may not be easy obtanabe and
coud be expensve to evauate. In these stuatons, t may be approprate to
approxmate the dervatve by usng the sope of a ne through two nearby
ponts on the functon. Usng ths approxmaton woud resut n somethng
ke the secant method whose convergence s sower than that of Newton's
method.
Faure of the method to converge to the root|edt|
It s mportant to revew the proof of quadratc convergence of Newton's
Method before mpementng t. Speccay, one shoud revew the
assumptons made n the proof. For stuatons where the method fas to
converge, t s because the assumptons made n ths proof are not met.
Overshoot|edt|
If the rst dervatve s not we behaved n the neghborhood of a partcuar
root, the method may overshoot, and dverge from that root. An exampe of a
functon wth one root, for whch the dervatve s not we behaved n the
neghborhood of the root, s
f(x)=|x|a,\quad 0 < a < \tfrac{1}{2}
for whch the root w be overshot and the sequence of x w dverge. For a =
1/2, the root w st be overshot, but the sequence w oscate between two
vaues. For 1/2 < a < 1, the root w st be overshot but the sequence w
converge, and for a > 1 the root w not be overshot at a.
In some cases, Newton's method can be stabzed by usng successve over-
reaxaton, or the speed of convergence can be ncreased by usng the same
method.
Statonary pont|edt|
If a statonary pont of the functon s encountered, the dervatve s zero and
the method w termnate due to dvson by zero.
Poor nta estmate|edt|
A arge error n the nta estmate can contrbute to non-convergence of the
agorthm.
Mtgaton of non-convergence|edt|
In a robust mpementaton of Newton's method, t s common to pace mts
on the number of teratons, bound the souton to an nterva known to
contan the root, and combne the method wth a more robust root ndng
method.
Sow convergence for roots of mutpcty > 1|edt|
If the root beng sought has mutpcty greater than one, the convergence
rate s merey near (errors reduced by a constant factor at each step) uness
speca steps are taken. When there are two or more roots that are cose
together then t may take many teratons before the terates get cose
enough to one of them for the quadratc convergence to be apparent.
However, f the mutpcty m of the root s known, one can use the foowng
moded agorthm that preserves the quadratc convergence rate:
x_{n+1} = x_n - m\frac{f(x_n)}{f'(x_n)}. \,\! |1|
Ths s equvaent to usng successve over-reaxaton. On the other hand, f
the mutpcty m of the root s not known, t s possbe to estmate m after
carryng out one or two teratons, and then use that vaue to ncrease the
rate of convergence.
Anayss|edt|
Ths secton needs addtona ctatons for vercaton. Pease hep mprove
ths artce by addng ctatons to reabe sources. Unsourced matera may be
chaenged and removed. (February 2014)
Suppose that the functon | has a zero at o, .e., |(o) = 0.
If f s contnuousy dfferentabe and ts dervatve s nonzero at o, then there
exsts a neghborhood of o such that for a startng vaues x0 n that
neghborhood, the sequence {xn} w converge to o.|ctaton needed|
If the functon s contnuousy dfferentabe and ts dervatve s not 0 at o
and t has a second dervatve at o then the convergence s quadratc or
faster. If the second dervatve s not 0 at o then the convergence s merey
quadratc. If the thrd dervatve exsts and s bounded n a neghborhood of
o, then:
\Deta x_{+1} = \frac{f{\prme\prme} (\apha)}{2 f\prme (\apha)}
(\Deta x_{})2 + O|\Deta x_{}|3 \,,
where \Deta x_ \trangeq x_ - \apha \,.
If the dervatve s 0 at o, then the convergence s usuay ony near.
Specfcay, f | s twce contnuousy dfferentabe, | '(o) = 0 and | ''(o) = 0,
then there exsts a neghborhood of o such that for a startng vaues x0 n
that neghborhood, the sequence of terates converges neary, wth rate
og10 2 (S & Mayers, Exercse 1.6). Aternatvey f | '(o) = 0 and | '(x) = 0
for x = o, x n a neghborhood U of o, o beng a zero of mutpcty r, and f |
C Cr(U) then there exsts a neghborhood of o such that for a startng vaues
x0 n that neghborhood, the sequence of terates converges neary.
However, even near convergence s not guaranteed n pathoogca
stuatons.
In practce these resuts are oca, and the neghborhood of convergence s
not known n advance. But there are aso some resuts on goba
convergence: for nstance, gven a rght neghborhood U+ of o, f f s twce
dherentabe n U+ and f f' \ne 0 \!, f \cdot f'' > 0 \! n U+, then, for each x0
n U+ the sequence xk s monotoncay decreasng to o.
Proof of quadratc convergence for Newton's teratve method|edt|
Accordng to Tayor's theorem, any functon f(x) whch has a contnuous
second dervatve can be represented by an expanson about a pont that s
cose to a root of f(x). Suppose ths root s \apha \,. Then the expanson of
f(o) about xn s:
f(\apha) = f(x_n) + f\prme(x_n)(\apha - x_n) + R_1 \,




(1)
where the Lagrange form of the Tayor seres expanson remander s
R_1 = \frac{1}{2!}f{\prme\prme}(\x_n)(\apha - x_n){2} \,,
where n s n between xn and \apha \,.
Snce \apha \, s the root, (1) becomes:
0 = f(\apha) = f(x_n) + f\prme(x_n)(\apha - x_n) + \frac{1}
{2}f{\prme\prme}(\x_n)(\apha - x_n){2} \,




(2)
Dvdng equaton (2) by f\prme(x_n)\, and rearrangng gves
\frac {f(x_n)}{f\prme(x_n)}+\eft(\apha-x_n\rght) = \frac {-
f{\prme\prme} (\x_n)}{2 f\prme(x_n)}\eft(\apha-x_n\rght)2




(3)
Rememberng that xn+1 s dened by
x_{n+1} = x_{n} - \frac {f(x_n)}{f\prme(x_n)} \,,




(4)
one nds that
\underbrace{\apha - x_{n+1}}_{\epson_{n+1}} = \frac {-
f{\prme\prme} (\x_n)}{2 f\prme(x_n)} (\underbrace{\apha -
x_n}_{\epson_{n}})2 \,.
That s,
\epson_{n+1} = \frac {- f{\prme\prme} (\x_n)}{2 f\prme(x_n)} \,
{\epson_n}2 \,.




(5)
Takng absoute vaue of both sdes gves
\eft| {\epson_{n+1}}\rght| = \frac {\eft| f{\prme\prme} (\x_n) \rght| }
{2 \eft| f\prme(x_n) \rght|} \, {\epson_n}2 \,




(6)
Equaton (6) shows that the rate of convergence s quadratc f the foowng
condtons are satsed:
f'(x)\ne0; \fora x\n I \text{, where }I \text{ s the nterva }|\apha-
r,\apha+r| \text{ for some } r \ge \eft\vert(\apha-x_0)\rght\vert;\,
f''(x) \text{ s nte },\fora x\n I; \,
x_0 \, sumcenty cose to the root \apha \,
The term sumcenty cose n ths context means the foowng:
(a) Tayor approxmaton s accurate enough such that we can gnore hgher
order terms,
(b) \frac 1 {2}\eft |{\frac {f{\prme\prme} (x_n)}{f\prme(x_n)}}\rght |
<C\eft |{\frac {f{\prme\prme} (\apha)}{f\prme(\apha)}}\rght |, \text{
for some } C<\nfty,\,
(c) C \eft |{\frac {f{\prme\prme} (\apha)}{f\prme(\apha)}}\rght
|\epson_n<1, \text{ for }n\n \Zeta +\cup\{0\} \text{ and }C
\text{ satsfyng condton (b) }.\,
Fnay, (6) can be expressed n the foowng way:
\eft | {\epson_{n+1}}\rght | \e M{{\epson}_n}2 \,
where M s the supremum of the varabe coemcent of {\epson_n}2 \, on
the nterva I\, dened n the condton 1, that s:
M = \sup_{x \n I} \frac 1 {2}\eft |{\frac {f{\prme\prme} (x)}
{f\prme(x)}}\rght |. \,
The nta pont x_0 \, has to be chosen such that condtons 1 through 3 are
satsed, where the thrd condton requres that M\eft |\epson_0 \rght |<1.\,
Basns of attracton|edt|
The basns of attracton-the regons of the rea number ne such that wthn
each regon teraton from any pont eads to one partcuar root-can be
nnte n number and arbtrary sma. For exampe,|2| for the functon
f(x)=x3-2x2-11x+12, the foowng nta condtons are n successve
basns of attracton:
2.35287527 converges to 4;
2.35284172 converges to -3;
2.35283735 converges to 4;
2.352836327 converges to -3;
2.352836323 converges to 1.
Faure anayss|edt|
Newton's method s ony guaranteed to converge f certan condtons are
satsed. If the assumptons made n the proof of quadratc convergence are
met, the method w converge. For the foowng subsectons, faure of the
method to converge ndcates that the assumptons made n the proof were
not met.
Bad startng ponts|edt|
In some cases the condtons on the functon that are necessary for
convergence are satsed, but the pont chosen as the nta pont s not n
the nterva where the method converges. Ths can happen, for exampe, f
the functon whose root s sought approaches zero asymptotcay as x goes
to \nfty or - \nfty. In such cases a dherent method, such as bsecton, shoud
be used to obtan a better estmate for the zero to use as an nta pont.
Iteraton pont s statonary|edt|
Consder the functon:
f(x) = 1-x2.\!
It has a maxmum at x = 0 and soutons of f(x) = 0 at x = 1. If we start
teratng from the statonary pont x0 = 0 (where the dervatve s zero), x1
w be undened, snce the tangent at (0,1) s parae to the x-axs:
x_1 = x_0 - \frac{f(x_0)}{f'(x_0)} = 0 - \frac{1}{0}.
The same ssue occurs f, nstead of the startng pont, any teraton pont s
statonary. Even f the dervatve s sma but not zero, the next teraton w
be a far worse approxmaton.
Startng pont enters a cyce|edt|
The tangent nes of x3 - 2x + 2 at 0 and 1 ntersect the x-axs at 1 and 0
respectvey, ustratng why Newton's method oscates between these
vaues for some startng ponts.
For some functons, some startng ponts may enter an nnte cyce,
preventng convergence. Let
f(x) = x3 - 2x + 2 \!
and take 0 as the startng pont. The rst teraton produces 1 and the second
teraton returns to 0 so the sequence w aternate between the two wthout
convergng to a root. In fact, ths 2-cyce s stabe: there are neghborhoods
around 0 and around 1 from whch a ponts terate asymptotcay to the 2-
cyce (and hence not to the root of the functon). In genera, the behavor of
the sequence can be very compex (see Newton fracta).
Dervatve ssues|edt|
If the functon s not contnuousy dherentabe n a neghborhood of the root
then t s possbe that Newton's method w aways dverge and fa, uness
the souton s guessed on the rst try.
Dervatve does not exst at root|edt|
A smpe exampe of a functon where Newton's method dverges s the cube
root, whch s contnuous and nntey dherentabe, except for x = 0, where
ts dervatve s undened (ths, however, does not ahect the agorthm, snce
t w never requre the dervatve f the souton s aready found):
f(x) = \sqrt|3|{x}.
For any teraton pont xn, the next teraton pont w be:
x_{n+1} = x_n - \frac{f(x_n)}{f'(x_n)} = x_n - \frac{{x_n}{\frac{1}{3}}}
{\frac{1}{3}\,{x_n}{\frac{1}{3}-1}} = x_n - 3\,x_n = -2\,x_n.
The agorthm overshoots the souton and ands on the other sde of the y-
axs, farther away than t ntay was; appyng Newton's method actuay
doubes the dstances from the souton at each teraton.
In fact, the teratons dverge to nnty for every f(x) = |x|\apha, where 0 <
\apha < \tfrac{1}{2}. In the mtng case of \apha = \tfrac{1}{2} (square
root), the teratons w aternate ndentey between ponts x0 and -x0, so
they do not converge n ths case ether.
Dscontnuous dervatve|edt|
If the dervatve s not contnuous at the root, then convergence may fa to
occur n any neghborhood of the root. Consder the functon
f(x) = \begn{cases}
0 & \text{f } x = 0,\\
x + x2\sn\eft(\frac{2}{x}\rght) & \text{f } x \neq 0.
\end{cases}
Its dervatve s:
f'(x) = \begn{cases}
1 & \text{f } x = 0,\\
1 + 2\,x\,\sn\eft(\frac{2}{x}\rght) - 2\,\cos\eft(\frac{2}{x}\rght) &
\text{f } x \neq 0.
\end{cases}
Wthn any neghborhood of the root, ths dervatve keeps changng sgn as x
approaches 0 from the rght (or from the eft) whe f(x) > x - x2 > 0 for 0 <
x < 1.
So f(x)/f'(x) s unbounded near the root, and Newton's method w dverge
amost everywhere n any neghborhood of t, even though:
the functon s dherentabe (and thus contnuous) everywhere;
the dervatve at the root s nonzero;
f s nntey dherentabe except at the root; and
the dervatve s bounded n a neghborhood of the root (unke f(x)/f'(x)).
Non-quadratc convergence|edt|
In some cases the terates converge but do not converge as qucky as
promsed. In these cases smper methods converge |ust as qucky as
Newton's method.
Zero dervatve|edt|
If the rst dervatve s zero at the root, then convergence w not be
quadratc. Indeed, et
f(x) = x2 \!
then f'(x) = 2x \! and consequenty x - f(x)/f'(x) = x/2 \!. So convergence s
not quadratc, even though the functon s nntey dherentabe
everywhere.
Smar probems occur even when the root s ony "neary" doube. For
exampe, et
f(x) = x2(x-1000)+1.\!
Then the rst few terates startng at x0 = 1 are 1, 0.500250376,
0.251062828, 0.127507934, 0.067671976, 0.041224176, 0.032741218,
0.031642362; t takes sx teratons to reach a pont where the convergence
appears to be quadratc.
No second dervatve|edt|
If there s no second dervatve at the root, then convergence may fa to be
quadratc. Indeed, et
f(x) = x + x\frac{4}{3}.\!
Then
f'(x) = 1 + \frac{4}{3}x\frac{1}{3}.\!
And
f''(x) = \frac{4}{9}x{-\frac{2}{3}} \!
except when x = 0 \! where t s undened. Gven x_n \!,
x_{n+1} = x_n - \frac{f(x_n)}{f '(x_n)} = \frac{\frac{1}{3}{x_n}\frac{4}
{3}}{(1 + \frac{4}{3}{x_n}\frac{1}{3})} \!
whch has approxmatey 4/3 tmes as many bts of precson as x_n \! has.
Ths s ess than the 2 tmes as many whch woud be requred for quadratc
convergence. So the convergence of Newton's method (n ths case) s not
quadratc, even though: the functon s contnuousy dherentabe
everywhere; the dervatve s not zero at the root; and f \! s nntey
dherentabe except at the desred root.
Generazatons|edt|
Compex functons|edt|
Basns of attracton for x5 - 1 = 0; darker means more teratons to converge.
Man artce: Newton fracta
When deang wth compex functons, Newton's method can be drecty
apped to nd ther zeroes. Each zero has a basn of attracton n the compex
pane, the set of a startng vaues that cause the method to converge to that
partcuar zero. These sets can be mapped as n the mage shown. For many
compex functons, the boundares of the basns of attracton are fractas.
In some cases there are regons n the compex pane whch are not n any of
these basns of attracton, meanng the terates do not converge. For
exampe,|3| f one uses a rea nta condton to seek a root of x2+1, a
subsequent terates w be rea numbers and so the teratons cannot
converge to ether root, snce both roots are non-rea. In ths case amost a
rea nta condtons ead to chaotc behavor, whe some nta condtons
terate ether to nnty or to repeatng cyces of any nte ength.
Nonnear systems of equatons|edt|
k varabes, k functons|edt|
One may aso use Newton's method to sove systems of k (non-near)
equatons, whch amounts to ndng the zeroes of contnuousy dherentabe
functons F : Rk Rk. In the formuaton gven above, one then has to eft
mutpy wth the nverse of the k-by-k |acoban matrx |F(xn) nstead of
dvdng by f '(xn).
Rather than actuay computng the nverse of ths matrx, one can save tme
by sovng the system of near equatons
|_F(x_n) (x_{n+1} - x_n) = -F(x_n)\,\!
for the unknown xn+1 - xn.
k varabes, m equatons, wth m > k|edt|
The k-dmensona Newton's method can be used to sove systems of >k
(non-near) equatons as we f the agorthm uses the generazed nverse of
the non-square |acoban matrx |+ = ((|T|)-1)|T nstead of the nverse of |. If
the nonnear system has no souton, the method attempts to nd a souton
n the non-near east squares sense. See GaussNewton agorthm for more
nformaton.
Nonnear equatons n a Banach space|edt|
Another generazaton s Newton's method to nd a root of a functona F
dened n a Banach space. In ths case the formuaton s
X_{n+1}=X_n-|F{\prme}(X_n)|{-1}F(X_n),\,
where F{\prme}(X_n) s the Frchet dervatve computed at X_n. One needs
the Frchet dervatve to be boundedy nvertbe at each X_n n order for the
method to be appcabe. A condton for exstence of and convergence to a
root s gven by the NewtonKantorovch theorem.
Nonnear equatons over p-adc numbers|edt|
In p-adc anayss, the standard method to show a poynoma equaton n one
varabe has a p-adc root s Hense's emma, whch uses the recurson from
Newton's method on the p-adc numbers. Because of the more stabe
behavor of addton and mutpcaton n the p-adc numbers compared to
the rea numbers (speccay, the unt ba n the p-adcs s a rng),
convergence n Hense's emma can be guaranteed under much smper
hypotheses than n the cassca Newton's method on the rea ne.
Newton-Fourer method|edt|
Assume that f(x) s twce contnuousy dherentabe on |a, b| and that f
contans a root n ths nterva. Assume that f'(x) f''(x) \neq 0 on ths nterva
(ths s the case for nstance f f(a) < 0, f(b) > 0, and f'(x) > 0, and f''(x) > 0
on ths nterva). Ths guarantees that there s a unque root on ths nterva,
ca t \apha. If t s concave down nstead of concave up then repace f(x) by
-f(x) snce they have the same roots.
Let x_0 = b be the rght endpont of the nterva and et z_0 = a be the eft
endpont of the nterva. Gven x_n, dene x_{n + 1} = x_n - \frac{f(x_n)}
{f'(x_n)}, whch s |ust Newton's method as before. Then dene z_{n + 1} =
z_n - \frac{f(z_n)}{f'(x_n)} and note that the denomnator has f'(x_n) and not
f'(z_n). The terates x_n w be strcty decreasng to the root whe the
terates z_n w be strcty ncreasng to the root. Aso, \m_{n\to \nfty}
\frac{x_{n + 1} - z_{n + 1}}{(x_n - z_n)2} = \frac{f''(\apha)}{2f'(\apha)}
so that dstance between x_n and z_n decreases quadratcay.
Ouas-Newton methods|edt|
When the |acoban s unavaabe or too expensve to compute at every
teraton, a Ouas-Newton_method can be used.
Appcatons|edt|
Mnmzaton and maxmzaton probems|edt|
Man artce: Newton's method n optmzaton
Newton's method can be used to nd a mnmum or maxmum of a functon.
The dervatve s zero at a mnmum or maxmum, so mnma and maxma
can be found by appyng Newton's method to the dervatve. The teraton
becomes:
x_{n+1} = x_n - \frac{f'(x_n)}{f''(x_n)}. \,\!
Mutpcatve nverses of numbers and power seres|edt|
An mportant appcaton s NewtonRaphson dvson, whch can be used to
qucky nd the recproca of a number, usng ony mutpcaton and
subtracton.
Fndng the recproca of a amounts to ndng the root of the functon
f(x)=a-\frac{1}{x}
Newton's teraton s
\begn{agn}
x_{n+1}&=x_n-\frac{f(x_n)}{f'(x_n)}\\
&=x_n-\frac{a-\frac{1}{x_n}}{\frac{1}{x_n2}}\\
&=x_n\,(2-ax_n)
\end{agn}
Therefore, Newton's teraton needs ony two mutpcatons and one
subtracton.
Ths method s aso very emcent to compute the mutpcatve nverse of a
power seres.
Sovng transcendenta equatons|edt|
Many transcendenta equatons can be soved usng Newton's method. Gven
the equaton
g(x) = h(x), \,\!
wth g(x) and/or h(x) a transcendenta functon, one wrtes
f(x) = g(x) - h(x). \,\!
The vaues of x that soves the orgna equaton are then the roots of f(x),
whch may be found va Newton's method.
Exampes|edt|
Square root of a number|edt|
Consder the probem of ndng the square root of a number. Newton's
method s one of many methods of computng square roots.
For exampe, f one wshes to nd the square root of 612, ths s equvaent to
ndng the souton to
\,x2 = 612
The functon to use n Newton's method s then,
\,f(x) = x2 - 612
wth dervatve,
f'(x) = 2x. \,
Wth an nta guess of 10, the sequence gven by Newton's method s
\begn{matrx}
x_1 & = & x_0 - \dfrac{f(x_0)}{f'(x_0)} & = & 10 - \dfrac{102 - 612}{2
\cdot 10} & = & 35.6 \quad\quad\quad{} \\
x_2 & = & x_1 - \dfrac{f(x_1)}{f'(x_1)} & = & 35.6 - \dfrac{35.62 - 612}{2
\cdot 35.6} & = & \underne{2}6.395505617978\dots \\
x_3 & = & \vdots & = & \vdots & = & \underne{24.7}90635492455\dots \\
x_4 & = & \vdots & = & \vdots & = & \underne{24.7386}88294075\dots \\
x_5 & = & \vdots & = & \vdots & = & \underne{24.7386337537}67\dots
\end{matrx}
Where the correct dgts are underned. Wth ony a few teratons one can
obtan a souton accurate to many decma paces.
Souton of cos(x) = x3|edt|
Consder the probem of ndng the postve number x wth cos(x) = x3. We
can rephrase that as ndng the zero of f(x) = cos(x) - x3. We have f'(x) =
-sn(x) - 3x2. Snce cos(x) 1 for a x and x3 > 1 for x > 1, we know that
our souton es between 0 and 1. We try a startng vaue of x0 = 0.5. (Note
that a startng vaue of 0 w ead to an undened resut, showng the
mportance of usng a startng pont that s cose to the souton.)
\begn{matrx}
x_1 & = & x_0 - \dfrac{f(x_0)}{f'(x_0)} & = & 0.5 - \dfrac{\cos(0.5) -
(0.5)3}{-\sn(0.5) - 3(0.5)2} & = & 1.112141637097 \\
x_2 & = & x_1 - \dfrac{f(x_1)}{f'(x_1)} & = & \vdots & = &
\underne{0.}909672693736 \\
x_3 & = & \vdots & = & \vdots & = & \underne{0.86}7263818209 \\
x_4 & = & \vdots & = & \vdots & = & \underne{0.86547}7135298 \\
x_5 & = & \vdots & = & \vdots & = & \underne{0.8654740331}11 \\
x_6 & = & \vdots &= & \vdots & = & \underne{0.865474033102}
\end{matrx}
The correct dgts are underned n the above exampe. In partcuar, x6 s
correct to the number of decma paces gven. We see that the number of
correct dgts after the decma pont ncreases from 2 (for x3) to 5 and 10,
ustratng the quadratc convergence.
Pseudocode|edt|
The foowng s an exampe of usng the Newton's Method to hep nd a root
of a functon f whch has dervatve fprme.
The nta guess w be x_0 = 1 and the functon w be f(x) = x2 - 2 so that
f'(x) = 2x.
Each new teratve of Newton's method w be denoted by x1. We w check
durng the computaton whether the denomnator (yprme) becomes too
sma (smaer than epson), whch woud be the case f f'(x_n) \approx 0,
snce otherwse a arge amount of error coud be ntroduced.
%These choces depend on the probem beng soved
x0 = 1 %The nta vaue
f = @(x) x2 - 2 %The functon whose root we are tryng to nd
fprme = @(x) 2*x %The dervatve of f(x)
toerance = 10(-7) %7 dgt accuracy s desred
epson = 10(-14) %Don't want to dvde by a number smaer than
ths

maxIteratons = 20 %Don't aow the teratons to contnue ndentey
haveWeFoundSouton = fase %Were we abe to nd the souton to the
desred toerance? not yet.

for = 1 : maxIteratons

y = f(x0)
yprme = fprme(x0)

f(abs(yprme) < epson) %Don't want to dvde by too
sma of a number
fprntf('WARNING: denomnator s too sma\n')
break; %Leave the oop
end

x1 = x0 - y/yprme %Do Newton's computaton

f(abs(x1 - x0)/abs(x1) < toerance) %If the resut s wthn the
desred toerance
haveWeFoundSouton = true
break; %Done, so eave the oop
end

x0 = x1 %Update x0 to start the process agan

end

f (haveWeFoundSouton) % We found a souton wthn toerance and
maxmum number of teratons
fprntf('The root s: %f\n', x1);
ese %If we weren't abe to nd a souton to wthn the desred toerance
fprntf('Warnng: Not abe to nd souton to wthn the desred toerance of
%f\n', toerance);
fprntf('The ast computed approxmate root was %f\n', x1)
end

You might also like