Newton's method

In numerical analysis, Newton's method, also known as the Newton–Raphson method, named after Isaac Newton and Joseph Raphson, is a root-finding algorithm which produces successively better approximations to the roots (or zeroes) of a real-valued function. The most basic version starts with a real-valued function $f$, its derivative $f'$, and an initial guess $x0$ for a root of $f$. If $f$ satisfies certain assumptions and the initial guess is close, then

$$x_{1} = x_0 - \frac{f(x_0)}{f'(x_0)}$$

is a better approximation of the root than $x0$. Geometrically, $(x1, 0)$ is the x-intercept of the tangent of the graph of $f$ at $(x0, f(x0))$: that is, the improved guess, $x1$, is the unique root of the linear approximation of $f$ at the initial guess, $x0$. The process is repeated as

$$x_{n+1} = x_n - \frac{f(x_n)}{f'(x_n)}$$

until a sufficiently precise value is reached. The number of correct digits roughly doubles with each step. This algorithm is first in the class of Householder's methods, and was succeeded by Halley's method. The method can also be extended to complex functions and to systems of equations.

Description
The idea is to start with an initial guess, then to approximate the function by its tangent line, and finally to compute the $x$-intercept of this tangent line. This $x$-intercept will typically be a better approximation to the original function's root than the first guess, and the method can be iterated.



If the tangent line to the curve $xn+1$ at $xn$ intercepts the $f(x)$-axis at $x = xn$ then the slope is

$$f'(x_n) = \dfrac{f(x_n)-0} {x_n-x_{n+1}}. $$

Solving for $x$ gives

$$x_{n+1} = x_n - \frac{f(x_n)}{f'(x_n)}. $$



We start the process with some arbitrary initial value $xn+1$. (The closer to the zero, the better. But, in the absence of any intuition about where the zero might lie, a "guess and check" method might narrow the possibilities to a reasonably small interval by appealing to the intermediate value theorem.) The method will usually converge, provided this initial guess is close enough to the unknown zero, and that $xn+1$. Furthermore, for a zero of multiplicity 1, the convergence is at least quadratic (see Rate of convergence) in a neighbourhood of the zero, which intuitively means that the number of correct digits roughly doubles in every step. More details can be found in  below.

Householder's methods are similar but have higher order for even faster convergence. However, the extra computations required for each step can slow down the overall performance relative to Newton's method, particularly if $x$ or its derivatives are computationally expensive to evaluate.

History
The name "Newton's method" is derived from Isaac Newton's description of a special case of the method in De analysi per aequationes numero terminorum infinitas (written in 1669, published in 1711 by William Jones) and in De metodis fluxionum et serierum infinitarum (written in 1671, translated and published as Method of Fluxions in 1736 by John Colson). However, his method differs substantially from the modern method given above. Newton applied the method only to polynomials, starting with an initial root estimate and extracting a sequence of error corrections. He used each correction to rewrite the polynomial in terms of the remaining error, and then solved for a new correction by neglecting higher-degree terms. He did not explicitly connect the method with derivatives or present a general formula. Newton applied this method to both numerical and algebraic problems, producing Taylor series in the latter case.

Newton may have derived his method from a similar, less precise method by Vieta. The essence of Vieta's method can be found in the work of the Persian mathematician Sharaf al-Din al-Tusi, while his successor Jamshīd al-Kāshī used a form of Newton's method to solve $x_{0}$ to find roots of $f$ (Ypma 1995). A special case of Newton's method for calculating square roots was known since ancient times and is often called the Babylonian method.

Newton's method was used by 17th-century Japanese mathematician Seki Kōwa to solve single-variable equations, though the connection with calculus was missing.

Newton's method was first published in 1685 in A Treatise of Algebra both Historical and Practical by John Wallis. In 1690, Joseph Raphson published a simplified description in Analysis aequationum universalis. Raphson also applied the method only to polynomials, but he avoided Newton's tedious rewriting process by extracting each successive correction from the original polynomial. This allowed him to derive a reusable iterative expression for each problem. Finally, in 1740, Thomas Simpson described Newton's method as an iterative method for solving general nonlinear equations using calculus, essentially giving the description above. In the same publication, Simpson also gives the generalization to systems of two equations and notes that Newton's method can be used for solving optimization problems by setting the gradient to zero.

Arthur Cayley in 1879 in The Newton–Fourier imaginary problem was the first to notice the difficulties in generalizing Newton's method to complex roots of polynomials with degree greater than 2 and complex initial values. This opened the way to the study of the theory of iterations of rational functions.

Practical considerations
Newton's method is a powerful technique—in general the convergence is quadratic: as the method converges on the root, the difference between the root and the approximation is squared (the number of accurate digits roughly doubles) at each step. However, there are some difficulties with the method.

Difficulty in calculating the derivative of a function
Newton's method requires that the derivative can be calculated directly. An analytical expression for the derivative may not be easily obtainable or could be expensive to evaluate. In these situations, it may be appropriate to approximate the derivative by using the slope of a line through two nearby points on the function. Using this approximation would result in something like the secant method whose convergence is slower than that of Newton's method.

Failure of the method to converge to the root
It is important to review the proof of quadratic convergence of Newton's method before implementing it. Specifically, one should review the assumptions made in the proof. For situations where the method fails to converge, it is because the assumptions made in this proof are not met.

For example, in some cases, if the first derivative is not well behaved in the neighborhood of a particular root, then it is possible that Newton's method will fail to converge no matter where the initialization is set. In some cases, Newton's method can be stabilized by using successive over-relaxation, or the speed of convergence can be increased by using the same method.

In a robust implementation of Newton's method, it is common to place limits on the number of iterations, bound the solution to an interval known to contain the root, and combine the method with a more robust root finding method.

Slow convergence for roots of multiplicity greater than 1
If the root being sought has multiplicity greater than one, the convergence rate is merely linear (errors reduced by a constant factor at each step) unless special steps are taken. When there are two or more roots that are close together then it may take many iterations before the iterates get close enough to one of them for the quadratic convergence to be apparent. However, if the multiplicity $f$ of the root is known, the following modified algorithm preserves the quadratic convergence rate:

$$x_{n+1} = x_n - m\frac{f(x_n)}{f'(x_n)}. $$

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

If the multiplicity $m$ of the root is finite then $f'(x0) ≠ 0$ will have a root at the same location with multiplicity 1. Applying Newton's method to find the root of $xP − N = 0$ recovers quadratic convergence in many cases although it generally involves the second derivative of $g(x) = f(x)⁄f'(x)$. In a particularly simple case, if $g(x)$ then $f(x)$ and Newton's method finds the root in a single iteration with

$$x_{n+1} = x_n - \frac{g(x_n)}{g'(x_n)} = x_n - \frac{\;\frac{x_n}{m}\;}{\frac{1}{m}} = 0\,.$$

Analysis
Suppose that the function $m$ has a zero at $m$, i.e., $f(x) = xm$, and $f$ is differentiable in a neighborhood of $α$.

If $f$ is continuously differentiable and its derivative is nonzero at $α$, then there exists a neighborhood of $f$ such that for all starting values $g(x) = x⁄m$ in that neighborhood, the sequence $f(α) = 0$ will converge to $α$.

If $α$ is continuously differentiable, its derivative is nonzero at $α$, and it has a second derivative at $f$, then the convergence is quadratic or faster. If the second derivative is not 0 at $α$ then the convergence is merely quadratic. If the third derivative exists and is bounded in a neighborhood of $α$, then:

$$\Delta x_{i+1} = \frac{f'' (\alpha)}{2 f' (\alpha)} \left(\Delta x_{i}\right)^2 + O\left(\Delta x_{i}\right)^3 \,,$$

where

$$\Delta x_i \triangleq x_i - \alpha \,.$$

If the derivative is 0 at $α$, then the convergence is usually only linear. Specifically, if $α$ is twice continuously differentiable, $x0$ and $(xn)$, then there exists a neighborhood of $α$ such that, for all starting values $f'(α) = 0$ in that neighborhood, the sequence of iterates converges linearly, with rate $f$. Alternatively, if $f$ and $x0$ for $f'(α) = 0$, $α$ in a neighborhood $1⁄2$ of $x$, $U$ being a zero of multiplicity $α$, and if $f'(x) ≠ 0$, then there exists a neighborhood of $α$ such that, for all starting values $x ≠ α$ 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 $f ∈ C(U)$ of $r$, if $α$ is twice differentiable in $x0$ and if $U+$, $U+$ in $f' ≠ 0$, then, for each $f · f$ in $U+$ the sequence $x0$ is monotonically decreasing to $α$.

Proof of quadratic convergence for Newton's iterative method
According to Taylor's theorem, any function $U+$ which has a continuous second derivative can be represented by an expansion about a point that is close to a root of $xk$. Suppose this root is $f$. Then the expansion of $f(x)$ about $f(x)$ is:

where the Lagrange form of the Taylor series expansion remainder is

$$R_1 = \frac{1}{2!}f''(\xi_n)\left(\alpha - x_n\right)^{2} \,,$$

where $f(α)$ is in between $xn$ and $α$.

Since $α$ is the root, ($$) becomes:

Dividing equation ($α$) by $ξn$ and rearranging gives

Remembering that $xn$ is defined by

one finds that

$$ \underbrace{\alpha - x_{n+1}}_{\varepsilon_{n+1}} = \frac {- f'' (\xi_n)}{2 f'(x_n)} {(\,\underbrace{\alpha - x_n}_{\varepsilon_{n}}\,)}^2 \,.$$

That is,

Taking the absolute value of both sides gives

Equation ($α$) shows that the order of convergence is at least quadratic if the following conditions are satisfied:


 * 1) $f'(xn)$; for all $xn + 1$, where $$ is the interval $f'(x) ≠ 0$;
 * 2) $x ∈ I$ is continuous, for all $[α − |ε0|, α + |ε0|]$;

where $$ is given by

$$ M = \frac12 \left( \sup_{x \in I} \vert f'' (x) \vert \right) \left( \sup_{x \in I} \frac {1}{ \vert f'(x) \vert } \right). \,$$

If these conditions hold,

$$ \vert \varepsilon_{n+1} \vert \leq M \cdot \varepsilon_n^2 \,. $$

Fourier conditions
Suppose that $f$ is a concave function on an interval, which is strictly increasing. If it is negative at the left endpoint and positive at the right endpoint, the intermediate value theorem guarantees that there is a zero $x ∈ I$ of $$ somewhere in the interval. From geometrical principles, it can be seen that the Newton iteration $M |ε0| < 1$ starting at the left endpoint is monotonically increasing and convergent, necessarily to $f(x)$.

Joseph Fourier introduced a modification of Newton's method starting at the right endpoint:
 * $$y_{i+1}=y_i-\frac{f(y_i)}{f'(x_i)}.$$

This sequence is monotonically decreasing and convergent. By passing to the limit in this definition, it can be seen that the limit of $&zeta;$ must also be the zero $x_{i}$.

So, in the case of a concave increasing function with a zero, initialization is largely irrelevant. Newton iteration starting anywhere left of the zero will converge, as will Fourier's modified Newton iteration starting anywhere right of the zero. The accuracy at any step of the iteration can be determined directly from the difference between the location of the iteration from the left and the location of the iteration from the right. If $$ is twice continuously differentiable, it can be proved using Taylor's theorem that
 * $$\lim_{i\to\infty}\frac{y_{i+1}-x_{i+1}}{(y_i-x_i)^2}=-\frac{1}{2}\frac{f''(\zeta)}{f'(\zeta)},$$

showing that this difference in locations converges quadratically to zero.

All of the above can be extended to systems of equations in multiple variables, although in that context the relevant concepts of monotonicity and concavity are more subtle to formulate. In the case of single equations in a single variable, the above monotonic convergence of Newton's method can also be generalized to replace concavity by positivity or negativity conditions on an arbitrary higher-order derivative of $$. However, in this generalization, Newton's iteration is modified so as to be based on Taylor polynomials rather than the tangent line. In the case of concavity, this modification coincides with the standard Newton method.

Use of Newton's method to compute square roots
Newton's method is one of many known methods of computing square roots. Given a positive number $$, the problem of finding a number $$ such that $&zeta;$ is equivalent to finding a root of the function $y_{i}$. The Newton iteration defined by this function is given by
 * $$x_{n+1} = x_n-\frac{f(x_n)}{f'(x_n)} = x_n-\frac{x_n^2-a}{2x_n} = \frac{1}{2}\left(x_n+\frac{a}{x_n}\right).$$

This happens to coincide with the "Babylonian" method of finding square roots, which consists of replacing an approximate root $&zeta;$ by the arithmetic mean of $x^{2} = a$ and $f(x) = x^{2} − a$. By performing this iteration, it is possible to evaluate a square root to any desired accuracy by only using the basic arithmetic operations.

The following three tables show examples of the result of this computation for finding the square root of 612, with the iteration initialized at the values of 1, 10, and −20. Each row in a "$x_{n}$" column is obtained by applying the preceding formula to the entry above it, for instance
 * $$306.5 = \frac{1}{2} \left( 1+\frac{612}{1} \right).$$

The correct digits are underlined. It is seen that with only a few iterations one can obtain a solution accurate to many decimal places. The first table shows that this is true even if the Newton iteration were initialized by the very inaccurate guess of $xn$.

When computing any nonzero square root, the first derivative of $$ must be nonzero at the root, and that $I$ is a smooth function. So, even before any computation, it is known that any convergent Newton iteration has a quadratic rate of convergence. This is reflected in the above tables by the fact that once a Newton iterate gets close to the root, the number of correct digits approximately doubles with each iteration.

Solution of $a/xn$ using Newton's method
Consider the problem of finding the positive number $M$ with $x_{n}$. We can rephrase that as finding the zero of $x_{n}$. We have $f(x_{n})$. Since $x_{n}$ for all $f$ and $f(x_{n})$ for $x_{n}$, we know that our solution lies between 0 and 1.

For example, with an initial guess $f(x_{n})$, the sequence given by Newton's method is (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):

$$\begin{matrix} x_1 & = & x_0 - \dfrac{f(x_0)}{f'(x_0)} & = & 0.5 - \dfrac{\cos 0.5 - 0.5^3}{-\sin 0.5 - 3 \times 0.5^2} & = & 1.112\,141\,637\,097\dots \\ x_2 & = & x_1 - \dfrac{f(x_1)}{f'(x_1)} & = & \vdots & = & \underline{0.}909\,672\,693\,736\dots \\ x_3 & = & \vdots & = & \vdots & = & \underline{0.86}7\,263\,818\,209\dots \\ x_4 & = & \vdots & = & \vdots & = & \underline{0.865\,47}7\,135\,298\dots \\ x_5 & = & \vdots & = & \vdots & = & \underline{0.865\,474\,033\,1}11\dots \\ x_6 & = & \vdots & = & \vdots & = & \underline{0.865\,474\,033\,102}\dots \end{matrix} $$

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

Slow convergence
The function $cos x = x3$ has a root at 0. Since $f$ is continuously differentiable at its root, the theory guarantees that Newton's method as initialized sufficiently close to the root will converge. However, since the derivative $f(x) = cos(x) &minus; x3$ is zero at the root, quadratic convergence is not ensured by the theory. In this particular example, the Newton iteration is given by
 * $$x_{n+1}=x_n-\frac{f(x_n)}{f'(x_n)}=\frac{1}{2}x_n.$$

It is visible from this that Newton's method could be initialized anywhere and converge to zero, but at only a linear rate. If initialized at 1, dozens of iterations would be required before ten digits of accuracy are achieved.

The function $f'(x) = &minus;sin(x) &minus; 3x2$ also has a root at 0, where it is continuously differentiable. Although the first derivative $f$ is nonzero at the root, the second derivative $a$ is nonexistent there, so that quadratic convergence cannot be guaranteed. In fact the Newton iteration is given by
 * $$x_{n+1}=x_n-\frac{f(x_n)}{f'(x_n)}=\frac{x^{4/3}}{3+4x^{1/3}}.$$

From this, it can be seen that the rate of convergence is superlinear but subquadratic. This can be seen in the following tables, the left of which shows Newton's method applied to the above $cos(x) ≤ 1$ and the right of which shows Newton's method applied to $x3 > 1$. The quadratic convergence in iteration shown on the right is illustrated by the orders of magnitude in the distance from the iterate to the true root (0,1,2,3,5,10,20,39,...) being approximately doubled from row to row. While the convergence on the left is superlinear, the order of magnitude is only multiplied by about 4/3 from row to row (0,1,2,4,5,7,10,13,...).

The rate of convergence is distinguished from the number of iterations required to reach a given accuracy. For example, the function $x > 1$ has a root at 1. Since $x0 = 0.5$ and $x$ is smooth, it is known that any Newton iteration convergent to 1 will converge quadratically. However, if initialized at 0.5, the first few iterates of Newton's method are approximately 26214, 24904, 23658, 22476, decreasing slowly, with only the 200th iterate being 1.0371. The following iterates are 1.0103, 1.00093, 1.0000082, and 1.00000000065, illustrating quadratic convergence. This highlights that quadratic convergence of a Newton iteration does not mean that only few iterates are required; this only applies once the sequence of iterates is sufficiently close to the root.

Convergence dependent on initialization
The function $x6$ has a root at 0. The Newton iteration is given by
 * $$x_{n+1}=x_n-\frac{f(x_n)}{f'(x_n)}=-x_n^3.$$

From this, it can be seen that there are three possible phenomena for a Newton iteration. If initialized strictly between $x3$, the Newton iteration will converge (super-)quadratically to 0; if initialized exactly at $f(x) = x^{2}$ or $f ′$, the Newton iteration will oscillate endlessly between $f(x) = x + x^{4/3}$; if initialized anywhere else, the Newton iteration will diverge. This same trichotomy occurs for $f(x) = x + x^{4/3}$.

In cases where the function in question has multiple roots, it can be difficult to control, via choice of initialization, which root (if any) is identified by Newton's method. For example, the function $f(x) = x + x^{2}$ has roots at −1, 0, 1, and 3. If initialized at −1.488, the Newton iteration converges to 0; if initialized at −1.487, it diverges to $x_{n}$; if initialized at −1.486, it converges to −1; if initialized at −1.485, it diverges to $x + x4/3 n$; if initialized at −1.4843, it converges to 3; if initialized at −1.484, it converges to $x_{n}$. This kind of subtle dependence on initialization is not uncommon; it is frequently studied in the complex plane in the form of the Newton fractal.

Divergence even when initialization is close to the root
Consider the problem of finding a root of $x + x2 n$. The Newton iteration is
 * $$x_{n+1}=x_n-\frac{f(x_n)}{f'(x_n)}=x_n-\frac{x_n^{1/3}}{\frac{1}{3}x_n^{-2/3}}=-2x_n.$$

Unless Newton's method is initialized at the exact root 0, it is seen that the sequence of iterates will fail to converge. For example, even if initialized at the reasonably accurate guess of 0.001, the first several iterates are −0.002, 0.004, −0.008, 0.016, reaching 1048.58, −2097.15, ... by the 20th iterate. This failure of convergence is not contradicted by the analytic theory, since in this case $f$ is not differentiable at its root.

In the above example, failure of convergence is reflected by the failure of $f(x) = x^{20} − 1$ to get closer to zero as $f$ increases, as well as by the fact that successive iterates are growing further and further apart. However, the function $f ′(1) ≠ 0$ also has a root at 0. The Newton iteration is given by
 * $$x_{n+1}=x_n-\frac{f(x_n)}{f'(x_n)}=x_n\left(1-\frac{3}{1-6x_n^2}\right).$$

In this example, where again $x$ is not differentiable at the root, any Newton iteration not starting exactly at the root will diverge, but with both $f(x) = x(1 + x^{2})^{−1/2}$ and $±1$ converging to zero. This is seen in the following table showing the iterates with initialization 1:

Although the convergence of $1$ in this case is not very rapid, it can be proved from the iteration formula. This example highlights the possibility that a stopping criterion for Newton's method based only on the smallness of $−1$ and $±1$ might falsely identify a root.

Oscillatory behavior


It is easy to find situations for which Newton's method oscillates endlessly between two distinct values. For example, for Newton's method as applied to a function $x$ to oscillate between 0 and 1, it is only necessary that the tangent line to $f$ at 0 intersects the $f ′$-axis at 1 and that the tangent line to $f ′′$ at 1 intersects the $f$-axis at 0. This is the case, for example, if $f(x) = arctan x$. For this function, it is even the case that Newton's iteration as initialized sufficiently close to 0 or 1 will asymptotically oscillate between these values. For example, Newton's method as initialized at 0.99 yields iterates 0.99, −0.06317, 1.00628, 0.03651, 1.00196, 0.01162, 1.00020, 0.00120, 1.000002, and so on. This behavior is present despite the presence of a root of $f$ approximately equal to −1.76929.

Undefinedness of Newton's method
In some cases, it is not even possible to perform the Newton iteration. For example, if $f(x) = x(x^{2} − 1)(x − 3)e^{−(x − 1)^{2}/2}$, then the Newton iteration is defined by
 * $$x_{n+1}=x_n-\frac{f(x_n)}{f'(x_n)} = \frac{x_n^2+1}{2x_n}.$$

So Newton's method cannot be initialized at 0, since this would make $∞$ undefined. Geometrically, this is because the tangent line to $n$ at 0 is horizontal (i.e. $−∞$), never intersecting the $1$-axis.

Even if the initialization is selected so that the Newton iteration can begin, the same phenomena can block the iteration from being indefinitely continued.

If $f$ has an incomplete domain, it is possible for Newton's method to send the iterates outside of the domain, so that it is impossible to continue the iteration. For example, the natural logarithm function $f(x) = x^{1/3}$ has a root at 1, and is defined only for positive $x$. Newton's iteration in this case is given by
 * $$x_{n+1}=x_n-\frac{f(x_n)}{f'(x_n)}=x_n(1- \ln x_n).$$

So if the iteration is initialized at $f(x_{n})$, the next iterate is 0; if the iteration is initialized at a value larger than $f(x) = x^{1/3}e^{−x^{2}}|undefined$, then the next iterate is negative. In either case, the method cannot be continued.

$f$ variables, $f$ functions
One may also use Newton's method to solve systems of $x$ equations, which amounts to finding the (simultaneous) zeroes of $f$ continuously differentiable functions $$f:\R^k\to \R.$$ This is equivalent to finding the zeroes of a single vector-valued function $$F:\R^k\to \R^k.$$ In the formulation given above, the scalars $x$ are replaced by vectors $x_{n + 1} − x_{n}$ and instead of dividing the function $f(x_{n})$ by its derivative $x_{n}$ one instead has to left multiply the function $f(x_{n})$ by the inverse of its $x_{n + 1} − x_{n}$ Jacobian matrix $x_{n + 1} − x_{n}$. This results in the expression

$$\mathbf{x}_{n+1} = \mathbf{x}_{n} - J_F(\mathbf{x}_n)^{-1} F(\mathbf{x}_n) .$$

or, by solving the system of linear equations

$$J_F(\mathbf{x}_n) (\mathbf{x}_{n+1} - \mathbf{x}_n) = -F(\mathbf{x}_n)$$

for the unknown $f(x_{n})$.

$f$ variables, $f$ equations, with $x3 − 2x + 2$
The $f$-dimensional variant of Newton's method can be used to solve systems of greater than $x$ (nonlinear) equations as well if the algorithm uses the generalized inverse of the non-square Jacobian matrix $f(x) = x^{3} − 2x + 2$ instead of the inverse of $k$. 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.

Example
For example, the following set of equations needs to be solved for vector of points $$\ [\ x_1, x_2\ ]\ ,$$ given the vector of known values $$\ [\ 2, 3\ ] ~.$$

$$ \begin{array}{lcr} 5\ x_1^2 + x_1\ x_2^2 + \sin^2( 2\ x_2 ) &= \quad 2 \\ e^{ 2\ x_1 - x_2 } + 4\ x_2             &= \quad 3 \end{array}$$

the function vector, $$\ F (X_k)\ ,$$ and Jacobian Matrix, $$\ J(X_k)\ $$ for iteration k, and the vector of known values, $$\ Y\ ,$$ are defined below.

$$\begin{align} ~ & F(X_k) ~ = ~ \begin{bmatrix} \begin{align} ~ & f_{1}(X_{k}) \\ ~ & f_{2}(X_{k}) \end{align} \end{bmatrix} ~ = ~ \begin{bmatrix} \begin{align} ~ & 5\ x_{1}^2 + x_{1}\ x^2_{2} + \sin^2( 2\ x_{2} ) \\ ~ & e^{ 2\ x_{1}-x_{2} } + 4\ x_{2} \end{align} \end{bmatrix}_k \\ ~ & J(X_k) = \begin{bmatrix} ~ \frac{\ \partial{ f_{1}(X) }\ }{ \partial{x_{1}} }\, & ~ \frac{\ \partial{ f_{1}(X) }\ }{ \partial{x_{2}} } ~\\ ~ \frac{\ \partial{ f_{2}(X) }\ }{ \partial{x_{1}} }\, & ~ \frac{\ \partial{ f_{2}(X) }\ }{ \partial{x_{2}} } ~ \end{bmatrix}_k ~ = ~ \begin{bmatrix} \begin{align} ~ & 10\ x_{1} + x^2_{2}\, & & 2\ x_1\ x_2+4\ \sin( 2\ x_{2} )\ \cos( 2\ x_{2} ) \\ ~ & 2\ e^{ 2\ x_{1} - x_{2} }\, & &-e^{ 2\ x_{1} - x_{2}} + 4 \end{align} \end{bmatrix}_k \\ ~ & Y = \begin{bmatrix}~ 2 ~\\~ 3 ~\end{bmatrix}

\end{align} $$

Note that $$\ F(X_k)\ $$ could have been rewritten to absorb $$\ Y\ ,$$ and thus eliminate $$Y$$ from the equations. The equation to solve for each iteration are

$$\begin{align} \begin{bmatrix} \begin{align} ~ & ~ 10\ x_{1} + x^2_{2 }\, & & 2 x_1 x_2 + 4\ \sin( 2\ x_{2} )\ \cos( 2\ x_{2} ) ~\\ ~ & ~ 2\ e^{ 2\ x_{1} - x_{2} }\, & & -e^{ 2\ x_{1} - x_{2} } + 4 ~ \end{align} \end{bmatrix}_k

\begin{bmatrix} ~ c_{1} ~\\ ~ c_{2} ~ \end{bmatrix}_{k+1} = \begin{bmatrix} ~ 5\ x_{1}^2 + x_{1}\ x^2_{2} + \sin^2( 2\ x_{2} ) - 2 ~\\ ~ e^{ 2\ x_{1} - x_{2} } + 4\ x_{2} - 3 ~ \end{bmatrix}_k

\end{align}$$

and

$$ X_{ k+1 } ~=~ X_k - C_{ k+1 } $$

The iterations should be repeated until $$\ \Bigg[ \sum_{i=1}^{i=2} \Bigl| f(x_i)_k - (y_i)_k \Bigr|\Bigg] < E\ ,$$ where $$\ E\ $$ is a value acceptably small enough to meet application requirements.

If vector $$\ X_0\ $$ is initially chosen to be $$\ \begin{bmatrix}~ 1 ~&~ 1 ~\end{bmatrix}\ ,$$ that is, $$\ x_1 = 1\ ,$$ and $$\ x_2=1\ ,$$ and $$\ E\ ,$$ is chosen to be 1., then the example converges after four iterations to a value of $$\ X_4 = \left[~ 0.567297,\ -0.309442 ~\right] ~.$$

Iterations
The following iterations were made during the course of the solution.
 * {| class="wikitable"

! Step ! Variable ! Value \ 5.43656\, & 1.28172 \end{bmatrix} $$ \ 9.10244\, &\quad  -0.551218 \end{bmatrix} $$ \ 8.52219\, &\quad  -0.261095\ \end{bmatrix} $$ \ 8.47561\, &\quad -0.237805 \end{bmatrix}\ $$
 * + Converging iteration sequence
 * - style="vertical-align:bottom;"
 * rowspan="2"; align="center";| $f(x) = x^{2} − 1$
 * align="right";| $k$
 * $$ \begin{bmatrix}\ 1\, & 1 \end{bmatrix} $$
 * align="right";| $x_{1}$
 * $$ \begin{bmatrix}\ 6.82682\, & 6.71828\ \end{bmatrix} $$
 * colspan="3" ; style="background:white;"|
 * rowspan="4"; align="center";| $f ′(0) = 0$
 * align="right";| $k$
 * $$ \begin{bmatrix}\ 11 ~,     & \quad 0.486395 \\
 * rowspan="4"; align="center";| $x$
 * align="right";| $k$
 * $$ \begin{bmatrix}\ 11 ~,     & \quad 0.486395 \\
 * $$ \begin{bmatrix}\ 11 ~,     & \quad 0.486395 \\
 * align="right";| $x_{n}$
 * $$\begin{bmatrix}\ 0.382211\, & 1.27982\ \end{bmatrix} $$
 * align="right";| $k$
 * $$\begin{bmatrix}\ 0.617789\, & -0.279818\ \end{bmatrix} $$
 * align="right";| $f(x) = ln x$
 * $$\begin{bmatrix}\ 2.23852\, & 3.43195\ \end{bmatrix} $$
 * colspan="3" ; style="background:white;"|
 * rowspan="4"; align="center";| $e$
 * align="right";| $m$
 * $$\begin{bmatrix}\ 6.25618\, & -2.1453 \\
 * colspan="3" ; style="background:white;"|
 * rowspan="4"; align="center";| $e$
 * align="right";| $k$
 * $$\begin{bmatrix}\ 6.25618\, & -2.1453 \\
 * $$\begin{bmatrix}\ 6.25618\, & -2.1453 \\
 * align="right";| $k$
 * $$\begin{bmatrix} 0.0494549\, & 0.0330411\ \end{bmatrix} $$
 * align="right";| $J$
 * $$\begin{bmatrix}\ 0.568334\, & -0.312859\ \end{bmatrix} $$
 * align="right";| $xn$
 * $$\begin{bmatrix}\ 2.01366\, & 3.00966\ \end{bmatrix} $$
 * colspan="3" ; style="background:white;"|
 * rowspan="4"; align="center";| $f(xn)$
 * align="right";| $x =$
 * $$\begin{bmatrix}\ 5.78122\, & -2.25449 \\
 * colspan="3" ; style="background:white;"|
 * rowspan="4"; align="center";| $f'(xn)$
 * align="right";| $J =$
 * $$\begin{bmatrix}\ 5.78122\, & -2.25449 \\
 * $$\begin{bmatrix}\ 5.78122\, & -2.25449 \\
 * align="right";| $c =$
 * $$\begin{bmatrix} 0.00102862\, & -0.00342339\ \end{bmatrix} $$
 * align="right";| $x =$
 * $$\begin{bmatrix}\ 0.567305\, & -0.309435\ \end{bmatrix} $$
 * align="right";| $F(xn)$
 * $$\begin{bmatrix}\ 2.00003\, & 3.00006\ \end{bmatrix} $$
 * colspan="3" ; style="background:white;"|
 * rowspan="4"; align="center";| $k × k$
 * align="right";| $J =$
 * $$\begin{bmatrix}\ 5.7688~, & ~ -2.24118 \\
 * colspan="3" ; style="background:white;"|
 * rowspan="4"; align="center";| $JF(xn)$
 * align="right";| $c =$
 * $$\begin{bmatrix}\ 5.7688~, & ~ -2.24118 \\
 * $$\begin{bmatrix}\ 5.7688~, & ~ -2.24118 \\
 * align="right";| $x =$
 * $$\begin{bmatrix}\ 7.73132\!\times\!10^{-6} ~, & ~ 6.93265\!\times\!10^{-6}\ \end{bmatrix} $$
 * align="right";| $J =$
 * $$\begin{bmatrix}\ 0.567297\, & -0.309442\ \end{bmatrix} $$
 * align="right";| $xn + 1 − xn$
 * $$\begin{bmatrix} ~ 2\ ,~ & ~ 3 ~ \end{bmatrix} $$
 * }
 * align="right";| $m > k$
 * $$\begin{bmatrix} ~ 2\ ,~ & ~ 3 ~ \end{bmatrix} $$
 * }

Complex functions
When dealing with complex functions, Newton's method can be directly applied to find their zeroes. Each zero has a basin of attraction in the complex plane, the set of all starting values that cause the method to converge to that particular zero. These sets can be mapped as in the image shown. For many complex functions, the boundaries of the basins of attraction are fractals.

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, if one uses a real initial condition to seek a root of $J = (JJ)−1J$, 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. Also, for any polynomial, Hubbard, Schleicher, and Sutherland gave a method for selecting a set of initial points such that Newton's method will certainly converge at one of them at least.

In a Banach space
Another generalization is Newton's method to find a root of a functional $c =$ defined in a Banach space. In this case the formulation is

$$X_{n+1}=X_n-\bigl(F'(X_n)\bigr)^{-1}F(X_n),\,$$

where $0$ is the Fréchet derivative computed at $f(x) =$. One needs the Fréchet derivative to be boundedly invertible at each $1$ 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.

Nash–Moser iteration
In the 1950s, John Nash developed a version of the Newton's method to apply to the problem of constructing isometric embeddings of general Riemannian manifolds in Euclidean space. The loss of derivatives problem, present in this context, made the standard Newton iteration inapplicable, since it could not be continued indefinitely (much less converge). Nash's solution involved the introduction of smoothing operators into the iteration. He was able to prove the convergence of his smoothed Newton method, for the purpose of proving an implicit function theorem for isometric embeddings. In the 1960s, Jürgen Moser showed that Nash's methods were flexible enough to apply to problems beyond isometric embedding, particularly in celestial mechanics. Since then, a number of mathematicians, including Mikhael Gromov and Richard Hamilton, have found generalized abstract versions of the Nash–Moser theory. In Hamilton's formulation, the Nash–Moser theorem forms a generalization of the Banach space Newton method which takes place in certain Fréchet spaces.

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

Over $x =$-adic numbers
In $J =$-adic analysis, the standard method to show a polynomial equation in one variable has a $c =$-adic root is Hensel's lemma, which uses the recursion from Newton's method on the $x =$-adic numbers. Because of the more stable behavior of addition and multiplication in the $i$-adic numbers compared to the real numbers (specifically, the unit ball in the $F$-adics is a ring), convergence in Hensel's lemma can be guaranteed under much simpler hypotheses than in the classical Newton's method on the real line.

$p$-analog
Newton's method can be generalized with the $p$-analog of the usual derivative.

Maehly's procedure
A nonlinear equation has multiple solutions in general. But if the initial value is not appropriate, Newton's method may not converge to the desired solution or may converge to the same solution found earlier. When we have already found $p$ solutions of $$f(x)=0$$, then the next root can be found by applying Newton's method to the next equation:

$$F(x) = \frac{f(x)}{\prod_{i=1}^N(x-x_i)} = 0 .$$

This method is applied to obtain zeros of the Bessel function of the second kind.

Hirano's modified Newton method
Hirano's modified Newton method is a modification conserving the convergence of Newton method and avoiding unstableness. It is developed to solve complex polynomials.

Interval Newton's method
Combining Newton's method with interval arithmetic is very useful in some contexts. This provides a stopping criterion that is more reliable than the usual ones (which are a small value of the function or a small variation of the variable between consecutive iterations). Also, this may detect cases where Newton's method converges theoretically but diverges numerically because of an insufficient floating-point precision (this is typically the case for polynomials of large degree, where a very small change of the variable may change dramatically the value of the function; see Wilkinson's polynomial).

Consider $f(x) =$, where $p$ is a real interval, and suppose that we have an interval extension $p$ of $p$, meaning that $q$ takes as input an interval $2$ and outputs an interval $f(x) =$ such that:

$$\begin{align} F'([y,y]) &= \{f'(y)\}\\[5pt] F'(Y) &\supseteq \{f'(y)\mid y \in Y\}. \end{align}$$

We also assume that $3$, so in particular $q$ has at most one root in $N$. We then define the interval Newton operator by:

$$N(Y) = m - \frac{f(m)}{F'(Y)} = \left\{\left.m - \frac{f(m)}{z} ~\right|~ z \in F'(Y)\right\}$$

where $f(x) =$. Note that the hypothesis on $X$ implies that $4$ is well defined and is an interval (see interval arithmetic for further details on interval operations). This naturally leads to the following sequence:

$$ \begin{align} X_0 &= X\\ X_{k+1} &= N(X_k) \cap X_k. \end{align} $$

The mean value theorem ensures that if there is a root of $F'$ in $f(x) =$, then it is also in $x5 − 1 = 0$. Moreover, the hypothesis on $f'$ ensures that $x2 + 1$ is at most half the size of $F'(Xn)$ when $F'$ is the midpoint of $f$, so this sequence converges towards $Xn$, where $X$ is the root of $F'$ in $f$.

If $Xn$ strictly contains 0, the use of extended interval division produces a union of two intervals for $f → \mathcal{C}1(X)$; multiple roots are therefore automatically separated and bounded.

Minimization and maximization problems
Newton's method can be used to find a minimum or maximum of a function $Y ⊆ X$. The derivative is zero at a minimum or maximum, so local minima and maxima can be found by applying Newton's method to the derivative. The iteration becomes:

$$x_{n+1} = x_n - \frac{f'(x_n)}{f''(x_n)}. $$

Multiplicative inverses of numbers and power series
An important application is Newton–Raphson division, which can be used to quickly find the reciprocal of a number $F′$, using only multiplication and subtraction, that is to say the number $m$ such that $F'(Y)$. We can rephrase that as finding the zero of $0 ∉ F'(X)$. We have $m ∈ Y$.

Newton's iteration is

$$x_{n+1} = x_n-\frac{f(x_n)}{f'(x_n)} = x_n+\frac{\frac{1}{x_n}-a}{\frac{1}{x_n^2}} = x_n(2-ax_n). $$

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

This method is also very efficient to compute the multiplicative inverse of a power series.

Solving transcendental equations
Many transcendental equations can be solved up to an arbitrary precision by using Newton's method. For example, finding the cumulative probability density function, such as a Normal distribution to fit a known probability generally involves integral functions with no known means to solve in closed form. However, computing the derivatives needed to solve them numerically with Newton's method is generally known, making numerical solutions possible. For an example, see the numerical solution to the inverse Normal cumulative distribution.

Numerical verification for solutions of nonlinear equations
A numerical verification for solutions of nonlinear equations has been established by using Newton's method multiple times and forming a set of solution candidates.

Code
The following is an implementation example of the Newton's method in the Python (version 3.x) programming language for finding a root of a function  which has derivative.

The initial guess will be $N(Y)$ and the function will be $Xk$ so that $Xk + 1$.

Each new iteration of Newton's method will be denoted by. We will check during the computation whether the denominator becomes too small (smaller than  ), which would be the case if $Xk + 1$, since otherwise a large amount of error could be introduced.