Visual Tools
Calculators
Tables
Mathematical Keyboard
Converters
Other Tools


Newton's Method


Local view · f(x) = x³ − 2x − 5

f′(x) = 3x² − 2 · real root α ≈ 2.0946
Drag x₀ on the x-axis, click "Step ▶", or pick a scenario.
n =0
xₙ =3.00
f(xₙ) =16.00
|xₙ − α| =0.91
f(x)tangentdrops







Key Terms

Newton's method (also called Newton-Raphson) — an iterative algorithm for approximating a root of a differentiable function by repeatedly following the tangent line down to the x-axis.

Iterate — one of the values x0,x1,x2,x_0, x_1, x_2, \ldots produced by repeatedly applying the Newton step.

Newton step — the update rule xn+1=xnf(xn)/f(xn)x_{n+1} = x_n - f(x_n) / f'(x_n), the x-intercept of the tangent line at (xn,f(xn))(x_n, f(x_n)).

Initial guess — the starting value x0x_0 from which the iteration begins. Its position relative to the root and to any critical points determines whether the method succeeds.

Quadratic convergence — near a simple root the error roughly squares at each step, so the number of correct digits roughly doubles per iteration.

Critical point — a point where f(x)=0f'(x) = 0. Starting near a critical point makes the tangent nearly horizontal and breaks Newton's method.

Getting Started with the Visualizer

    The visualizer shows the cubic function f(x)=x32x5f(x) = x^3 - 2x - 5 together with its single real root α2.0946\alpha \approx 2.0946, marked by a small triangle below the x-axis.

    The interface has two parts. The left panel holds the graph, three scenario buttons, the Step and Reset controls, and a row of numeric readouts. The right panel is a tabbed sidebar with three views: Computation, Meaning, and Theory.

    There are three ways to drive the tool:

  • Pick a scenario to animate a preset starting point through a sequence of Newton iterations.
  • Drag x0x_0 along the x-axis to place your own starting guess.
  • Click Step to advance one Newton iteration at a time from your custom x0x_0.

  • The four readouts under the graph — current iteration index nn, current iterate xnx_n, function value f(xn)f(x_n), and the absolute error xnα|x_n - \alpha| — update live as the animation progresses.

Choosing a Preset Scenario

    Three buttons sit below the graph, each pinned to a starting value and a label describing what happens next.

  • Direct hit (x0=3x_0 = 3) — starts on the right side of the root in the smooth basin. Each tangent step pulls the guess sharply toward α\alpha and the error collapses within a few iterations.
  • Crosses over (x0=1x_0 = -1) — starts on the wrong side of the curve. The first tangent crosses zero and the iterate lands in positive territory, after which the method converges normally.
  • Stalls (x0=0.85x_0 = 0.85) — starts very close to a critical point at x=2/30.816x = \sqrt{2/3} \approx 0.816 where ff' is tiny. The tangent comes out nearly horizontal, the correction f/ff / f' blows up, and x1x_1 flies off the chart.

  • The third scenario is the failure mode worth studying carefully. Click Reset at any time to clear the current scenario and return x0x_0 to its default position for free dragging.

Direct Hit: Four Steps from x₀ = 3

    The Direct hit scenario starts at x0=3x_0 = 3, to the right of the root and well inside the smooth basin where ff' is large. Four iterations are enough to reach the root to four decimal places.

  • x0=3x_0 = 3f=16f = 16, f=25f' = 25, error 9.1×1019.1 \times 10^{-1}
  • x1=2.36x_1 = 2.36f=3.4243f = 3.4243, f=14.709f' = 14.709, error 2.6×1012.6 \times 10^{-1}
  • x2=2.127197x_2 = 2.127197f=0.3711f = 0.3711, f=11.575f' = 11.575, error 3.3×1023.3 \times 10^{-2}
  • x3=2.095136x_3 = 2.095136f=0.006527f = 0.006527, f=11.169f' = 11.169, error 5.9×1045.9 \times 10^{-4}

  • Read the error figures downward: roughly 10110^{-1}, then 10110^{-1}, then 10210^{-2}, then 10410^{-4}. The exponent doubles once the guess is close enough, which is quadratic convergence doing its work.
-2-11234-10-551015200xyαP₀x₀P₁x₁P₂x₂P₃x₃
Direct hit, frozen after 4 iterations

Four tangents, each steep enough to keep its correction small. The P-markers crowd together as they approach α, and the final iterate x3 = 2.095136 is already correct to three decimals.

