The Newton Fractal, Explained
After reading this you will know why Newton's method, one of the fastest root finders ever written, produces a shattered fractal when you ask which root it reaches, and you will be able to reproduce the demo image by hand for a few pixels.
What the Newton fractal is
Newton's method takes a guess at a root of a function and improves it. For a nice function and a good starting guess, it doubles the number of correct digits at every step. That speed is why it appears in almost every numerical library.
The twist is this: a polynomial has several roots, and Newton's method will race toward one of them, but which one depends on where you start. Colour every starting point in the complex plane by the root it eventually reaches, and the plane splits into regions called basins of attraction. Deep inside a basin the answer is stable. Along the borders between basins, the answer is anything but. Two starting points a millionth of a unit apart can land on different roots. That sensitivity is the fractal.
The standard picture uses the polynomial z^n - 1, whose roots are the nth roots of unity, spaced evenly around the unit circle. For n = 3 you get three roots and three colours, and the boundary between them is an infinitely detailed lace where all three colours meet at every scale.
Every point on a basin boundary borders all of the basins at once. There is no place on the boundary where only two colours meet. This is a genuine theorem about Julia sets, not an artefact of low resolution, and it is what makes the edges look like they are made of ever-smaller copies of themselves.
When this picture is worth drawing
Draw the Newton fractal when you want to see how a deterministic algorithm can still be unpredictable in practice. The rule has no randomness in it. Given a starting point, the outcome is fixed forever. Yet near the boundary you cannot predict the outcome without effectively running the full computation, because the answer changes faster than you can measure the input.
It is also a clean way to meet a Julia set without the machinery of complex dynamics. The boundary of the basins is exactly the Julia set of the Newton iteration map, so the same fractal that shows up for the Mandelbrot Explorer and the Julia Set Explorer appears here from a familiar algorithm.
Do not read the picture as a statement about real physical systems. It is a toy. The same visual idea, a plane coloured by final destination, drives the Magnetic Pendulum Fractal, and there the physics is a rough caricature of a real pendulum. Treat both as demonstrations of sensitive dependence, not as predictions.
The formula and why it iterates
Newton's method updates a guess z by the rule below.
Here f(z) is the function whose root you want and f'(z) is its derivative. The fraction is the correction: it is the horizontal distance from your guess to where the tangent line at z_k crosses zero. You slide to that crossing and repeat.
For the standard fractal, take f(z) = z^n - 1, so f'(z) = n z^{n-1}. Substituting gives a clean update.
Everything is a complex number. A point z = x + iy is a pixel at coordinates (x, y). You iterate until z_k lands within a small tolerance of one of the n roots, then colour the original pixel by which root it hit. The number of steps it took becomes the brightness.
The three cube roots of unity are 1, -0.5 + 0.8660 i, and -0.5 - 0.8660 i. The imaginary part is \sin(120^\circ) = \sqrt{3}/2 \approx 0.8660. Keep these three numbers handy to check which basin a pixel fell into.
A worked example with the demo settings
The demo uses the defaults: degree n = 3, so f(z) = z^3 - 1. Pick the starting point z_0 = 0.6 + 0.6 i and iterate by hand to see which root claims it.
Iterating z³ = 1 from 0.6 + 0.6i
The update is z_{k+1} = \frac{2 z_k^3 + 1}{3 z_k^2}. Work in rectangular form, rounding to four decimals.
- Start: z_0 = 0.6 + 0.6 i. Compute z_0^2 = 0 + 0.72 i and z_0^3 = -0.432 + 0.432 i. Then 2 z_0^3 + 1 = 0.136 + 0.864 i and 3 z_0^2 = 0 + 2.16 i. Dividing gives z_1 = 0.4 - 0.0630 i.
- From z_1 = 0.4 - 0.0630 i: the iterate jumps outward to about z_2 = 1.038 + 0.2213 i.
- Next: z_3 \approx 0.9563 + 0.0857 i, already close to the root at 1.
- Next: z_4 \approx 0.9996 + 0.0022 i. The distance to 1 is about 0.0022.
- Next: z_5 \approx 1.0000 + 0.0000 i, inside any sensible tolerance.
So z_0 = 0.6 + 0.6 i converges to the root 1 in about 5 iterations. Colour that pixel with the colour for root 1, and set its brightness from the count 5. A pixel that took 12 steps would be darker or lighter depending on the shading direction, and that gradient is what draws the onion layers.
Now shift the start slightly to z_0 = 0.6 + 0.62 i. Deep inside a basin nothing changes, but choose a start near the boundary and a nudge of 0.02 can flip the destination to a different root entirely. That is the whole story in one experiment.
What the colours and brightness mean
Two channels carry information in the image. The hue tells you the destination: which of the n roots the starting point reached. The brightness tells you the effort: how many iterations it took to get within tolerance.
Solid blocks of colour are the interiors of basins, where convergence is fast and stable. The thin, endlessly branching regions are the boundary, where iteration counts climb and colours interleave. If you darken by convergence speed, the slow points near the boundary form nested bands. Each band is a set of starting points that all needed roughly the same number of steps, and the bands nest because getting one step closer to the fast interior means crossing a whole layer of the fractal.
| Degree n | Number of roots | Colours in image | Rotational symmetry |
|---|---|---|---|
| 2 | 2 | 2 | 2-fold |
| 3 | 3 | 3 | 3-fold |
| 4 | 4 | 4 | 4-fold |
| 5 | 5 | 5 | 5-fold |
For n = 2 there is no fractal at all: the plane splits cleanly into the left and right half-planes along the imaginary axis, because every point simply falls toward the nearer of the two roots. The fractal needs at least three roots, since with three or more destinations the boundary can no longer be a smooth line.
Common mistakes when reading the image
The first mistake is trusting the boundary at any fixed resolution. Zoom in and the same interleaving of colours reappears, so a pixel that looks like it belongs to the red basin may split into all three colours at ten times the magnification. The boundary has zero area but infinite detail. Any single image is a truncation.
The second mistake is setting the iteration budget too low. If you allow only 10 steps, points near the boundary that need 30 or 40 steps never reach tolerance, and they get painted as "did not converge." Raise the budget and those regions fill in with real colour. The demo default of 40 iterations is enough for the default view, but a deep zoom needs more.
Not every polynomial converges everywhere. For some functions Newton's method has starting points that fall into a repeating cycle and never reach any root. For z^n - 1 the non-converging set has zero area, so it does not spoil the picture, but if you edit the polynomial you may create whole basins that cycle forever. Those points will stay black no matter how large you make the budget.
The third mistake is confusing brightness with distance from a root. Brightness encodes iteration count, not spatial distance. Two pixels the same distance from a root can have very different counts, because the path each one takes wanders before it converges.
Related tools on this site
To see the same Julia set boundary arise from a different iteration, open the Julia Set Explorer or zoom the Mandelbrot Explorer. For sensitive dependence dressed as physics rather than algebra, the Magnetic Pendulum Fractal colours the plane by which of three magnets a pendulum stops at.
If you want to compare root finders step by step rather than paint the whole plane, the Root-Finding Visualizer races bisection, Newton and the secant method on a single function. For fractal dimension of the boundary you draw here, the Box-Counting Dimension Lab measures the slope of a log-log line. And for a different route into chaos from a simple rule, the Logistic Map Bifurcation and the Lorenz Attractor both show order dissolving as one parameter moves.
Frequently asked questions
Why does Newton's method find a different root when I move the start a little?
Because starting points near a basin boundary sit on the Julia set of the iteration, where the map is chaotic. A displacement of 0.02 can send the first iterate to a wildly different place, and from there the trajectory settles on a different root. Inside a basin, away from the boundary, small moves change nothing.
What polynomial makes the classic three-colour fractal?
The function f(z) = z^3 - 1, with roots 1, -0.5 + 0.8660 i, and -0.5 - 0.8660 i. Three roots is the smallest number that forces a fractal boundary. Degree 2 gives a straight dividing line instead.
Why are some pixels black?
Black usually means the point did not converge within the iteration budget. Raise the maximum iterations and most black pixels near the boundary fill in. A few points genuinely never converge because they fall into a cycle, but for z^n - 1 those are vanishingly rare.
Is this the same as the Mandelbrot set?
No, but they are cousins. Both come from iterating a complex map and colouring by outcome. The Mandelbrot set colours parameter values by whether one orbit escapes to infinity. The Newton fractal colours starting points by which root the orbit settles on. The boundary in both cases is a Julia set with self-similar detail.
How fast does Newton's method actually converge?
Quadratically once you are close to a simple root: the error at step k+1 is roughly proportional to the square of the error at step k. In the worked example the distance to the root went 0.0928, then 0.0022, then about 5 \times 10^{-7}: each step roughly squares the last, so the digit count doubles.