Newton Method Visualizer

root-finding with tangent steps and convergence diagnostics

Loading interactive simulation...

0.55 and 0.58 end up at opposite roots 🖖

Newton doubles the number of correct digits at every step, and the Fast root preset measures it: from x₀ = 1 towards √2 the error runs 0.414, 0.0858, 0.00245, 2.1 × 10⁻⁶, 1.6 × 10⁻¹². Four steps, twelve digits. The same mechanism is what breaks it. Where the derivative is nearly flat the tangent barely tilts and the step is enormous. On x³ − x, starting at 0.5774 throws the first guess to −2210 — which is why 0.55 ends up at the negative root while 0.58 ends up at the positive one.

follow the tangent to the axis 🖖

To find where a curve crosses zero, Newton's method replaces the curve with its tangent line at your current guess and jumps to where that straight line hits the x-axis. Because a smooth curve looks almost straight when you zoom in, that crossing usually lands much closer to the true root. Repeat, and you close in fast. The formula: xn+1 = xn − f(xn)/f'(xn).

computers divide without dividing 🖖

Modern CPUs often compute a/b by first finding 1/b, and Newton's method does this using no division at all. Applied to f(x) = 1/x − a it gives the iteration xn+1 = xn(2 − a·xn), built from only multiplication and subtraction — operations hardware does cheaply. The same trick underlies fast reciprocal-square-root routines, including the famous one in Quake III.

NEWTON'S METHOD — WHEN IT DOUBLES YOUR DIGITS, AND WHEN IT RUNS AWAY

Which Newton Case Are You In?

Newton's method follows the tangent down to the axis and repeats: xₖ₊₁ = xₖ − f(xₖ)/f′(xₖ). When it works it is spectacular, roughly doubling the number of correct digits every step. Every way it fails comes from the same place — that denominator. A near-zero f′ throws you far away, an f′ that vanishes at the root slows you to a crawl, and starting on the wrong side of a turning point hands you a different root altogether.

Quadratic convergence — the case Newton is famous for ek+1 ∝ ek2
Flat slope at the root — the speed drops to linear f′(r) = 0 ⇒ ek+1 ≈ (1 − 1/m)ek
It runs away — the step grows instead of shrinking x → −2x
It converges — to a root you did not ask for f′(x₀) = 0

01

Quadratic convergence — the case Newton is famous for

What you know: f is smooth, f′ is comfortably non-zero near the root, and the starting point is close enough. Each step roughly squares the error.

Iteration: ek+1 ∝ ek2

Worked example: f(x) = x² − 2 from x₀ = 1 → 1.5, 1.416667, 1.41421569, 1.41421356237: 1, then 3, 6 and 12 correct digits

Open this case: fast root
Quadratic convergence — the case Newton is famous for. Each tangent lands far nearer the root than the last, and the error squares. f is smooth, f′ is comfortably non-zero near the root, and the starting point is close enough. Each step roughly squares the error.
Each tangent lands far nearer the root than the last, and the error squares.

02

Flat slope at the root — the speed drops to linear

What you know: The root is a repeated one, so f and f′ vanish together there. The tangent is nearly horizontal exactly where you are heading.

Iteration: f′(r) = 0 ⇒ ek+1 ≈ (1 − 1/m)ek

Worked example: f(x) = x³ from x₀ = 0.1 → 0.0667, 0.0444, 0.0296, 0.0198: each step multiplies the error by 2/3 instead of squaring it

Open this case: flat slope
Flat slope at the root — the speed drops to linear. A triple root flattens the tangent, so each step covers only a third of what is left. The root is a repeated one, so f and f′ vanish together there. The tangent is nearly horizontal exactly where you are heading.
A triple root flattens the tangent, so each step covers only a third of what is left.

03

It runs away — the step grows instead of shrinking

What you know: f′ collapses faster than f as you approach the root, so the correction f/f′ overshoots by more on every iteration.

Iteration: x → −2x

