Newton's method

From Wikipedia, the free encyclopedia
  (Redirected from Newton-Raphson)
Jump to: navigation, search



The method starts with a function f defined over the real numbers x, the function's derivative f ′, and an initial guess x0 for a root of the function f. If the function satisfies the assumptions made in the derivation of the formula and the initial guess is close, then a better approximation x1 is

Geometrically, (x1, 0) is the intersection of the x-axis and the tangent of the graph of f at (x0, f (x0)).

The process is repeated as

until a sufficiently accurate value is reached.





Suppose f : [a, b] → is a differentiable function defined on the interval [a, b] with values in the real numbers . The formula for converging on the root can be easily derived. Suppose we have some current approximation xn. Then we can derive the formula for a better approximation, xn + 1 by referring to the diagram on the right. The equation of the tangent line to the curve y = f (x) at the point x = xn is

where f′ denotes the derivative of the function f.


Solving for xn + 1 gives








Practical considerations[edit]


Difficulty in calculating derivative of a function[edit]


Failure of the method to converge to the root[edit]






Stationary point[edit]


Poor initial estimate[edit]

A large error in the initial estimate can contribute to non-convergence of the algorithm. To overcome this problem one can often linearise the function that is being optimized using calculus, logs, differentials, or even using evolutionary algorithms, such as the Stochastic Funnel Algorithm. Good initial estimates lie close to the final globally optimal parameter estimate. In nonlinear regression the SSE equation is only "close to" parabolic in the region of the final parameter estimates. Initial estimates found here will allow the Newton-Raphson method to quickly converge. It is only here that the Hessian of the SSE is positive and the first derivative of the SSE is close to zero.

Mitigation of non-convergence[edit]


Slow convergence for roots of multiplicity greater than 1[edit]


This is equivalent to using successive over-relaxation. On the other hand, if the multiplicity m of the root is not known, it is possible to estimate after carrying out one or two iterations, and then use that value to increase the rate of convergence.


Suppose that the function f has a zero at α, i.e., f (α) = 0, and f is differentiable in a neighborhood of α.




If the derivative is 0 at α, then the convergence is usually only linear. Specifically, if f is twice continuously differentiable, f ′(α) = 0 and f ″(α) ≠ 0, then there exists a neighborhood of α such that for all starting values x0 in that neighborhood, the sequence of iterates converges linearly, with rate log10 2.[3] Alternatively if f ′(α) = 0 and f ′(x) ≠ 0 for x ≠ α, x in a neighborhood U of α, α being a zero of multiplicity r, and if fCr(U) then there exists a neighborhood of α such that for all starting values x0 in that neighborhood, the sequence of iterates converges linearly.

However, even linear convergence is not guaranteed in pathological situations.

In practice these results are local, and the neighborhood of convergence is not known in advance. But there are also some results on global convergence: for instance, given a right neighborhood U+ of α, if f is twice differentiable in U+ and if f ′ ≠ 0, f · f ″ > 0 in U+, then, for each x0 in U+ the sequence xk is monotonically decreasing to α.

Proof of quadratic convergence for Newton's iterative method[edit]

According to Taylor's theorem, any function f (x) which has a continuous second derivative can be represented by an expansion about a point that is close to a root of f (x). Suppose this root is α. Then the expansion of f (α) about xn is:






where the Lagrange form of the Taylor series expansion remainder is

where ξn is in between xn and α.

Since α is the root, (1) becomes:






Dividing equation (2) by f ′(xn) and rearranging gives






Remembering that xn + 1 is defined by






one finds that

That is,






Taking absolute value of both sides gives







  1. f ′(x) ≠ 0; for all xI, where I is the interval [αr, α + r] for some r ≥ | αx0 |;
  2. f ″(x) is continuous, for all xI;
  3. x0 sufficiently close to the root α.

The term sufficiently close in this context means the following:

  1. Taylor approximation is accurate enough such that we can ignore higher order terms;
  2. for some C < ∞;
  3. for n, n ≥ 0 and C satisfying condition b.


