Newton's method
Pick a function and tap anywhere on the graph to choose a starting x₀. Newton's method draws the tangent at (x₀, f(x₀)), follows it down to the x-axis, and calls the landing spot x₁. Then it repeats. Watch the steps animate and the table fill in: when it works, the number of correct digits roughly doubles each step. Then switch the view to basins of z³ − 1: the same recipe in the complex plane, with every starting point coloured by which of the three cube roots of 1 it ends up at. Tap a point to see its route.
Mission. Pick f(x) = x³ − 2x + 2 and start exactly at x₀ = 0 (tap near the y-axis; the start snaps to the nearest 0.1). Before it runs, work out x₁ by hand: f(0) = 2, f′(0) = −2. Then predict x₂.
Answer
x₁ = 0 − 2/(−2) = 1. At x = 1, f = 1 and f′ = 1, so x₂ = 1 − 1 = 0. Newton is stuck in a loop 0, 1, 0, 1, … and never finds the root near −1.77. Start at 0.1 instead and it is pulled into the same loop, because the loop attracts nearby starts. Start at 0.5 and it finds the root. Extension: pick arctan x and find, by trial, the largest start that still converges to 0. (It is about 1.39. Beyond it each step overshoots to a larger |x| than before.)
What's going on
The tangent at xₙ is the line y = f(xₙ) + f′(xₙ)(x − xₙ). It crosses the axis where that is zero, so xₙ₊₁ = xₙ − f(xₙ)/f′(xₙ). Near a simple root the curve looks like its tangent, so the landing spot is far closer to the root than xₙ was. Write the error as eₙ = xₙ − r; a little Taylor expansion gives eₙ₊₁ ≈ (f″/2f′) eₙ², which is why the number of correct digits doubles each step. For x² − 2 starting at 1 the iterates are 1.5, 1.41667, 1.41422, 1.41421356…, and this is how a calculator finds square roots.
It can also go wrong. If f′(xₙ) is near zero the tangent is nearly flat and sends you far away. x³ − 2x + 2 has a starting point that cycles forever. arctan x has a horizon beyond which every step is worse than the last. Newton's method is fast, not safe.
In the complex plane the same formula z ↦ z − (z³ − 1)/(3z²) has three roots to choose from. Start near one and you converge to it. But the boundary between the three basins is not a tidy set of lines: zoom in anywhere on it and all three colours are present. Points near it end up at a root that has nothing to do with which one they were closest to. This picture is a fractal, and it is the reason "the nearest root" is the wrong way to think about where Newton's method goes.
Sheets: Reading a curve from its derivatives and Why every polynomial has a root.