Newton's Method Visualizer
Choose a function and a starting guess, then step through Newton's method one iteration at a time. Each tangent line crosses the x-axis at the next guess. Try the presets to see the classic ways the method can fail.
Newton's update for f(x) = x^2 - 2
| n | xₙ | f(xₙ) | f'(xₙ) | xₙ₊₁ |
|---|---|---|---|---|
| 0 | 1.00000 | -1.00000 | 2.00000 | 1.50000 |
Reference Guide
The Tangent-Line Idea
Newton's method finds a root of f(x) by following the tangent line at the current guess down to the x-axis. Where the tangent crosses the axis becomes the next guess.
Repeat, and for a good starting guess the iterates close in on a root very quickly.
Quadratic Convergence
Near a simple root, Newton's method roughly doubles the number of correct digits each step. The error of the next guess is proportional to the square of the current error.
That is why a handful of iterations usually pins the root to many decimal places.
When It Fails
Zero derivative. A horizontal tangent makes the next step a division by zero, so the method stalls.
Cycling. The iterates can bounce between a small set of values forever and never approach a root.
Divergence. A poor starting guess can send the iterates running off toward infinity.
Choosing a Starting Guess
The starting guess matters. A value close to a root and away from points where the derivative is small tends to converge fast.
Try from to see a horizontal tangent, and from to watch the method cycle between 0 and 1.