Multivariable Calculus · Divergence

Divergence

The divergence of a vector field at a point is the net outflow per unit area from a tiny region around it, div F = ∂P/∂x + ∂Q/∂y. Shrink a circle onto the point and watch flux ÷ area settle.

01

Divergence in this visualization

The divergence of a plane vector field F=(P,Q)\mathbf F = (P, Q) is the scalar div⁡F=∇⋅F=∂P/∂x+∂Q/∂y\operatorname{div}\mathbf F = \nabla\cdot\mathbf F = \partial P/\partial x + \partial Q/\partial y, defined where F is continuously differentiable. What it measures is the net outflow per unit area — sometimes called the source density. Round a small circle of radius r about p, add up the outward normal component F⋅n\mathbf F\cdot\mathbf n along the rim (the flux Φ) and divide by the area:

Divergence as a limit
div⁡F(p)=lim⁡r→01πr2∮F⋅n ds\operatorname{div}\mathbf F(p) = \lim_{r\to 0}\frac{1}{\pi r^2}\oint \mathbf F\cdot\mathbf n\,ds

The ticks on the rim are F·n: solid outward, hollow inward, one scale per circle. For a smooth field the ratio differs from the divergence by a multiple of r², so each halving of r divides the gap by about four; in a linear field it equals the divergence for every circle. The shape does not matter: a square about p gives the same limit. A drop of ink makes the meaning visible — a small fluid patch carried by the flow grows in area at the relative rate div F; a patch of finite size, followed for a finite time, measures an average of it.

Cut a region into cells and add their outflows: across every inner edge one cell's outflow is its neighbour's inflow, so only the boundary is left. Letting the cells shrink turns the sum into the divergence theorem (the flux form of Green's theorem): ∮∂DF⋅n ds=∬Ddiv⁡F dA\oint_{\partial D}\mathbf F\cdot\mathbf n\,ds = \iint_D \operatorname{div}\mathbf F\,dA, for a bounded region with a piecewise smooth boundary in which F is continuously differentiable. In three dimensions the same statement is Gauss's theorem, with surfaces and volumes.

02

Things to notice

  • Divergence is not about which way the arrows point. The point source (x,y)/(x2+y2)(x, y)/(x^2 + y^2) points outward everywhere yet has divergence 0 away from the origin; every circle round the origin lets out 2π, because the whole source sits at the origin, where the field is not defined (in the sense of distributions, its divergence there is 2π times a delta). The field (x2,0)(x^2, 0) points right everywhere, yet has sources where it speeds up and sinks where it slows down.
  • Fast flow is not divergence: the saddle (x,−y)(x, -y) squeezes a drop flat but keeps its area. How the flow turns along the rim, F·T, is the curl's question (E26).
  • The divergence comes from the formula's symbolic derivative; it is written with “=” only when its exact value is rational. The flux is a numerical integral, shown only to the digits its error estimate vouches for. For a typed field the page compares the flux with ∬ div F dA and says when they disagree: a singular point may be in or near the region.
03

Controls

  • Drag P, or the boundary and its r handle; P catches on the arrows' lattice, r on powers of 2. r → 0 halves r six times and collects each level in the optional Approach record window; a small shape opens the magnifier. Choose Square to use r as the half side, then use Grid to choose the grid.
  • Deformation plays the current circle or square through t = ¼. Press while running to pause, or after completion to replay; the final shape stays visible. The area and growth rate are averages over the region and time. Reference shape holds its position, size and shape while you move the detector or change its shape. Changing the field clears it; press the key again to remove it.
  • Presentation mode opens a full-screen view: Space runs r → 0, ← and → double or halve r, H hides the divergence. Share copies a link to the field, the detector and the view.
04

Related