The idea: replace the curve by its tangent
We want a root of f: a number r with f(r) = 0. Solving f(x) = 0 exactly is often impossible, but solving it for a straight line is easy. Newton's method (also called Newton–Raphson) takes a guess xn, draws the tangent line to f at that point, and uses the place where the tangent crosses the x-axis as the next guess xn+1. Then it repeats.
The update rule
The tangent at xn is y = f(xn) + f'(xn)·(x − xn). Setting y = 0 and solving for x gives
xn+1 = xn − f(xn) / f'(xn)
So each step needs the value f(xn) and the slope f'(xn), the derivative. On the canvas each step has three parts: go up from xn to the curve, draw the tangent, follow it down to the axis. (Demo: √2 from x₀ = 1)
For f(x) = x² − 2 the rule becomes xn+1 = (xn + 2/xn) / 2: average the guess with 2 divided by the guess. This is the Babylonian method for square roots, about 3500 years older than Newton.
Quadratic convergence: the digits double
Near a simple root (f(r) = 0 but f'(r) ≠ 0) the new error is about the old error squared, times a constant: en+1 ≈ C·en², with C = f''(r) / (2f'(r)). If the error is 10−3, the next one is near 10−6, then 10−12. The number of correct digits roughly doubles every step. The table on the canvas colours the correct digits of each xn green:
| n | xn for x² − 2, x₀ = 1 | error |xn − √2| | correct digits |
|---|---|---|---|
| 0 | 1 | 4.1e−1 | 1 |
| 1 | 1.5 | 8.6e−2 | 1 |
| 2 | 1.41666666666667 | 2.5e−3 | 3 |
| 3 | 1.41421568627451 | 2.1e−6 | 6 |
| 4 | 1.41421356237469 | 1.6e−12 | 12 |
| 5 | 1.41421356237310 | 0 | 15 (all a double holds) |
The cube root works the same way: x³ − 2 from x₀ = 2 reaches ∛2 = 1.25992104989487 in 6 steps, with digits 0, 1, 2, 2, 7, 12, 15: not an exact doubling every step, but the trend is clear. (Demo: cube root)
Compared with bisection
Bisection needs no derivative. It starts from a bracket [a, b] where f(a) and f(b) have opposite signs, so a root lies between them. Each step evaluates f at the midpoint m and keeps the half where the sign changes. The bracket halves every step, so the error shrinks by a constant factor of 2: linear convergence, about log102 ≈ 0.3 digits per step.
| Newton | Bisection | |
|---|---|---|
| needs | f and f', one start x₀ | f only, a bracket with a sign change |
| error per step | squared (near the root) | halved |
| steps to error < 1e−10 for √2 | 4 | 33 (when (b − a)/2 < 1e−10) |
| can fail? | yes: flat tangent, cycles, divergence | no, once the bracket is valid |
On the canvas's log-scale chart Newton's blue errors fall faster and faster, while bisection's orange dots (the bound (b − a)/2) fall along a straight line. (Demo: Newton vs bisection)
When Newton fails
Quadratic convergence is only promised near the root. From a poor start, the method can misbehave:
- A nearly flat tangent shoots off. For x² − 2 at x₀ = 0.1 the slope is only 0.2, so the tangent crosses the axis at x₁ = 10.05. Far from the root each step only halves x, and it takes 9 steps to come back. At x₀ = 0 the slope is exactly 0 and the method stops: the tangent never meets the axis. (Demo: bad start)
- A cycle. For x³ − 2x + 2 from x₀ = 0: the tangent leads to x₁ = 1, and the tangent there leads straight back to x₂ = 0. Newton bounces forever and never reaches the real root r ≈ −1.769, which bisection on [−2, −1] finds without trouble. (Demo: 2-cycle)
- Slower at a multiple root. Where f'(r) = 0 too (for example x² at 0), the error only halves each step, like bisection.
In practice
Real root finders combine both ideas. Safeguarded methods such as Brent's method keep a bracket like bisection but take a fast step (secant or inverse quadratic) whenever it stays inside the bracket. The secant method replaces f'(xn) by the slope through the last two points, so it needs no derivative and converges with order about 1.618. Libraries compute square roots with a hardware instruction or a few Newton steps from a table-based first guess; each step doubles the digits, so two or three steps reach full double precision.
The same tangent idea works for optimization: applying Newton's method to f'(x) = 0 finds a minimum, using the second derivative. Gradient descent uses only the first derivative and a learning rate instead. See also the derivative as a limit for where the tangent's slope comes from, and Taylor series: Newton's step is the root of the first-order Taylor polynomial.
See also Euler's method, which follows the tangent line forward in time to solve a differential equation. For degree 2 there is an exact answer: the quadratic formula comes from completing the square.
Newton's method relies on local linearity: near a point, f is almost its tangent line, as Local Linearity: Zoom In shows.
Critical points are the zeros of f′; see Reading Derivative Graphs for why they mark the peaks and valleys of f.
See Root Finding: Bisection vs Newton vs Secant for all three methods racing on the same function, with steps and evaluations counted.
Newton's method is a map iterated to its fixed point; the same slope test decides whether the logistic map settles or goes into cycles and chaos: see The Logistic Map: from a Fixed Point to Chaos.
What the page leaves out
Only real functions of one variable are shown. Newton's method in several variables solves a linear system with the Jacobian matrix at every step; in the complex plane the starting points that reach each root form fractals. The error estimate is exact here because the page knows the root; a real solver only sees |xn+1 − xn| and |f(xn)|. Secant and Brent's methods are only described.