Newton’s Method
Click on the plot to set an initial guess and watch the tangent-line iterations converge to a root. Different starting points may lead to different roots — click many times to paint the basins of attraction.
| n | xn | f(xn) | |error| |
|---|---|---|---|
| Click to start | |||
How it works
Newton’s method (also called Newton-Raphson) is one of the most powerful root-finding algorithms in mathematics. Starting from an initial guess x₀, each iteration draws the tangent line to the function at the current point and takes the x-intercept of that tangent line as the next guess. The formula is simple: xn+1 = xn − f(xn)/f′(xn).
When it works well, Newton’s method converges quadratically — the number of correct digits roughly doubles with each step. Finding √2 to 15 decimal places takes only about 5 iterations. But the method can also behave chaotically. For functions with multiple roots, the choice of starting point determines which root the method converges to, creating intricate “basins of attraction” with fractal boundaries.
Try x³ − x and click the “Paint Basins” button. The three roots at x = −1, 0, and 1 each claim regions of the x-axis, and the boundaries between these regions can be surprisingly complex. Points near a boundary may take many iterations to converge, or may bounce unpredictably between regions before settling.
The method can fail when it encounters a point where f′(x) = 0 (a horizontal tangent), or when the iterates enter a cycle. These pathologies are visible in the visualization as divergent or oscillatory paths. Understanding where the method fails is as instructive as seeing where it succeeds.