where M is the supremum of the variable coefficient of εn2 on the interval I defined in condition 1, that is:

The initial point x0 has to be chosen such that conditions 1 to 3 are satisfied, where the third condition requires that M | ε0 | < 1.

Basins of attraction[edit]

The basins of attraction—the regions of the real number line such that within each region iteration from any point leads to one particular root—can be infinite in number and arbitrarily small. For example,[4] for the function f (x) = x3 − 2x2 − 11x + 12 = (x − 4)(x − 1)(x + 3), the following initial conditions are in successive basins of attraction:

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.

Failure analysis[edit]


Bad starting points[edit]


Iteration point is stationary[edit]

Consider the function:



Starting point enters a cycle[edit]

The tangent lines of x3 − 2x + 2 at 0 and 1 intersect the x-axis at 1 and 0 respectively, illustrating why Newton's method oscillates between these values for some starting points.



Derivative issues[edit]


Derivative does not exist at root[edit]

A simple example of a function where Newton's method diverges is trying to find the cube root of zero. The cube root is continuous and infinitely differentiable, except for x = 0, where its derivative is undefined:



In fact, the iterations diverge to infinity for every f (x) = | x |α, where 0 < α < 1/2. In the limiting case of α = 1/2 (square root), the iterations will alternate indefinitely between points x0 and x0, so they do not converge in this case either.

Discontinuous derivative[edit]


Its derivative is:

Within any neighborhood of the root, this derivative keeps changing sign as x approaches 0 from the right (or from the left) while f (x) ≥ xx2 > 0 for 0 < x < 1.

So f (x)/f ′(x) is unbounded near the root, and Newton's method will diverge almost everywhere in any neighborhood of it, even though:

  • the function is differentiable (and thus continuous) everywhere;
  • the derivative at the root is nonzero;
  • f is infinitely differentiable except at the root; and
  • the derivative is bounded in a neighborhood of the root (unlike f (x)/f ′(x)).

Non-quadratic convergence[edit]


Zero derivative[edit]


then f ′(x) = 2x and consequently



Then the first few iterations starting at x0 = 1 are

x0 = 1
x1 = 0.500250376
x2 = 0.251062828
x3 = 0.127507934
x4 = 0.067671976
x5 = 0.041224176
x6 = 0.032741218
x7 = 0.031642362


No second derivative[edit]




except when x = 0 where it is undefined. Given xn,

which has approximately 4/3 times as many bits of precision as xn has. This is less than the 2 times as many which would be required for quadratic convergence. So the convergence of Newton's method (in this case) is not quadratic, even though: the function is continuously differentiable everywhere; the derivative is not zero at the root; and f is infinitely differentiable except at the desired root.


Complex functions[edit]

Basins of attraction for x5 − 1 = 0; darker means more iterations to converge.
Main article: Newton fractal


In some cases there are regions in the complex plane which are not in any of these basins of attraction, meaning the iterates do not converge. For example,[5] if one uses a real initial condition to seek a root of x2 + 1, all subsequent iterates will be real numbers and so the iterations cannot converge to either root, since both roots are non-real. In this case almost all real initial conditions lead to chaotic behavior, while some initial conditions iterate either to infinity or to repeating cycles of any finite length.

Curt McMullen has shown that for any possible purely iterative algorithm similar to Newton's Method, the algorithm will diverge on some open regions of the complex plane when applied to some polynomial of degree 4 or higher. However, McMullen gave a generally convergent algorithm for polynomials of degree 3.[6]

Nonlinear systems of equations[edit]

k variables, k functions[edit]

One may also use Newton's method to solve systems of k (nonlinear) equations, which amounts to finding the zeroes of continuously differentiable functions F : kk. In the formulation given above, one then has to left multiply with the inverse of the k × k Jacobian matrix JF(xn) instead of dividing by f ′(xn).


for the unknown xn + 1xn.


The k-dimensional variant of Newton's method can be used to solve systems of greater than k (nonlinear) equations as well if the algorithm uses the generalized inverse of the non-square Jacobian matrix J+ = (JTJ)−1JT instead of the inverse of J. If the nonlinear system has no solution, the method attempts to find a solution in the non-linear least squares sense. See Gauss–Newton algorithm for more information.

