What the method actually does
Newton-Raphson replaces a hard problem with an easy one, repeatedly. You cannot solve x3 − 2x − 5 = 0 by rearranging, but you can solve the equation of the tangent line at any point in one line of algebra. So the method draws the tangent to the curve at your current guess, finds where that straight line crosses the x-axis, and calls that the next guess. Repeat.
Writing the tangent at xn as y = f(xn) + f′(xn)(x − xn) and setting y = 0 gives the update rule directly: x = xn − f(xn)/f′(xn). Everything else about the method is a consequence of that one line — including its speed and both of its failure modes.
Isaac Newton demonstrated the procedure on this very cubic, x3 − 2x − 5 = 0, which is why it is the default in the box above. Joseph Raphson published the iterative form in 1690 that is closer to what you use today, and Thomas Simpson gave the general derivative-based statement in 1740.
Why the digits double, and when they stop doubling
Expand f about the true root r in a Taylor series and you find that the new error is proportional to the square of the old one: εn+1 ≈ [f″(r)/2f′(r)] εn2. That is what quadratic convergence means in practice — the number of correct decimal places roughly doubles with every step. An error of 10−2 becomes 10−4, then 10−8, then 10−16, which is already at the limit of double precision. Four or five iterations from a decent starting guess is typical, and you can watch it happen in the step column of the table.
The proportionality constant carries f′(r) in the denominator, and that is the whole story of when the method degrades. At a repeated root, f′(r) = 0 and the quadratic term is not available; convergence drops to linear, with the error shrinking by a constant factor of (m−1)/m per step for a root of multiplicity m. For a double root that factor is exactly one half, which you can verify by running x^2 from x0 = 1 and reading the step column: 0.5, 0.25, 0.125, and so on.
The calculator measures this rather than assuming it. It estimates the observed order from the last three step sizes as ln(dn/dn−1) ÷ ln(dn−1/dn−2), which returns about 2 for a simple root and about 1 for a repeated one.
Worked example: solving x³ − 2x − 5 = 0 from x₀ = 2
The derivative is f′(x) = 3x2 − 2. Do the first two steps by hand.
- Iteration 0. f(2) = 8 − 4 − 5 = −1. f′(2) = 3(4) − 2 = 10. The correction is −1/10 = −0.1, so x1 = 2 − (−0.1) = 2.1. The step size is 0.1.
- Iteration 1. f(2.1) = 9.261 − 4.2 − 5 = 0.061. f′(2.1) = 3(4.41) − 2 = 11.23. The correction is 0.061/11.23 = 0.00543188, so x2 = 2.1 − 0.00543188 = 2.09456812. The step has fallen from 0.1 to 0.0054 — a factor of 18.
- Iteration 2. The step falls to about 1.66 × 10−5. Compare that to the square of the previous step, 0.00542 = 2.9 × 10−5: the same order of magnitude, which is quadratic convergence made visible.
- Iteration 3. The step falls to about 1.6 × 10−10, below the 10−8 tolerance, so the iteration stops after 4 passes with x = 2.0945514815.
Check the answer by substitution: 2.09455148153 = 9.1891029631, and 2 × 2.0945514815 + 5 = 9.1891029630. The residual is smaller than 10−9.
Now feed the three step sizes 0.00543188, 1.66 × 10−5 and 1.6 × 10−10 into the order estimate: ln(1.6×10−10 / 1.66×10−5) ÷ ln(1.66×10−5 / 0.00543188) = (−11.55) ÷ (−5.79) = 2.0. The method is behaving exactly as the theory says.
How to read the iteration table
The step column is the diagnostic. If each step is roughly the square of the previous one, you are converging quadratically to a simple root and the answer is trustworthy. If each step is a constant fraction of the previous one, you have a repeated root or a shallow crossing; the root is still there but the last few digits are not reliable. If the steps are growing, the iterates are leaving the neighbourhood and the starting guess needs to change.
The residual column is the honesty check. A small step does not by itself prove you have a root. On a stretch where the curve is nearly flat, the correction f/f′ can be small simply because f′ is large, while f is still far from zero. Always read the residual next to the step. The calculator warns you when the steps have stopped but the residual has not.
The derivative column shows you the danger. Values drifting toward zero mean the tangent is flattening, and a flat tangent throws the next iterate a long way off. Exactly zero and the method simply has no next step — the tangent is parallel to the axis it is supposed to cross.
How many iterations is normal? From a starting guess with about one correct digit, expect four to six iterations to reach a tolerance of 10−8, because the correct digits double each pass. Needing twenty steps is a signal, not a nuisance: either the starting guess was far away, or the root is repeated.
How the method behaves on different kinds of root
| f(x) | x₀ | Tolerance | Result | Iterations | Order |
|---|---|---|---|---|---|
| x³ − 2x − 5 | 2 | 1e-8 | 2.0945514815 | 4 | ≈2 |
| x² − 2 | 1 | 1e-8 | 1.4142135624 | 5 | ≈2 |
| x² − 612 | 10 | 1e-8 | 24.7386337537 | 6 | ≈2 |
| cos(x) − x | 1 | 1e-10 | 0.7390851332 | 5 | not reported |
| x² (double root) | 1 | 1e-6 | ≈9.5×10⁻⁷ | 20 | ≈1 |
| x² − 4 | 0 | 1e-8 | no step — f′(0) = 0 | 0 | — |
The double-root row is the one worth studying: twenty iterations for six digits, against five iterations for ten digits on the simple root two rows above it. The order estimate needs three successive non-zero steps, so it is not reported when a step lands exactly on zero, as it does for cos(x) − x.
The four ways Newton-Raphson fails
- Zero derivative. The tangent is horizontal and has no x-intercept, so there is no next iterate at all. The calculator stops and says so. Bisection needs no derivative and is the standard fallback.
- Convergence to the wrong root. The method is local. A function with several roots hands you whichever one the tangent chain happens to lead to, and that need not be the nearest one to your guess. Sketch the function or bracket the root first.
- Cycling. Some functions send the iteration into a loop that never settles — the classic example is f(x) = x³ − 2x + 2 started at x₀ = 0, which alternates between 0 and 1 forever. The iteration cap is what saves you.
- Slow crawl at a repeated root. Convergence becomes linear, and the achievable accuracy is limited: near a double root, f is quadratically flat, so floating-point noise in f masks the root over an interval of width roughly the square root of machine epsilon.
- Leaving the domain. An iterate that lands where ln(x) or sqrt(x) is undefined ends the run. Restarting closer to the root usually fixes it.
Newton-Raphson is how your computer computes square roots
Applying the method to f(x) = x2 − a gives xn+1 = xn − (xn2 − a)/(2xn), which simplifies to the average of xn and a/xn. That is the Babylonian method, known for around 3,700 years and still the basis of the square-root routine in most numerical libraries. Try it: enter x^2 - 612 with a starting guess of 10 and watch it reach 24.7386337537 in six steps.
When to use something else
Use bisection when you need a guarantee. If you can find two points where f has opposite signs, the bisection method cannot fail: the bracket halves every step and the root stays inside it. It is slow — one bit of accuracy per iteration against a doubling of digits — but it never diverges and never needs a derivative. A common professional pattern is bisection to get close, then Newton to finish.
Use the secant method when the derivative is expensive or unavailable. The secant method replaces f′ with the slope through the last two iterates. Its convergence order is the golden ratio, about 1.618, so it needs a few more iterations than Newton but only one function evaluation per step instead of two.
Check whether you need a root-finder at all. A quadratic has a closed-form solution — use the quadratic equation calculator. Polynomial roots can also be read off as the eigenvalues of a companion matrix, which is what the eigenvalue calculator does for the characteristic polynomial.
Newton-Raphson also generalises. In several variables the derivative becomes the Jacobian matrix and the division becomes a linear solve, so each step is a system of equations handled by Gauss-Jordan elimination — the same idea, one dimension up.
