Leave lesson

Pure · Numerical methods

1 / 9

The Newton–Raphson method

A fast iteration that uses the tangent — x_(n+1) = x_n − f(x_n)/f'(x_n) — its geometric meaning, why it converges so quickly, and the cases where it fails (a horizontal tangent or a poor starting value).

Pure · Numerical methods

The Newton–Raphson method

A fast iteration that uses the tangent — x_(n+1) = x_n − f(x_n)/f'(x_n) — its geometric meaning, why it converges so quickly, and the cases where it fails (a horizontal tangent or a poor starting value).

Why it works

The iteration x=g(x)x = g(x) works, but slowly, and only for the right rearrangement. The Newton–Raphson method is a cleverer choice of step that homes in on a root astonishingly fast, using the tangent to the curve.

Start at a guess xnx_n. Draw the tangent to y=f(x)y = f(x) at the point (xn,f(xn))(x_n, f(x_n)). Unless the curve is doing something awkward, that tangent crosses the xx-axis much closer to the root than xnx_n was — so take the crossing as your next estimate xn+1x_{n+1}, and repeat.

To find where the tangent meets the axis: it has gradient f(xn)f'(x_n) and passes through (xn,f(xn))(x_n, f(x_n)), so its equation is yf(xn)=f(xn)(xxn)y - f(x_n) = f'(x_n)(x - x_n). Setting y=0y = 0 and solving for xx gives the crossing, and that is the formula: xn+1=xnf(xn)f(xn).x_{n+1} = x_n - \frac{f(x_n)}{f'(x_n)}.1.61.822.22.42.62.8351015x_0xyIt converges very fast. Near the root each step roughly doubles the number of correct digits, so two or three steps from a sensible start usually nail several decimal places — far quicker than a plain x=g(x)x = g(x) iteration. You still need f(x)f'(x), so the method costs a differentiation, but the speed is well worth it.

When it fails. The geometry also shows the traps:
  • f(xn)=0f'(x_n) = 0 — a horizontal tangent never meets the axis, and the formula
divides by zero. The method breaks down completely.
  • Near a stationary point — if f(xn)f'(x_n) is small, the tangent is almost flat and
crosses the axis a long way off, throwing the next estimate wildly out. A starting value too close to a turning point is dangerous.
  • A poor starting value can converge to a different root than intended, or
diverge. Newton–Raphson is fast but not foolproof — start near the root you want.