Geometrically the run is uneventful, and that is the point. Every tangent in the picture is steep — ff' never drops below 11 after the first step — so each correction f/ff / f' is small and lands the next guess close by. The faded trail shows the iterates bunching up near α\alpha rather than spreading out.

The next step, had the animation continued, would put the error near 10710^{-7}. That is the practical shape of the quadratic convergence result: a handful of steps from a decent starting guess, and no benefit in asking for more.

Crosses Over: One Tangent Throws the Guess Across the Root

The Crosses over scenario starts at x0=1x_0 = -1, on the far side of the curve where f(1)=4f(-1) = -4 and f(1)=1f'(-1) = 1. That slope is shallow compared with the function value, so the correction is large:

x1=141=3x_1 = -1 - \frac{-4}{1} = 3

The first tangent hurls the guess from 1-1 all the way to 33, straight past the root at α2.0946\alpha \approx 2.0946. From there the run is identical to the direct hit — the same four iterates, the same error collapse.
-2-11234-10-551015200xyαP₀x₀P₁x₁P₂x₂P₃x₃P₄x₄
Crosses over, frozen after 5 iterations

The leftmost tangent, at x0 = -1, is the shallow one: it carries the guess clear across the root to x1 = 3. The remaining four steps repeat the direct-hit run exactly.

The overshoot is not a failure. Newton has no notion of which side of the root it is on; it only follows the tangent to the axis. Landing on the opposite side is common and usually harmless, as here, where the crossover happens to deposit the guess in the good basin.

What makes the difference is the ratio f/ff / f', not the sign of anything. At x0=1x_0 = -1 that ratio is 4-4, large enough to jump the root but not large enough to escape the region. Push the start a little further left and the same mechanism throws the iterate somewhere far less convenient — which is exactly what the stalling scenario does with a shallow slope instead of a distant start.

Stalls: What Happens Near a Critical Point

The Stalls scenario starts at x0=0.85x_0 = 0.85, deliberately close to the critical point x=2/30.8165x = \sqrt{2/3} \approx 0.8165 where ff' vanishes. The numbers there are lopsided:

f(0.85)=6.0859f(0.85) = -6.0859, f(0.85)=0.1675f'(0.85) = 0.1675

The correction is the quotient of those two, 36.33-36.33, so

x1=0.85(36.33)=37.18x_1 = 0.85 - (-36.33) = 37.18

The tangent leaves P0P_0 almost horizontally and travels a very long way before meeting the axis. The tool stops there and draws an arrow off the right edge, because x1=37.18x_1 = 37.18 is far outside the visible window.
-2-11234-10-551015200xyαx₁ ≈ +37.2P₀x₀
Stalls, frozen at the failing step

f′(0.85) = 0.1675 makes the tangent nearly horizontal, so it meets the axis at x1 = 37.18 - far off the right edge, which is what the red arrow marks. The frame is the step itself, before the tool clears it.

Nothing about this is a defect in the method — it is the formula behaving exactly as written. The step size is f/ff / f', and any denominator near zero makes that quotient enormous no matter how ordinary the numerator is.

The practical rule follows directly: starting points near critical points of ff are unsafe for Newton, and so are iterates that happen to land near one mid-run. From x1=37.18x_1 = 37.18 the method would in fact recover — ff' is huge out there, so the guess marches back down — but it would burn a dozen steps doing what a better start achieves in four. Other ways the method can break down are collected under when Newton's method fails.

Stepping Manually from a Custom Start

    To run Newton's method from your own starting point, click Reset first if a preset scenario is active.

    Then:

  • Drag the blue dot on the x-axis to move x0x_0 wherever you want it. The drop line shows the corresponding point (x0,f(x0))(x_0, f(x_0)) on the curve.
  • Click Step to play one full Newton iteration. The animation marks the current point, draws the tangent, slides down to the new x-intercept, and lifts back to the curve.
  • Click Step again to run the next iteration from the updated guess. Each click advances exactly one step, so the convergence (or divergence) unfolds at your own pace.

  • After every step the History table in the Computation tab grows by one row and the live readouts update. The Step button is only available when no preset scenario is running.
-2-11234-10-551015200xyαP₀x₀
Manual start, frozen at x0 = 3

Nothing has run yet: just the draggable x0 on the axis, the drop line up to P0 on the curve, and the grey marker at the root α ≈ 2.0946. Every Step click adds one tangent to this picture.


