Divergence, curl, and local conservation
Connect derivative combinations with local outflow, circulation, and the balance of a conserved density.
On this page
The question for today
What you’ll understand
- Compute divergence and curl with a fixed coordinate convention.
- Derive the sign in a local continuity equation.
- Interpret source and rotational behavior without confusing field magnitude with derivatives.
A field plot shows directions and magnitudes, but conservation laws depend on how the field changes from point to point. Divergence measures local net outward transport per unit volume. Curl measures local oriented circulation per unit area. These derivative combinations answer different questions, and neither is simply the size of the arrows. Connecting them to small control regions explains why they appear in fluid flow, electromagnetism, diffusion, and transport models.
Divergence measures a local imbalance of outflow
For a C¹ vector field F in three-dimensional Cartesian coordinates, divergence is the sum of the derivative of each component in its own direction. Consider a tiny rectangular box. The x-directed flux leaving its right face minus that entering its left face is approximately the x derivative of Fx times the box volume. Adding the corresponding y and z contributions gives divergence times volume to leading order. A positive value therefore describes net outward flux locally; it is not a statement that all arrows point outward from one universal origin.
A spatially constant field can transport a great deal of material through a region while having zero divergence, because inflow and outflow balance. Likewise a field can have zero vector value at a point but nonzero divergence there: F=(x,y,z) vanishes at the origin yet has divergence three. Derivatives compare neighboring field values, so inspecting a single arrow cannot determine them. The box argument motivates the local interpretation; exact finite-region identities require integration theorems and their regularity hypotheses.
Curl detects infinitesimal circulation with an orientation
The component of curl along a unit normal describes circulation density around a small loop oriented by the right-hand rule. In the plane, embed F=(P,Q) as (P,Q,0). The relevant component is Qx−Py. A rigid rotation field (−Ωy,Ωx) has scalar curl 2Ω, not Ω. The factor two reflects contributions from both pairs of opposite sides of a small loop. Reversing loop orientation reverses measured circulation, matching the normal direction used for the curl component.
For sufficiently smooth fields, curl of a gradient is zero and divergence of a curl is zero because the corresponding mixed second partial derivatives cancel. The smoothness matters: standard pointwise identities assume the mixed partials exist and commute, for example under C² regularity. These identities impose necessary conditions for potentials, but their converses can require topology and boundary conditions. In particular, a curl-free field on a region with a hole need not have a globally defined scalar potential, as a loop around the missing region can detect.
A balance law needs a flux model as additional data
Let ρ be a conserved density, J its transport flux, and s a production rate per unit volume. In a fixed control region, rate of stored amount equals production minus outward flux. Under sufficient smoothness, converting the boundary flux to a volume integral gives the local continuity equation. Its minus sign has a physical meaning: net outflow reduces storage. The balance law alone does not determine J; an advective, diffusive, or other constitutive relation must be supplied separately and justified for the application.
For compressible advection, expanding divergence of ρv gives v dotted with the density gradient plus ρ times divergence of velocity. Omitting the latter term assumes an incompressible velocity field and can violate conservation otherwise. For diffusion with spatially varying κ, the expression is divergence of κ times gradient ρ, not simply κ times the Laplacian unless κ is constant. Boundary conditions then control whether total material is conserved in a domain. A correct local equation does not automatically imply a closed system with zero boundary flux.
Work it through
Separate expansion from rotation
For v(x,y,z)=(2x−y,x+3y,−z), compute divergence and curl, then find the instantaneous density rate for a spatially uniform advected density ρ=5 with no source.
The own-coordinate derivatives are 2, 3, and −1, so divergence is 4. The z component of curl is ∂x(x+3y)−∂y(2x−y)=1−(−1)=2; the other components vanish.
At an instant when density is spatially uniform, the gradient term v·∇ρ is zero. Divergence of the mass flux ρv is therefore ρ div v=5·4=20.
The source-free continuity equation gives ∂tρ=−20 at that instant. Expansion lowers local density even though the velocity also contains rotation; the rotational contribution has zero divergence.
The field has divergence 4 and curl (0,0,2); the instantaneous density rate is −20. Units follow the chosen time and density scales.
The living notebook
Explore the model
Interactive lab · fields
Control a smooth source and rigid rotation independently
Reset, set q=0 and Ω=1. Predict zero divergence and scalar curl 2 for the pure rotation field. For a fresh run, Reset, set q=1 and Ω=0: the softened source is outward, with divergence 0.4/(r²+0.2)² and zero scalar curl. The diagram plots arrows rather than derivative readouts; these derivative predictions must be checked analytically. This two-dimensional field is not a full fluid solver.
- Fx at (1, 0)
- 0.833
- Fy at (1, 0)
- 0.5
- Field magnitude there
- 0.972
The softened illustration is q·r/(r² + 0.2) + Ω(−y, x). Moving markers indicate local direction, not integrated particle paths or a Maxwell solution. Parameter changes pause playback and recompute the model at the current elapsed time. Reset restores both parameters and returns time to zero. Playback starts paused. Adjust either parameter, then choose Play or Step.
Look forSource behavior and rotational behavior are independent derivative features of a field.
Pause & reason
Check your understanding
Your turn
Try it yourself
For v=(x,−y,0), compute divergence and curl. If ρ(x,y,z)=x²+y² at an instant and transport is source-free advection, find ∂tρ at that instant.
Take a moment to make a prediction or work it out on paper. Open a hint when you need one.
Give me a hint
Expand divergence of ρv as v·∇ρ+ρ div v, keeping both terms until the divergence is evaluated.
Compare with the solution
The divergence is 1−1+0=0, and all curl components vanish. The density gradient is (2x,2y,0), so v·∇ρ=2x²−2y². Therefore ∂tρ=−2x²+2y². An incompressible velocity preserves volume locally but does not freeze an inhomogeneous density at fixed spatial points: advection moves its pattern through them.
Keep the idea
Take it with you
- Divergence measures local net outflow; curl measures oriented local circulation.
- The continuity equation separates balance from the constitutive model for flux.
- Zero divergence neither forces zero velocity nor prevents a changing spatial density pattern.
Read further
Original sources and deeper explanations to follow at your own pace.
Optional progress, saved in this browser when available. Revisit any lesson at any time.
Lesson not marked complete.