Nonlinear equations in a Banach space[edit]


where F′(Xn) is the Fréchet derivative computed at Xn. One needs the Fréchet derivative to be boundedly invertible at each Xn in order for the method to be applicable. A condition for existence of and convergence to a root is given by the Newton–Kantorovich theorem.

Nonlinear equations over p-adic numbers[edit]


Newton–Fourier method[edit]


Assume that f (x) is twice continuously differentiable on [a, b] and that f contains a root in this interval. Assume that f ′(x), f ″(x) ≠ 0 on this interval (this is the case for instance if f (a) < 0, f (b) > 0, and f ′(x) > 0, and f ″(x) > 0 on this interval). This guarantees that there is a unique root on this interval, call it α. If it is concave down instead of concave up then replace f (x) by f (x) since they have the same roots.

Let x0 = b be the right endpoint of the interval and let z0 = a be the left endpoint of the interval. Given xn, define

which is just Newton's method as before. Then define

where the denominator is f ′(xn) and not f ′(zn). The iterations xn will be strictly decreasing to the root while the iterations zn will be strictly increasing to the root. Also,

so that distance between xn and zn decreases quadratically.

Quasi-Newton methods[edit]

When the Jacobian is unavailable or too expensive to compute at every iteration, a quasi-Newton method can be used.


Minimization and maximization problems[edit]


Multiplicative inverses of numbers and power series[edit]



Newton's iteration is

Therefore, Newton's iteration needs only two multiplications and one subtraction.


Solving transcendental equations[edit]





Square root of a number[edit]



The function to use in Newton's method is then

with derivative



Solution of cos x = x3[edit]

Consider the problem of finding the positive number x with cos x = x3. We can rephrase that as finding the zero of f (x) = cos(x) − x3. We have f ′(x) = −sin(x) − 3x2. Since cos(x) ≤ 1 for all x and x3 > 1 for x > 1, we know that our solution lies between 0 and 1. We try a starting value of x0 = 0.5. (Note that a starting value of 0 will lead to an undefined result, showing the importance of using a starting point that is close to the solution.)

The correct digits are underlined in the above example. In particular, x6 is correct to 12 decimal places. We see that the number of correct digits after the decimal point increases from 2 (for x3) to 5 and 10, illustrating the quadratic convergence.



The initial guess will be x0 = 1 and the function will be f (x) = x2 − 2 so that f ′(x) = 2x.

Each new iterative of Newton's method will be denoted by x1. We will check during the computation whether the denominator (yprime) becomes too small (smaller than epsilon), which would be the case if f ′(xn) ≈ 0, since otherwise a large amount of error could be introduced.

%These choices depend on the problem being solved
x0 = 1 %The initial value

maxIterations = 20 %Don't allow the iterations to continue indefinitely
haveWeFoundSolution = false %Have not converged to a solution yet

for i = 1 : maxIterations

 y = f(x0)
 yprime = fprime(x0)

 % denominator is too small
 break; %Leave the loop

 x1 = x0 - y/yprime %Do Newton's computation

 if(abs(x1 - x0) <= tolerance * abs(x1)) %If the result is within the desired tolerance
 haveWeFoundSolution = true
 break; %Done, so leave the loop

 x0 = x1 %Update x0 to start the process again


if (haveWeFoundSolution)
 ... % did not converge

See also[edit]


  1. ^ "Accelerated and Modified Newton Methods". 
  3. ^ (Süli & Mayers, Exercise 1.6)
  4. ^ Dence, Thomas (Nov 1997). "Cubics, chaos and Newton's method". Mathematical Gazette. 81: 403–408. 
  5. ^ Strang, Gilbert (Jan 1991). "A chaotic search for i". The College Mathematics Journal. 22: 3–12. 
  6. ^ McMullen, Curt (1987). "Families of rational maps and iterative root-finding algorithms". Annals of Mathematics (2). 125 (3): 467–493. 

References and further reading[edit]

External links[edit]