Reading the Animation

    Every Newton iteration is broken into five visible phases. A banner at the top of the graph names the current phase, so the geometry on screen lines up with the algebra in the side panel.

  • Mark — the current guess PnP_n on the curve pulses briefly to draw attention.
  • Tangent — the blue tangent line at PnP_n extends across the canvas.
  • To axis — a marker slides along the tangent down to where it meets the x-axis, locating the next iterate xn+1x_{n+1}.
  • To curve — a dashed line lifts from xn+1x_{n+1} up to the curve, locating Pn+1P_{n+1}.
  • Settle — a brief pause before the next iteration begins.

  • Past iterations fade so the latest step stays prominent. The triangle below the axis marks the true root α\alpha, giving you a visual target to compare each iterate against. If the animation halts with a red banner, the iteration has hit a failure mode and an arrow indicates where the off-chart iterate landed.

Reading the Computation Tab

    The Computation tab is the numeric companion to the animation. It has three sections that update together with the geometry.

  • Iteration formula — the Newton step xn+1=xnf(xn)/f(xn)x_{n+1} = x_n - f(x_n) / f'(x_n), shown once as the algorithm's definition.
  • Current step — the live values for the running iteration: f(xn)f(x_n), f(xn)f'(x_n), the correction f/ff / f', and the resulting xn+1x_{n+1}. The two outputs are highlighted in blue.
  • History — a compact table with one row per iteration so far, showing nn, xnx_n, f(xn)f(x_n), and xnα|x_n - \alpha|. The active row is highlighted; failed rows appear in red.

  • The History table is where quadratic convergence becomes obvious: when the method succeeds, the error column drops by a factor that itself grows at every step.

Reading the Meaning and Theory Tabs

    The Meaning tab opens automatically once an iteration sequence finishes. It shows a colored verdict card explaining what happened.

  • Converged (blue) — the iteration reached the root. The card explains quadratic convergence and quotes the final error.
  • Stalls (red) — the iteration failed. The card identifies the value of f(x0)f'(x_0) as the culprit and shows where x1x_1 landed.

  • A second card underneath gives the underlying reason — for success, the asymptotic error formula; for failure, why a small derivative makes the correction blow up.

    The Theory tab is always available and holds five reference blocks: the definition, the geometric derivation of the Newton step from the tangent equation, the quadratic-convergence statement near a simple root, three common failure modes (flat tangent, cycles, divergence), and a summary of what each statement looks like for the specific cubic on screen.

What is Newton's Method?

Newton's method, also called the Newton-Raphson method, is an iterative algorithm for approximating a root of a differentiable function ff. Starting from an initial guess x0x_0, each iteration replaces the current guess with the x-intercept of the tangent line at that point:

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


Geometrically, the step is the algebraic version of "follow the tangent at (xn,f(xn))(x_n, f(x_n)) down to where it crosses the x-axis." When ff is smooth and the starting guess is close enough to a simple root, this sequence converges very rapidly to that root.

For broader coverage of iterative root finders, see the root finding overview page, and for the underlying geometry, see the tangent line page.

Why It Converges Quadratically

Near a simple root α\alpha — where f(α)=0f(\alpha) = 0 and f(α)0f'(\alpha) \neq 0 — let the error at step nn be en=xnαe_n = x_n - \alpha. A Taylor expansion of ff around α\alpha gives:

en+1f(α)2f(α)en2e_{n+1} \approx \frac{f''(\alpha)}{2 f'(\alpha)} \, e_n^2


The new error is proportional to the square of the previous error. In practical terms, the number of correct digits roughly doubles at each iteration. Bisection, by contrast, halves the error per step, so its correct-digit count grows only linearly.

This explains the dramatic drop in the History table's error column when Newton succeeds, and why Newton's method is the workhorse for high-precision root finding. A handful of iterations from a good starting point routinely produces machine-precision accuracy.

When Newton's Method Fails

    Newton's method can break down in three common ways.

  • Flat tangent — if f(xn)f'(x_n) is small relative to f(xn)f(x_n), the correction f/ff / f' blows up and the next iterate lands far from the root. The Stalls scenario shows this directly: at x0=0.85x_0 = 0.85 the derivative f(x0)0.165f'(x_0) \approx 0.165 is too small, and x1x_1 is sent off the chart.
  • Cycles — for certain functions and starting points the iteration becomes periodic. A classic example is f(x)=x32x+2f(x) = x^3 - 2x + 2 with x0=0x_0 = 0, which oscillates between 00 and 11 forever.
  • Divergence — for slowly growing functions like arctan(x)\arctan(x), starting too far from the root makes xn|x_n| grow without bound rather than converge.

  • Production root finders defend against these failures by bracketing the root with bisection until the iterate enters a known basin of attraction, by capping the step size, and by falling back to a slower but more reliable method when Newton misbehaves.