Paritian

Mathematics

Newton-Raphson Calculator

A root of any function by Newton's method, with the full iteration table and an honest verdict on convergence.

Results

The root 1.414213562370
Did it converge? Yes
Every step of the way 0 1 -1 2 1 1.5000000000 0.2500000000 3 2 1.4166666667 0.0069444444 2.8333333333 3 1.4142156863 0.0000060073 2.8284313726 4 1.4142135624 0 2.8284271248 5 1.4142135624 0 2.8284271248
What the function gives at that root 4.44089e-16
Steps it actually took 6
The derivative it used 2x
How the page read it x^2 - 2

What this tool does

Most equations cannot be solved with algebra, and Newton's method is how they get solved instead: stand at a guess, follow the tangent line down to the axis, and stand there instead. When it works it is spectacular, doubling the number of correct digits every step. When it does not — no real root, a flat derivative, a bad starting point — it wanders off, and the honest thing is to say so. This page shows every iteration so you can watch which is happening, and computes the derivative symbolically rather than approximating it.

Formula

xₙ₊₁ = xₙ − f(xₙ) ÷ f′(xₙ)

Variables

SymbolMeaningUnit
exprThe function f(x)
startStart from
stepsAt most this many steps
RTThe root
CVDid it converge?
TBEvery step of the way
RSWhat the function gives at that root
SUSteps it actually took
DVThe derivative it used
INHow the page read it

Worked example

  • The function f(x)x^2 - 2
  • Start from1
  • At most this many steps20
  • The root1.414213562370
  • Did it converge?Yes
  • Every step of the way0 1 -1 2 1 1.5000000000 0.2500000000 3 2 1.4166666667 0.0069444444 2.8333333333 3 1.4142156863 0.0000060073 2.8284313726 4 1.4142135624 0 2.8284271248 5 1.4142135624 0 2.8284271248
  • What the function gives at that root4.44089e-16
  • Steps it actually took6
  • The derivative it used2x
  • How the page read itx^2 - 2

Limitations

  • The calculation runs entirely in your browser. The values you type are never sent to a server.

Frequently asked questions

Why does it sometimes fail to converge?

Because Newton's method is fast but not safe. It follows the tangent line down to the axis and jumps there, which doubles the number of correct digits at each step when it works — and throws you across the country when it does not. It fails when there is no real root at all, when the derivative is near zero so the tangent is nearly flat, or when the starting guess is on the wrong side of a turning point. The table shows every step, so you can see it converging or running away rather than just getting a number. When it does not converge the page says so instead of showing the last value.

Where does the derivative come from?

It is worked out symbolically from the function you typed, not estimated from nearby points. That matters: a derivative taken by finite differences carries its own error, and near the root — where f is tiny — that error is proportionally huge and can stop the method converging to full precision. The derivative used is shown so you can check it, and it is the same exact expression the derivative page would give you.