Chapter 07 · Part III · Complex dynamics

Complex numbers, just enough

The Mandelbrot set is built from one tiny formula, z² + c, but the z and the c in it are complex numbers. You don't need a course in them. You need four pictures: a point in a plane, adding as sliding, multiplying as turning and stretching, and squaring as doubling the angle. This chapter draws all four, then lets you watch z² + c run.

i² = −1the one new rule; it means multiplying by i is a quarter turn
2the escape radius: once an orbit of z² + c gets farther than 2 from zero, it never comes back
−2 to ¼the stretch of the real line where the orbit of 0 under z² + c stays bounded

Common mix-up: "imaginary" doesn't mean fake, and i isn't a mysterious quantity you have to believe in. It's a direction. Real numbers live on a line; complex numbers live on a plane, and i is one step up. Everything strange about them is just geometry in two dimensions instead of one.

A second direction

Numbers with a direction

Ordinary numbers sit on a line. Zero in the middle, positives to the right, negatives to the left. Adding moves you along the line; multiplying by 2 stretches the line away from zero; multiplying by −1 flips it over. That's every move a real number can make: slide, stretch, flip.

Complex numbers add a second direction. Take the number line, lay it flat as the horizontal axis of a plane, and add a vertical axis through zero. Every point in that plane is a complex number. The point three steps right and two steps up is written 3 + 2i. The first part, 3, is the real part; the second, 2, is the imaginary part, and the letter i just marks which direction it goes. The number i itself is the point one step straight up from zero.

That's the complex plane. The real numbers you already know are still there, all along the horizontal axis: 5 is the complex number 5 + 0i. Nothing old was lost; the line just gained a dimension.

z = x + yi
A complex number z is a pair of ordinary numbers: x says how far right (the real part), y says how far up (the imaginary part). Plotted as a point, it's just (x, y).

The names are an accident of history. In 1545 Gerolamo Cardano's Ars Magna, a book on solving equations, ran into square roots of negative numbers and treated them as useless if unavoidable. Rafael Bombelli's L'Algebra (1572) worked out rules for calculating with them anyway, and showed that they could lead to perfectly real answers. René Descartes called such numbers "imaginary" in 1637, as a dismissal, and the word stuck.

The picture came much later. Caspar Wessel, a Norwegian-Danish surveyor, published the idea of numbers as points and arrows in a plane in 1799; Jean-Robert Argand did the same independently in 1806, which is why the complex plane is sometimes called the Argand plane. Carl Friedrich Gauss's use of the picture, and of the name "complex number" in 1831, made it standard. Once the numbers had a picture, they stopped being mysterious.

Go deeper: i is a rule, not a substance

The cleanest way to define complex numbers needs no square roots at all. In the 1830s William Rowan Hamilton described them as ordered pairs of real numbers (x, y), with addition done pair by pair and multiplication by the rule (a, b) × (c, d) = (ac − bd, ad + bc). Call the pair (0, 1) "i" and the rule gives (0, 1) × (0, 1) = (−1, 0). That's the whole of i² = −1: a consequence of a multiplication rule on pairs.

Why that rule? Because it's the one that makes multiplication rotate and scale, as the next sections show. And it keeps the familiar laws of arithmetic: you can add, subtract, multiply and divide (by anything but zero) and the usual algebra still works. The complex numbers are the only way to extend the real numbers into a plane and keep all of that.

Move one

Adding is sliding

To add two complex numbers, add the real parts and add the imaginary parts separately. (2 + 1i) + (−1 + 2i) = 1 + 3i. There's nothing more to it as arithmetic. As geometry, it's a slide.

Picture each number as an arrow from zero to its point. Adding b to a means: start at a, then move by b's arrow. The answer is where you end up. Do it the other way round, b first and then a, and you get to the same place; the two routes form the sides of a parallelogram, with the sum at the far corner.

So "add c" is a move you can apply to the whole plane at once. Every point slides by the same arrow, the same distance in the same direction. Nothing turns, nothing stretches. Keep that picture; it's the "+ c" half of z² + c.

Subtraction runs it backwards. a − b is the arrow that goes from b to a, and its length is the distance between the two points. That's how fractal programs measure "how close" two complex numbers are: the length of their difference.

