Newton's Method

DOWNLOAD Mathematica Notebook EXPLORE THIS TOPIC IN the MathWorld Classroom

Newton's method, also called the Newton-Raphson method, is a root-finding algorithm that uses the first few terms of the Taylor series of a function f(x) in the vicinity of a suspected root. Newton's method is sometimes also known as Newton's iteration, although in this work the latter term is reserved to the application of Newton's method for computing square roots.

For f(x) a polynomial, Newton's method is essentially the same as Horner's method.

The Taylor series of f(x) about the point x=x_0+epsilon is given by

 f(x_0+epsilon)=f(x_0)+f^'(x_0)epsilon+1/2f^('')(x_0)epsilon^2+....
(1)

Keeping terms only to first order,

 f(x_0+epsilon) approx f(x_0)+f^'(x_0)epsilon.
(2)

Equation (2) is the equation of the tangent line to the curve at (x_0,f(x_0)), so (x_1,0) is the place where that tangent line intersects the x-axis. A graph can therefore give a good intuitive idea of why Newton's method works at a well-chosen starting point and why it might diverge with a poorly-chosen starting point.

This expression above can be used to estimate the amount of offset epsilon needed to land closer to the root starting from an initial guess x_0. Setting f(x_0+epsilon)=0 and solving (2) for epsilon=epsilon_0 gives

 epsilon_0=-(f(x_0))/(f^'(x_0)),
(3)

which is the first-order adjustment to the root's position. By letting x_1=x_0+epsilon_0, calculating a new epsilon_1, and so on, the process can be repeated until it converges to a fixed point (which is precisely a root) using

 epsilon_n=-(f(x_n))/(f^'(x_n)).
(4)

Unfortunately, this procedure can be unstable near a horizontal asymptote or a local extremum. However, with a good initial choice of the root's position, the algorithm can be applied iteratively to obtain

 x_(n+1)=x_n-(f(x_n))/(f^'(x_n))
(5)

for n=1, 2, 3, .... An initial point x_0 that provides safe convergence of Newton's method is called an approximate zero.

Newton's method can be implemented in the Wolfram Language as

  NewtonsMethodList[f_, {x_, x0_}, n_] :=
    NestList[# - Function[x, f][#]/
      Derivative[1][Function[x, f]][#]& , x0, n]

Assume that Newton's iteration x_(k+1) converges toward x^* with f^'(x^*)!=0, and define the error after the kth step by

 x_k=x^*+epsilon_k.
(6)

Expanding f(x_k) about x^* gives

f(x_k)=f(x^*)+f^'(x^*)epsilon_k+1/2f^('')(x^*)epsilon_k^2+...
(7)
=f^'(x^*)epsilon_k+1/2f^('')(x^*)epsilon_k^2+...
(8)
f^'(x_k)=f^'(x^*)+f^('')(x^*)epsilon_k+....
(9)

But

epsilon_(k+1)=epsilon_k+(x_(k+1)-x_k)
(10)
=epsilon_k-(f(x_k))/(f^'(x_k))
(11)
 approx epsilon_k-(f^'(x^*)epsilon_k+1/2f^('')(x^*)epsilon_k^2)/(f^'(x^*)+f^('')(x^*)epsilon_k).
(12)

Taking the second-order expansion

 (aepsilon+1/2bepsilon^2+cepsilon^3)/(a+bepsilon+depsilon^2) approx epsilon-b/(2a)epsilon^2
(13)

gives

 epsilon_(k+1) approx (f^('')(x^*))/(2f^'(x^*))epsilon_k^2.
(14)

Therefore, when the method converges, it does so quadratically.

NewtonsMethodBasins

Applying Newton's method to the roots of any polynomial of degree two or higher yields a rational map of C, and the Julia set of this map is a fractal whenever there are three or more distinct roots. Iterating the method for the roots of z^n-1=0 with starting point z_0 gives

 z_(i+1)=z_i-(z_i^n-1)/(nz_i^(n-1))
(15)

(Mandelbrot 1983, Gleick 1988, Peitgen and Saupe 1988, Press et al. 1992, Dickau 1997). Since this is an nth order polynomial, there are n roots to which the algorithm can converge. Coloring the basin of attraction (the set of initial points z_0 that converge to the same root) for each root a different color then gives the above plots.

NewtonsMethodCross

Fractals typically arise from non-polynomial maps as well. The plot above shows the number of iterations needed for Newton's method to converge for the function z^2-2^z (D. Cross, pers. comm., Jan. 10, 2005) and z^3-3^z.

Wolfram Web Resources

Mathematica »

The #1 tool for creating Demonstrations and anything technical.

Wolfram|Alpha »

Explore anything with the first computational knowledge engine.

Wolfram Demonstrations Project »

Explore thousands of free applications across science, mathematics, engineering, technology, business, art, finance, social sciences, and more.

Computerbasedmath.org »

Join the initiative for modernizing math education.

Online Integral Calculator »

Solve integrals with Wolfram|Alpha.

Step-by-step Solutions »

Walk through homework problems step-by-step from beginning to end. Hints help you try the next step on your own.

Wolfram Problem Generator »

Unlimited random practice problems and answers with built-in Step-by-step solutions. Practice online or make a printable study sheet.

Wolfram Education Portal »

Collection of teaching and learning tools built by Wolfram education experts: dynamic textbook, lesson plans, widgets, interactive Demonstrations, and more.

Wolfram Language »

Knowledge-based programming for everyone.