Worked example: f(x) = ∛x from x₀ = 0.01 → −0.02, 0.04, −0.08, 0.16: the update works out to exactly x → −2x, so the distance doubles and the sign flips forever

Open this case: diverge
It runs away — the step grows instead of shrinking. Every tangent crosses the axis twice as far out as the last, on the opposite side. f′ collapses faster than f as you approach the root, so the correction f/f′ overshoots by more on every iteration.
Every tangent crosses the axis twice as far out as the last, on the opposite side.

04

It converges — to a root you did not ask for

What you know: The function has several roots and the start sits near a turning point, where f′ is small and the first step is enormous.

Iteration: f′(x₀) = 0

Worked example: f(x) = x³ − x from x₀ = 0.7 settles on +1, but from x₀ = 0.5 the very first step lands on −1 — a root on the far side of two others

Open this case: wrong basin
It converges — to a root you did not ask for. Two nearby starts, two different roots: the boundary sits at the turning point, not between the roots. The function has several roots and the start sits near a turning point, where f′ is small and the first step is enormous.
Two nearby starts, two different roots: the boundary sits at the turning point, not between the roots.

Problem solved in full

  1. The root of x³ − x − 2 by Newton's method 5 steps

    Newton's method finds the root of x³ − x − 2 in three iterations. Bisection needs about twenty steps just to reach 10⁻⁶, which Newton passes on its second. Work out where the speed comes from — and what it costs.

    1. The method is one idea: replace the curve by its tangent and solve that instead, because a straight line can be solved exactly. The next guess is where the tangent crosses zero.

    2. From 1.5 the first step is almost the whole journey. The function is only −0.125 there, the slope is 5.75, and their ratio moves the guess by about 0.022.

    3. Two more steps and the digits stop changing. The tool reports three iterations because the fourth would move the answer by less than the tolerance.

    4. The interesting quantity is not the estimate but the error. Track it and the pattern is unmistakable: each error is roughly the square of the one before, so the number of correct digits doubles every step — 2, then 4, then 7, then 14.

    5. And the constant in front is not arbitrary. Expanding f about the root shows the ratio of consecutive squared errors tends to |f″/2f′| evaluated there, which for this cubic is 0.768. The observed ratios are 0.786, 0.768, 0.768.

    Answer

    The tool prints a root of 1.52138 after 3 iterations. Quadratic convergence is why: bisection halves the interval each step and needs about twenty to reach 10⁻⁶, while Newton squares the error and is past it on the second step. The cost is that it is not guaranteed. Bisection cannot fail once it has bracketed a root; Newton has no bracket, and a starting point where the slope is near zero throws the next guess far away. That is the trade the whole of numerical root-finding is built around, and it is why production solvers bracket first and only then switch to Newton.

Learning path

Three numerical methods, and where each one gives out

Leads to Integrating numerically

References (1)

Example problems

  • fast root - From x0 = 1 the error falls 0.414, 0.0858, 0.00245, 2.1 × 10⁻⁶, 1.6 × 10⁻¹² - each roughly the square of the last, so four steps give twelve correct digits of √2.
  • flat slope - x³ has a triple root at 0, where Newton crawls instead of squaring: every step just multiplies x by 2/3. After six it halts at 0.0088 and reports convergence. The root is 0.
  • diverge - Newton on the cube root reduces to x → -2x exactly, so the guesses run 0.01, -0.02, 0.04, -0.08, doubling and flipping sign forever. It diverges from every start but the root itself.
  • wrong basin - x0 = 0.55 sits on the positive side and converges to -1. The first tangent throws it to -3.60, because the derivative nearly vanishes at 1/√3 = 0.5774 - and 0.58 goes to +1 instead.
  • negative root - The same x² - 2 as Fast root, started at -1.2 instead of 1, converging to -1.414 in three steps. Newton finds the root you point it at, not the one you wanted.
  • strict tolerance - x³ - x - 2 from 1.6 reaches 1.5213797 in three iterations even at a tolerance of 10⁻⁸. Bisection would need about twenty-seven halvings to match it.