(a + bi) + (c + di) = (a + c) + (b + d)i
Real parts add, imaginary parts add. Geometrically: put the arrows head to tail.
Move two

Multiplying is rotate-and-scale

Multiplication is where complex numbers earn their keep. As arithmetic, you multiply out the brackets as usual and replace i² with −1.

(a + bi)(c + di) = (ac − bd) + (ad + bc)i
Multiply every part by every part, as in ordinary algebra. The bi × di term is bd·i², which is −bd, so it lands in the real part.

That formula hides a beautiful picture. Describe a complex number not by how far right and how far up, but by two other numbers: its length, the distance from zero (written |z| and called the modulus), and its angle, measured counterclockwise from the positive real axis (called the argument). Then the rule for multiplying is:

lengths multiply · angles add
If a has length 2 at 30° and b has length 1.5 at 45°, then a × b has length 3 at 75°. Every complex multiplication is a rotation combined with a stretch.

Try it on i. Its length is 1 and its angle is 90°. Multiplying anything by i leaves the length alone and adds 90°: a quarter turn counterclockwise. Start at 1 and keep multiplying by i: 1, then i, then −1, then −i, then 1 again, going round the square. And i × i is a half turn from 1, which lands on −1. That's all i² = −1 means. The "impossible" square root of −1 is just a quarter turn: do it twice and you face the other way.

Multiplying by a real number is the special case with angle 0° (for positives) or 180° (for negatives): stretch, or stretch and flip. The flip of −1 was always a half turn; on the line we just couldn't see the turning.

Multiplying the whole plane by a fixed number w turns every point by w's angle and stretches every distance from zero by w's length. If w's length is bigger than 1, repeatedly multiplying by w spirals points outward; smaller than 1, inward; exactly 1, around in a circle forever. Keep that too: it's the "z²" half of z² + c.

Go deeper: why lengths multiply and angles add

Write a = r(cos α + i sin α) and b = s(cos β + i sin β), where r and s are the lengths and α and β the angles. Multiply with the formula above:

a × b = rs[(cos α cos β − sin α sin β) + i(sin α cos β + cos α sin β)]

The two brackets are exactly the angle-addition formulas from trigonometry: cos(α + β) and sin(α + β). So a × b = rs(cos(α + β) + i sin(α + β)), which is length rs at angle α + β. The complex multiplication rule is the trigonometric addition formulas in disguise.

Leonhard Euler packed this into one expression: cos θ + i sin θ = eiθ. With it, a = reiα, b = seiβ, and a × b = rs·ei(α+β). Exponents add when you multiply, and the exponent is the angle. Setting θ to 180° (π radians) gives the famous eiπ = −1.

Division undoes multiplication: divide the lengths, subtract the angles. Every complex number except 0 has a reciprocal, 1/z, with length 1/|z| and the opposite angle.

Instrument 1

Multiplication, visualized

Drag the two numbers a (blue) and b (pink). The gold arrow is the result. In multiply mode, watch the gold arrow's angle: it's always a's angle plus b's angle, shown as two colored arcs stacked end to end. Its length is always a's length times b's. Switch to add to see the parallelogram, or square to see a² double a's angle.

a–
b–
Result–
Check–

The dashed circle has radius 1. A number on it has length 1, so multiplying by it is a pure rotation. Points snap to the nearest 0.05 so you can land on exact values like i.

The move that matters

Squaring doubles the angle

Squaring is multiplying a number by itself, so the rule from the last section applies with a and b the same: the length gets multiplied by itself and the angle gets added to itself. In other words, squaring squares the length and doubles the angle.

z = r at angle θ ⟹ z² = r² at angle 2θ
A number at distance 1.1 and angle 20° squares to distance 1.21 and angle 40°. One at distance 0.9 and angle 100° squares to distance 0.81 and angle 200°.

Look at what that does to the whole plane. Every point's angle doubles, so the plane wraps around itself twice: as z goes once around a circle, z² goes around twice. And every distance gets squared, which pulls in and pushes out at the same time. Numbers inside the unit circle get closer to zero, because 0.9² = 0.81 is smaller than 0.9. Numbers outside get farther away, because 1.1² = 1.21. Numbers exactly on the unit circle stay on it.

Now iterate it: square, square the answer, square again. The lengths go r, r², r⁴, r⁸, r¹⁶… Start at length 0.9 and after ten squarings the length is 0.9¹⁰²⁴, about 10⁻⁴⁷: practically zero. Start at 1.1 and it's 1.1¹⁰²⁴, about 10⁴²: practically infinite. Squaring alone splits the plane into three fates: everything inside the unit circle falls into 0, everything outside flies off to infinity, and the circle itself is the knife-edge in between.

That circle is the simplest example of a Julia set, the boundary between "escapes" and "doesn't", for the formula z². It's perfectly smooth, not fractal at all. Add a constant c after each squaring, and the circle crumples into the shapes of Chapter 9.

Go deeper: angle doubling is a chaos machine

On the unit circle squaring keeps the length at 1, so all that changes is the angle, which doubles every time. Measure the angle in turns, from 0 to 1, and write it in binary: 0.b₁b₂b₃… Doubling shifts every digit one place left, and anything that crosses the "binary point" is a whole turn, which doesn't count. So each squaring simply deletes the first binary digit.

That's chaos in its purest form. Two angles that agree in their first 40 binary digits look identical, but after 40 squarings they're completely unrelated. An angle with a repeating binary expansion cycles; for example 1/3 of a turn is 0.010101… in binary, and doubling gives 2/3 = 0.101010…, then 1/3 again: a cycle of period 2. Angles with non-repeating expansions wander forever. Chapter 11 is about this kind of sensitivity.

How far is too far

|z| and the escape radius 2

The length of a complex number, |z|, is just Pythagoras: for z = x + yi, |z| = √(x² + y²). It's the distance from zero. A fractal program uses it constantly, to decide when a point has escaped.

Here's the question it answers. When we iterate z² + c, squaring and then adding c, some orbits run off to infinity and some don't. A computer can't run forever to find out which, so it needs a rule that says: past this distance, the orbit is gone for good. For z² + c that distance is 2, and the reason is short enough to give in full.

Suppose |z| is bigger than 2 and also at least as big as |c|. Squaring makes the length |z|². Adding c can pull it back toward zero by at most |c|, which is no more than |z|. So the new length is at least |z|² − |z|, which is |z| × (|z| − 1). Since |z| is bigger than 2, the factor |z| − 1 is bigger than 1. The length grows. And because it grows, the next factor is even bigger, so it grows faster, and the orbit runs away to infinity.

|z² + c| ≥ |z|² − |c| ≥ |z|(|z| − 1) > |z|
If |z| > 2 and |z| ≥ |c|, each step multiplies the distance by at least |z| − 1, which is more than 1. Distance only grows from there.

Does the condition |z| ≥ |c| get in the way? Not for the orbit we care about, which starts at z = 0. The first step gives z = c. If |c| is bigger than 2, the orbit is already past the radius with |z| = |c|, and it escapes. If |c| is 2 or less, then any later z with |z| > 2 automatically has |z| > |c|. Either way, the moment an orbit of 0 goes past distance 2, it's gone. That's why every Mandelbrot program tests |z| > 2, or, to save a square root, x² + y² > 4.

The rule works in one direction only. An orbit beyond 2 must escape; an orbit inside 2 might still escape later. Plenty of orbits wander inside the circle for hundreds of steps and then leave. So a program also needs a maximum number of steps and has to guess "probably stays" when it runs out. That guess is where the fuzziness at the edge of every Mandelbrot picture comes from.

Go deeper: why programs often use a bigger radius

2 is the smallest radius that is guaranteed to work for every c in the Mandelbrot set, but nothing stops a program from waiting until |z| passes 10, or 1,000. The extra steps cost almost nothing, because escaping orbits grow so fast: once |z| is past 2 it roughly squares every step, so the distance from 2 to 1,000 takes only a handful of iterations.

The reason to wait is color. The smooth coloring formula of Chapter 15, ν = n + 1 − log₂(log|zₙ|), estimates how far through its final step an orbit was, and the estimate is more accurate the larger |zₙ| is when you stop. With a bailout of 2 the bands are still faintly visible; with a large bailout they vanish.

Running the formula

Iterating z² + c: what an orbit is

Pick a complex number c. Start with z = 0. Square z and add c. Take the answer, square it and add c. Keep going. The list of numbers you get, z₀ = 0, z₁, z₂, z₃ and so on, is the orbit of 0 under z² + c.

Each step is the two moves from this chapter: square (turn by doubling the angle, stretch by squaring the length), then add c (slide). Try c = −1 by hand: 0, then 0² − 1 = −1, then (−1)² − 1 = 0, then −1 again. The orbit flips between 0 and −1 forever. Try c = 1: 0, 1, 2, 5, 26, 677… gone. Try c = i: 0, i, then i² + i = −1 + i, then (−1 + i)² + i = −2i + i = −i, then (−i)² + i = −1 + i, and it's stuck bouncing between −1 + i and −i.

Every orbit of z² + c does one of four things.

  • Escapes. It passes distance 2 and runs off to infinity, sometimes immediately, sometimes after hundreds of steps of hesitating.
  • Settles to a point. It spirals or zigzags in toward one number and stops moving, because that number satisfies z² + c = z.
  • Cycles. It settles into a loop that repeats every p steps: two points, three, four, or any number at all.
  • Wanders. It stays within distance 2 forever but never settles or repeats, darting around a bounded region in a pattern that never closes.

The c values whose orbit of 0 doesn't escape, the last three cases together, form the Mandelbrot set, the subject of the next chapter. Along the real line it's exactly the stretch from −2 to ¼. At c = ¼ the orbit creeps toward ½ without ever quite reaching it; at anything a hair bigger it eventually escapes, as c = 0.3 does after 12 steps.

cOrbit of 0What it does
00, 0, 0, …Sits still: 0 is a fixed point.
−0.50, −0.5, −0.25, −0.4375, …Zigzags in to the fixed point (1 − √3)/2 ≈ −0.366.
−10, −1, 0, −1, …Cycle of period 2, reached at once.
−0.1226 + 0.7449ispirals in to 3 pointsCycle of period 3 (the "Douady rabbit").
−1.3107approaches 4 pointsCycle of period 4.
i0, i, −1 + i, −i, −1 + i, −i, …Lands on a period-2 cycle after one step, then repeats exactly.
−1.8stays between −2 and 2No cycle found: wanders.
0.30, 0.3, 0.39, 0.45, …Creeps up, then escapes at step 12.
10, 1, 2, 5, 26, …Escapes at step 3.
Go deeper: why start at 0?

Zero is special for z² + c because it's the critical point: the one place where the map's derivative, 2z, is zero, so the map squashes its neighborhood flat instead of just turning and stretching it. Pierre Fatou and Gaston Julia, who studied iterated maps in 1917 to 1919, found that the critical point's orbit controls everything. In particular, every attracting cycle of z² + c pulls in the orbit of the critical point.

That's why one orbit is enough. If z² + c has any attracting cycle, of any period, the orbit of 0 will find it. And there can be at most one, since there is only one critical point to go round. So "what does the orbit of 0 do?" is a single question that decides the character of the whole map, which is exactly what the Mandelbrot set records for every c.

Where orbits come to rest

Fixed points and periods

A fixed point is a number that z² + c leaves where it is: z² + c = z. Rearranged, that's the quadratic z² − z + c = 0, so every c has two fixed points (which coincide when c = ¼).

z* = (1 ± √(1 − 4c)) ÷ 2
The two fixed points of z² + c. For c = 0 they are 0 and 1; for c = −0.5 they are about −0.366 and 1.366. The square root of a complex number is fine here; it's the number with half the angle and the square-root length.

Being fixed isn't enough to catch an orbit. What matters is whether nearby points get pulled in or pushed away. Close to z*, the map acts like multiplying the small offset by the derivative 2z*. That number is the fixed point's multiplier. If its length |2z*| is less than 1, nearby offsets shrink each step and the point is attracting: orbits that come near settle onto it. If it's more than 1, offsets grow and the point is repelling: orbits that come near are flung away.

For c = 0, the fixed point 0 has multiplier 0, as attracting as it gets; the fixed point 1 has multiplier 2, repelling. For c = −0.5, the fixed point −0.366 has multiplier length 0.73, attracting, which is why that orbit zigzags in to it. The c values where z² + c has an attracting fixed point form a heart-shaped region, the main cardioid: the big body of the Mandelbrot set.

A cycle of period p is a set of p points that the map visits in turn, coming back to the start after exactly p steps. It's a fixed point of the map applied p times. Its multiplier is the product of 2z over all the points in the cycle. Again, length less than 1 means attracting. For c = −1 the cycle {0, −1} has multiplier 2·0 × 2·(−1) = 0, superattracting. For c = i the cycle {−1 + i, −i} has multiplier length about 5.66: repelling. The orbit of 0 lands on it exactly, but any orbit that merely came close would be thrown off.

Period-2 cycles are attracting exactly when |c + 1| < ¼, a small disc centered at −1 that touches the cardioid at c = −¾. That's the second-largest bulb of the Mandelbrot set. Every other bulb is the home of attracting cycles of one particular period, which is how the next chapter labels them.

Behavior of 0's orbitMultiplierWhere c lives
Settles to a point|2z*| < 1Inside the main cardioid
Cycle of period 2|4(c + 1)| < 1The disc |c + 1| < ¼
Cycle of period p|product of 2zⱼ| < 1One of the bulbs and smaller copies of the set
Escapes(no attracting cycle)Outside the Mandelbrot set
Go deeper: where the period-2 disc comes from

A period-2 point satisfies f(f(z)) = z, where f(z) = z² + c. That equation has degree 4, but it contains the two fixed points, which trivially satisfy it. Divide them out (divide by z² − z + c) and what's left is z² + z + c + 1 = 0. Its two roots, z₁ and z₂, are the period-2 cycle.

The multiplier is 2z₁ × 2z₂ = 4z₁z₂, and the product of a quadratic's roots is its constant term, c + 1. So the multiplier is 4(c + 1). The cycle is attracting when |4(c + 1)| < 1, that is, |c + 1| < ¼: a disc of radius ¼ around −1.

The main cardioid has a similar formula. Write the fixed point's multiplier as μ = 2z*, with |μ| < 1. Then z* = μ/2, and the fixed-point equation gives c = z* − z*² = μ/2 − μ²/4. Let μ run around the unit circle and c traces the cardioid's outline.

Instrument 2

An orbit plotter

Drag the pink c anywhere in the plane. The blue path is the orbit of 0 under z² + c, one segment per step; the slider sets how many steps are drawn, and Play walks through them. The faint shape behind is the Mandelbrot set, the c values whose orbit stays bounded, so you can see where you are. The verdict underneath runs the orbit for up to 4,000 steps and looks for escape or a repeating cycle.

c–
z at this step–
|z|–
Fixed points z* and their |2z*|–

The dashed circle is the escape radius, |z| = 2. Small crosses mark the two fixed points; a filled one is attracting. When an orbit escapes, its last segments leave the picture.

Cheat sheet

Terms from this chapter

Complex number
A point in a plane, written x + yi: x steps right, y steps up.
i
The number one step straight up from zero. Multiplying by it is a quarter turn, so i² = −1.
Real / imaginary part
The x and the y of x + yi.
Modulus |z|
The distance from zero: √(x² + y²). Also called the length or absolute value.
Argument
The angle of z, measured counterclockwise from the positive real axis.
Escape radius
A distance beyond which an orbit is certain to run to infinity. For z² + c, 2 works.
Orbit
The sequence z₀, z₁, z₂, … you get by applying a map over and over. Here, the orbit of 0 under z² + c.
Fixed point
A number the map leaves unchanged: z² + c = z.
Cycle, period
A loop of points the orbit visits in turn; the period is how many.
Multiplier
The product of 2z around a cycle. Length below 1: attracting. Above 1: repelling.
Critical point
Where the map's derivative is zero. For z² + c, that's 0, which is why its orbit is the one we follow.
Where this comes from

Sources