Afterglowscreensavers

Newton's Method Root Finder Screensaver

The Newton's Method Root Finder screensaver runs a real live Newton's method, drawing the tangent line at each guess as it converges on a root of a random polynomial. It is free, runs in your browser, and ESC exits.

Live preview

Newton's Method Root Finder screensaver — A real tangent line, converging on a function's root.

Press ESC to leave fullscreen. Settings are saved in your browser only.

How the Newton's Method Root Finder screensaver works

The saver plots a real random polynomial curve, then starts Newton's method from a random initial guess.

At each step, the real tangent line at the current guess is drawn, and the next guess is exactly where that tangent line crosses zero.

Each new guess is usually far closer to a true root than the last, exactly the fast real convergence Newton's method is known for.

Once the guess settles on a real root to high precision, it holds briefly, then a fresh random polynomial and starting guess begin.

Newton's method and quadratic convergence

Newton's method, also called the Newton-Raphson method, finds a root of a function by repeatedly replacing the curve with its tangent line. Starting from a guess, you draw the tangent at that point, see where it meets the horizontal axis, and use that crossing as the next guess. The algebraic form is a single line: new guess equals old guess minus the function value divided by its derivative.

Newton treated the idea in his De analysi, written in 1669 but not published until 1711, and Joseph Raphson published a simplified description in 1690 in terms of successive approximations. A special case for square roots, the Babylonian method, was known since ancient times. For a simple root the convergence is at least quadratic near the root: the number of correct digits roughly doubles each step, so a handful of iterations can give high precision.

The method has caveats. It needs the derivative, and it fails if the derivative is zero at a guess, because the tangent never crosses the axis. A poor start may send the iteration to a different root, loop or diverge. At a root of multiplicity greater than one, convergence is only linear unless the method is modified. Applied to complex numbers, the sets of starting points that lead to each root form intricate boundaries known as Newton fractals.

A worked example

A guess that starts far from any root can swing wildly on the first tangent step, then rapidly snap closer and closer to the true root within just a handful of real iterations.

Settings & tips

Frequently asked questions

Is this real Newton's method?
Yes — a real, correct implementation, with every tangent line drawn exactly where the algorithm actually places it.
Can it ever fail to converge?
Yes — real Newton's method can diverge or cycle for some starting guesses; the saver simply restarts fresh when that happens.
Is a key needed?
No — it is a pure local computation.
Is it free?
Yes — free, no download, in your browser.
What does quadratic convergence mean?
Near a simple root, the error is roughly squared at each step, so the count of correct digits roughly doubles. It is very fast once the guess is close.
What happens if the derivative is zero?
The tangent is horizontal and never meets the axis, so the formula breaks down. Practical solvers then switch to another method or perturb the guess.
What are Newton fractals?
They are images made by colouring each starting point in the complex plane by which root the iteration reaches. The borders between the regions are fractal.

← All Science & Research screensavers