The formula
- xₙ₊₁ = xₙ − f(xₙ) / f′(xₙ)
xₙ is your current guess, f(xₙ) the function’s value there, f′(xₙ) the derivative there and xₙ₊₁
the next, better guess. Repeat until the guesses stop changing.
Why it works
Close to a point, a curve looks almost like its tangent. The tangent at xₙ is a straight line, and where a straight line that is not horizontal crosses the x-axis can be worked out: it has slope f′(xₙ) and sits at height f(xₙ), so it reaches zero after a step of f(xₙ) / f′(xₙ). Where it crosses is the next guess.
Near the root the tangent is a very good picture of the curve, and the error roughly squares with each step. Three correct decimals become six, six become twelve.
Worked example: √2
√2 is the root of f(x) = x² − 2, with derivative f′(x) = 2x. Start at x₀ = 1:
| Step | xₙ | Correct decimals |
|---|---|---|
| 0 | 1 | 0 |
| 1 | 1 − (−1) / 2 = 1.5 | 0 |
| 2 | 1.5 − 0.25 / 3 ≈ 1.416 667 | 2 |
| 3 | ≈ 1.414 216 | 5 |
| 4 | ≈ 1.414 213 562 | 11 |
Four steps, and every digit on the calculator is right.
An equation algebra cannot solve
cos x = x has no solution by ordinary algebra. Write it as f(x) = cos x − x, with f′(x) = −sin x − 1, and start at x₀ = 1 (radians):
- x₁ ≈ 0.7504
- x₂ ≈ 0.7391
- x₃ ≈ 0.739 085
When it fails
- The tangent is horizontal. If f′(xₙ) = 0 the tangent never meets the x-axis, and the formula divides by zero.
- The guess is too far off. The tangent can send you far away, to another root or nowhere.
- It goes round in circles. f(x) = x³ − 2x + 2 from x₀ = 0 gives x₁ = 1, and from 1 you come back to 0. And so on.
The cure is usually a better starting guess: sketch the graph or try a few values and see where the function changes sign.
Common mistakes
- Plus instead of minus. It is minus f / f′.
- A calculator in degrees. Trigonometric functions are differentiated in radians.
- Stopping too early. Check that f(x) really is close to zero, not just that two guesses are close to each other.
Frequently asked questions
Why the two names?
Isaac Newton described the idea in the 17th century for polynomials. Joseph Raphson wrote it in the form
used today, with a fresh guess at each step.
Do I need to be able to differentiate?
Yes, the derivative gives the tangent’s slope. If you cannot differentiate the function, an approximate
numerical derivative will do, but the method then converges more slowly.

