Newton–Raphson Method
Visualize root-finding through tangent-line iteration \(x_{n+1}=x_n-m\,f(x_n)/f'(x_n)\) — watch quadratic convergence, study multiplicity, and explore failure modes step by step.
What Is Newton's Method?
Newton–Raphson finds roots of \(f(x)=0\) by replacing the curve with its tangent line at each iterate:
The animated ball rises vertically from \(x_n\) on the axis up to the curve at \((x_n,f(x_n))\), then travels along the orange tangent line back down to \(x_{n+1}\) on the axis. Completed steps fade to grey so the current step stays prominent.
Convergence — Simple Roots
If \(f'(x^*)\ne0\), convergence is quadratic — the error squares at each step, doubling correct digits. Typically 4–6 iterations from a nearby guess:
Multiple Roots & Modified Newton
A root of multiplicity \(m\ge2\) makes standard Newton converge only linearly with rate \(1-1/m\). Multiplying the step by \(m\) restores quadratic convergence:
Failure Modes
- Zero derivative: \(f'(x_n)=0\) — step undefined.
- Oscillation / 2-cycle: e.g.\ \(x_0=0\) for \(x^3-2x+2\) gives \(0\to1\to0\to\cdots\)
- Divergence: No real root (e.g.\ \(x^2+1\)) — iterates escape to infinity.
- Wrong root: Starting far from the target may converge to a different root.
How to Interact
- Click the canvas to place \(x_0\). Scroll to zoom, drag to pan, double-click to reset.
- Play runs the animated sequence. Step advances one tangent. All shows everything.
- Zoom to root snaps the view to the convergence region.
Keyboard shortcuts: Press P to play or stop animation. Press S to step one iteration. Press R to reset. Press A to show all steps at once.
Use the dropdown to select an example function, or type a custom function below.
Newton–Raphson diagram. Current example: x squared minus 2. Starting point x₀ is 6.0. No steps shown yet. Click diagram to set a new starting point. Scroll to zoom, drag to pan, double-click to reset view.
| \(n\) | \(x_n\) | \(f(x_n)\) | \(f'(x_n)\) | \(|e_n|\) | \(|e_n|/|e_{n-1}|\) | \(|e_n|/|e_{n-1}|^2\) |
|---|
Red: current. Green: converged (\(|e_n|<10^{-8}\)).
Convergence Classification
▲ Quadratic (simple root)
\(f'(x^*)\ne0\). Digits double each step. Slope \(\approx2\) on log-error plot.
↗ Linear (multiple root, standard)
Rate \(1-1/m\). Slow staircase. \(|e_{n+1}|/|e_n|^2\to\infty\).
▲ Quadratic restored (modified)
Modified Newton, correct \(m\): quadratic convergence again. Sharp elbow on log plot.
★ Exact in 1 step
Pure power root \((x-a)^m\) with modified Newton, exact \(m\): converges immediately.
⇌ Oscillation / 2-cycle
Iterates bounce. Log-error oscillates without decreasing.
⌇ Divergence
No real root (e.g. \(x^2+1\)). Tangent lines escape. Error grows.