Divergence: Sources and Sinks
Look at a vector field — arrows everywhere. Now imagine placing a tiny box at some point. Divergence measures: is more stuff flowing out of the box than into it?
- Positive divergence = a source. More flows out than in. Like air escaping from a punctured balloon.
- Negative divergence = a sink. More flows in than out. Like water draining down a plughole.
- Zero divergence = balanced. What flows in, flows out. Like an incompressible fluid.
The intuition
Divergence at a point is the “net outflow per unit volume” from an infinitesimally small region around that point.
Think of dropping a small cork into a river: - Near a spring (source): water pushes the cork away — positive divergence. - Near a drain (sink): water pulls the cork in — negative divergence. - In a steady, uniform current: water carries the cork along but doesn’t spread or compress — zero divergence.
Hover over the vector field. The coloured region shows the local divergence — red for sources (positive), blue for sinks (negative), grey for zero.
The formula
In two dimensions, the divergence of $\mathbf{F} = (F_x, F_y)$ is:
$$\nabla \cdot \mathbf{F} = \frac{\partial F_x}{\partial x} + \frac{\partial F_y}{\partial y}$$
Each term asks: “how much does the $x$-component change as you move in $x$?” and likewise for $y$. If both components are spreading out, divergence is positive.
For the source field $\mathbf{F} = (x, y)$: $\nabla \cdot \mathbf{F} = 1 + 1 = 2$. Positive everywhere — it’s a source at every point.
For the vortex $\mathbf{F} = (-y, x)$: $\nabla \cdot \mathbf{F} = 0 + 0 = 0$. The field swirls, but nothing is created or destroyed.
Why divergence matters
Divergence appears in two of Maxwell’s four equations:
- Gauss’s law: $\nabla \cdot \mathbf{E} = \rho / \varepsilon_0$ — electric charge is a source of electric field
- Gauss’s law for magnetism: $\nabla \cdot \mathbf{B} = 0$ — there are no magnetic charges (monopoles)
The divergence tells you where fields originate. Electric fields originate at charges. Magnetic fields originate... nowhere. They always form closed loops.
These optional nodes cover specific concepts in more detail: