The idea: divergence is spread, curl is spin
A vector field F = (P, Q) gives a velocity at every point, like wind on a weather map. Near one point p the flow can do two different things to a tiny blob of air: make it bigger or smaller (it spreads out or squeezes in), and turn it (it spins). Two numbers measure them:
div F = ∂P/∂x + ∂Q/∂y spread: > 0 source, < 0 sink
curl F = ∂Q/∂x − ∂P/∂y spin: > 0 anticlockwise, < 0 clockwise
On the canvas the grey arrows are F on the square [−2.5, 2.5]². The yellow circle of radius 0.3 is the probe at p. Measure splits the flow on its rim into spread and spin; Release Dust puts 12 dust grains on the rim and a paddle wheel at p and lets them drift.
Reading the formulas
∂P/∂x asks: does the sideways speed grow as you move sideways? If so, the air ahead runs away from the air behind and the gap grows. ∂Q/∂y is the same up and down. Together they are the spread. ∂Q/∂x asks: does the upward speed grow to the right? Then the right side rises and the left side sinks, which turns the blob anticlockwise. ∂P/∂y growing upward turns it clockwise, so it is subtracted. The six fields on the page:
| field | F = (P, Q) | ∂P/∂x | ∂Q/∂y | ∂Q/∂x | ∂P/∂y | div | curl |
|---|---|---|---|---|---|---|---|
| source | (x, y) | 1 | 1 | 0 | 0 | 2 | 0 |
| rotation | (−y, x) | 0 | 0 | 1 | −1 | 0 | 2 |
| shear | (y, 0) | 0 | 0 | 0 | 1 | 0 | −1 |
| vortex at (1, 0) | (−y, x)/(x² + y²) | 0 | 0 | −1 | −1 | 0 | 0 |
| spiral sink | (−x − y, x − y) | −1 | −1 | 1 | −1 | −2 | 2 |
| saddle | (x, −y) | 1 | −1 | 0 | 0 | 0 | 0 |
Every field except the vortex is linear, so div and curl are the same at every point: pick another p and the panel shows the same numbers. The vortex's partials change from point to point, but away from the origin they always cancel to div 0 and curl 0.
Flux and circulation per unit area
Split each arrow on the rim into a part across the rim (along the outward normal n) and a part along the rim (along the tangent t). Adding up the first part all the way round is the flux out of the circle; adding up the second is the circulation round it. Divide by the area and shrink the circle:
div F(p) = lim (1 / area) ∮ F · n ds flux out per unit area
curl F(p) = lim (1 / area) ∮ F · t ds circulation per unit area
The panel shows both: for the source at (1, 0), flux ÷ area = 2.000 = div F, and circulation ÷ area = 0.000 = curl F. For the linear fields the circle of radius 0.3 already gives the exact limit. (Demo 1: source, spreads out, no spin)
Ride along: take away F(p)
A uniform flow, the same arrow everywhere, carries the probe along without changing it: what enters on one side leaves on the other, and it pushes the top and bottom of the rim the same way. It adds 0 to the flux and 0 to the circulation. So the page draws F − F(p) on the rim, the flow seen by someone riding along with p. For the source at (1, 0), F(p) = (1, 0) is a strong push to the right, but after taking it away the 8 arrows all point straight out.
The dust ring and the paddle wheel
Let the flow carry the 12 grains for a time t. Divergence is the rate the area grows, so a ring's area goes × e^(div·t). Curl is twice the rate a tiny paddle wheel turns, so the wheel turns curl/2 · t radians:
| demo | t | ring area × | wheel turned |
|---|---|---|---|
| 1 source | 0.5 | e^(2 × 0.5) = 2.718 | 0° |
| 2 rotation | 1.5 | 1.000 | 1 × 1.5 rad = 85.9° |
| 3 shear | 1.5 | 1.000 | −0.5 × 1.5 rad = −43.0° |
| 4 vortex | 0.8 | ≈ 1.000 | 0° |
| 5 spiral sink | 0.6 | e^(−2 × 0.6) = 0.301 | 1 × 0.6 rad = 34.4° |
| 6 saddle | 0.6 | 1.000 | 0° |
The spiral sink does both at once: the ring shrinks to 0.301 of its area while the wheel turns 34.4° anticlockwise. (Demo 5: spiral sink, both at once)
Two surprises: shear and the vortex
Spin is not the same as going round. In the shear F = (y, 0) every streamline is a straight horizontal line, yet the top of the wheel is pushed faster than the bottom, so it turns clockwise: curl −1 (Demo 3: shear, straight flow that spins). In the drain vortex F = (−y, x)/r² the water goes round the origin, but it is slower on the outside in just the right way: a wheel carried round the drain keeps its red blade pointing the same way. Its curl is 0 everywhere except at the origin itself (Demo 4: vortex, goes round, no spin). The saddle stretches the ring one way and squeezes it the other, which is neither spread nor spin (Demo 6: saddle, stretched, neither).
In three dimensions
For F = (P, Q, R) the divergence gets a third term and the curl becomes a vector, the axis the paddle wheel would spin about, with length its spin rate × 2:
div F = ∇ · F = ∂P/∂x + ∂Q/∂y + ∂R/∂z
curl F = ∇ × F = (∂R/∂y − ∂Q/∂z, ∂P/∂z − ∂R/∂x, ∂Q/∂x − ∂P/∂y)
The 2D curl on this page is the z part of the 3D one. Two rules hold for any smooth field: the curl of a gradient is 0 (a slope field has no spin), and the divergence of a curl is 0. Summed over a region instead of a tiny circle, divergence gives the divergence theorem (flux out of the boundary = div summed inside) and curl gives Green's and Stokes' theorems (circulation round the boundary = curl summed inside). The six kinds of integral behind those sums are on Six Types of Integrals, and the dot product F · n is on Vectors and the Dot Product.
What the page leaves out
3D fields on the canvas (the 3D formulas are only in the text), the curl as a vector, fields whose partials are not continuous, the point sources and line vortices where div or curl is infinite (the vortex's origin), the full divergence, Green's and Stokes' theorems, the Laplacian div grad f, and the Helmholtz split of a field into a curl-free part and a divergence-free part.