Why Newton is fast, and when it is not
What this page answers
The class page says a root-finding problem is a rule that has to hold at a point, and that Newton's method uses the rule's own slope to get there. It does not say how fast that is, or what a root with a double slope does to the speed. This page derives the rate, measures it against a prediction, and shows the one case where the rate falls from quadratic to linear.
It closes the Richardson row of the measured gaps: an observed order is a measurement, and this page makes it one.
The mathematics
Newton's method from a current guess takes the tangent line at and uses its root:
The tangent is the step, and the residual is where it starts: the curve's height above the axis at the guess. The figure takes one step at a time, so the line, the crossing and the residual are all in view at once.
Three steps take the error from about 0.41 to about 0.0000021. Say which line in the picture decides how far the next step reaches.
Let be a root and the error. Expand about and evaluate at the root, where :
for some between and , by Taylor's theorem with the remainder. The first two terms are exactly what Newton's step removes: . Substituting that and dividing by gives
which in the error's own notation is
That is the whole result. The new error is the old error squared, times a factor that settles down near the root: at the root the factor is , a fixed number for a given problem. Squaring is what makes the method fast — an error of becomes , then — and it is also what makes the step size useless as an error estimate until the run is close.
When the slope vanishes. If is a root of multiplicity , then with , and near the root is small in a particular way. Substituting the two expansions gives
so the error is multiplied by a constant below one instead of being squared. For a double root the constant is : every step halves the error, which is linear convergence, and the number of correct digits grows by about per step rather than doubling. The method still converges; it stops being fast, and a run that looks like it has stalled is usually one that has found a double root.
The check. Take from , whose root is , and predict the ratio from the formula: and , so the predicted ratio is . The measured ratios in the program below are , , , — converging to the prediction from below. That is what the theorem says: the factor is evaluated at an intermediate point, which is still approaching the root on the early steps.
For the double root, at , the prediction is per step, and the measured ratio is on every step, with no sign of improving.
The code
The program runs five Newton steps on each function in forty-digit arithmetic and prints the error after each one, with the ratio that decides the order. Both runs start at .
Five steps on a simple root and on a double root
import sympy as sp
x = sp.symbols("x")
def newton(f, x0, n=5):
d = sp.diff(f, x)
p = sp.N(x0, 40)
rows = []
for _ in range(n):
p = sp.N(p - f.subs(x, p) / d.subs(x, p), 40)
rows.append(p)
return rows
print("f = x^2 - 2, root sqrt(2) =", sp.N(sp.sqrt(2), 8))
prev = None
for p in newton(x**2 - 2, 1):
e = abs(p - sp.sqrt(2))
ratio = sp.N(e / prev**2, 3) if prev else 0
row = f" x {sp.N(p, 12):>14} error {sp.N(e, 3):>10}"
print(f"{row} e/prev^2 {ratio}")
prev = e
print("f = x^2, double root at 0")
prev = None
for p in newton(x**2, 1):
e = abs(p)
ratio = sp.N(e / prev, 3) if prev else 0
row = f" x {sp.N(p, 12):>14} error {sp.N(e, 3):>10}"
print(f"{row} e/prev {ratio}")
prev = e
f = x^2 - 2, root sqrt(2) = 1.4142136
x 1.50000000000 error 0.0858 e/prev^2 0
x 1.41666666667 error 0.00245 e/prev^2 0.333
x 1.41421568627 error 0.00000212 e/prev^2 0.353
x 1.41421356237 error 1.59E-12 e/prev^2 0.354
x 1.41421356237 error 8.99E-25 e/prev^2 0.354
f = x^2, double root at 0
x 0.500000000000 error 0.500 e/prev 0
x 0.250000000000 error 0.250 e/prev 0.500
x 0.125000000000 error 0.125 e/prev 0.500
x 0.0625000000000 error 0.0625 e/prev 0.500
x 0.0312500000000 error 0.0313 e/prev 0.500
Read the first table's error column as digits, not as numbers: each entry has about twice as many correct digits as the one above it. That is what a constant ratio of looks like. The second table's error column has the same number of digits gaining one at a time, which is what a constant ratio of looks like. The ratio column says five times.
The final row of the first table is the limit of the method rather than of the analysis. The error is because forty digits are being carried, and the next step gains none.
The theory
Newton's method is the fixed-point iteration with , and the derivative of at the root is zero when : that is the same statement as the squared error. Three assumptions carry it.
- A simple root. . The multiplicity argument above is what happens when this fails, and it is a change of order rather than a failure to converge.
- Smoothness. The remainder term needs to exist near the root. A function with a kink at the root breaks the argument, and the iteration can cycle.
- A start close enough. The theorem is local. Far from the root the factor can be large, and the step can jump past the root or to another one. A run that oscillates between two values is starting badly, not converging slowly.
Two practical consequences follow, and both are about the stopping rule rather than the rate. First, the step size is not the error: is when the convergence is linear, and about too on the last quadratic step, but before that it is a poor proxy. Second, the achievable accuracy is limited by the accuracy of : a derivative with a relative error leaves an error of about in the root. The iteration is solving an equation that is itself slightly wrong. That square root is the reason a numerical derivative caps the accuracy of Newton's method regardless of how many digits are carried.
The order of convergence and its measurement are the subject of Convergence, and how to measure it; the standard derivation is Wright's, in Numerical Optimization.
What it will not do: it will not work without a derivative. It will not recover quadratic convergence at a double root without being told the multiplicity. The modified step restores it when is known, and guessing is a different problem.
What this cost
Each step costs one evaluation of and one of . In one variable that is negligible and the method is limited by how fast the error squares. In variables, is a Jacobian and the step solves a linear system. A step then costs once and per step after a factorisation. That is why the rate matters so much in several variables: each step is expensive, and quadratic convergence means about of the digits wanted rather than one step per digit.
What it will not do: it will not certify the root. It will not find a root it did not start near. And at a multiple root it will not tell you that is what happened unless you watch the ratio in the table above.
Back to the map
Root finding is the class page this works under. Convergence, and how to measure it is how an observed order is measured when the ratio is not a constant. Home is the summary.