Sign in to save

Bookmark this page so you can find it later.

Sign in to save

Bookmark this page so you can find it later.

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.

Iteration 0 of 4
Presets
Newton's method tangent step on f(x) = x^2 - 2root ≈ 1.4142x_1 ≈ 1.5000

Newton's update for f(x) = x^2 - 2

Converged to a root x ≈ 1.41421356 after 4 iterations.
nxₙf(xₙ)f'(xₙ)xₙ₊₁
01.00000-1.000002.000001.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.

xn+1=xnf(xn)f(xn)x_{n+1} = x_n - \frac{f(x_n)}{f'(x_n)}

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.

en+1Cen2|e_{n+1}| \approx C\,|e_n|^2

That is why a handful of iterations usually pins the root to many decimal places.

When It Fails

Zero derivative. A horizontal tangent f(xn)=0f'(x_n) = 0 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 x22x^2 - 2 from x0=0x_0 = 0 to see a horizontal tangent, and x32x+2x^3 - 2x + 2 from x0=0x_0 = 0 to watch the method cycle between 0 and 1.

Related Content