The Divergence of a Vector Field

The divergence is one of the two fundamental first-order vector derivatives (the other being the curl). Given a vector field F(r)\mathbf{F}(\mathbf{r}) — for example an electric field, a fluid velocity, or a heat flux — the divergence answers a purely local question: at this point, is the field a net source, a net sink, or neither? It does so by comparing how much of F\mathbf{F} flows out of an infinitesimal closed surface to how much flows in, normalized by the enclosed volume. Concretely, ∇⋅F\nabla\cdot\mathbf{F} is constructed by dotting the del operator ∇=x^ ∂x+y^ ∂y+z^ ∂z\nabla=\hat{\mathbf{x}}\,\partial_x+\hat{\mathbf{y}}\,\partial_y+\hat{\mathbf{z}}\,\partial_z into F\mathbf{F}, giving the scalar ∂xFx+∂yFy+∂zFz\partial_x F_x+\partial_y F_y+\partial_z F_z. Although this looks like a notational trick, the result is genuinely a scalar field: its value at a point is independent of the coordinate frame, which is guaranteed by the geometric flux definition. The divergence is also the integrand of the divergence (Gauss) theorem, ∫V(∇⋅F) dτ=∮SF⋅da\int_V(\nabla\cdot\mathbf{F})\,\mathrm{d}\tau=\oint_S\mathbf{F}\cdot\mathrm{d}\mathbf{a} — the single most important integral identity in electromagnetism, which turns Gauss's law from a statement about enclosed charge into a local field equation. Physically, the divergence sits at the heart of every conservation statement in field theory. When a quantity (charge, mass, energy) is locally conserved, its current density J\mathbf{J} obeys ∇⋅J=−∂tρ\nabla\cdot\mathbf{J}=-\partial_t\rho: the rate at which the density piles up at a point equals the rate at which current converges there. Understanding the divergence therefore means understanding sources, sinks, and the bookkeeping of flux that governs all of classical field physics.

Key takeaways
  • The divergence of a vector field F\mathbf{F} is a scalar field, ∇⋅F\nabla\cdot\mathbf{F}, that measures the net outward flux of F\mathbf{F} per unit volume in the limit of a vanishing region around a point.
  • In Cartesian coordinates ∇⋅F=∂xFx+∂yFy+∂zFz\nabla\cdot\mathbf{F}=\partial_x F_x+\partial_y F_y+\partial_z F_z, the sum of the diagonal partial derivatives.
  • Positive divergence marks a source (field 'spreads out'); negative divergence marks a sink (field 'converges'); zero divergence (solenoidal) means flux in equals flux out.
  • The flux definition ∇⋅F=lim⁡V→01V∮SF⋅da\nabla\cdot\mathbf{F}=\lim_{V\to 0}\frac{1}{V}\oint_S\mathbf{F}\cdot\mathrm{d}\mathbf{a} is coordinate-independent and underlies the divergence (Gauss) theorem.
  • In electromagnetism, ∇⋅E=ρ/ε0\nabla\cdot\mathbf{E}=\rho/\varepsilon_0 (Gauss's law) and ∇⋅B=0\nabla\cdot\mathbf{B}=0 (no magnetic monopoles) are two of Maxwell's four equations.
  • The formula changes in curvilinear coordinates because of the metric scale factors — never just sum partials in spherical or cylindrical coordinates.
  • Key idea: The divergence is the net outward flux per unit volume: ∇⋅F=lim⁡V→01V∮SF⋅da\nabla\cdot\mathbf{F}=\lim_{V\to 0}\frac{1}{V}\oint_S\mathbf{F}\cdot\mathrm{d}\mathbf{a}. In Cartesian coordinates this reduces to the sum of diagonal partial derivatives, but the flux definition is what makes it a true coordinate-independent scalar.

Where this lives today

Enforcing zero divergence is a daily engineering battle. Every incompressible-flow solver — the codes behind aircraft design, weather models and blood-flow simulation — must keep ∇⋅v=0\nabla\cdot\mathbf{v}=0 at each timestep, which is done by solving a Poisson equation for pressure precisely so that its gradient removes any divergence the update created. In computational astrophysics the same fight happens magnetically: naive MHD schemes generate small nonzero ∇⋅B\nabla\cdot\mathbf{B} that acts like fictitious magnetic monopoles and wrecks the dynamics, so codes use "constrained transport" or divergence-cleaning schemes to keep the field honestly solenoidal. Meanwhile, the deepest experimental question attached to this operator is still open: is ∇⋅B=0\nabla\cdot\mathbf{B}=0 exactly true? Grand-unified theories predict magnetic monopoles should exist, and experiments from superconducting loops (which caught one famous, never-repeated candidate event in 1982) to the MoEDAL detector at the LHC keep hunting for a single particle that would put a delta function on the right-hand side.

The physical picture

Picture F\mathbf{F} as the velocity field of a steady fluid. Surround a point with a tiny balloon. If more fluid leaves the balloon than enters, the divergence is positive — there must be a source (a tap) inside. If more enters than leaves, the divergence is negative — there is a sink (a drain). If the balloon's net throughput is zero, the divergence vanishes there, even if fluid streams vigorously straight through.

Figure
The balloon test — source, sink, and the two zero-divergence impostors
source: div F greater than 0 more flux out than in sink: div F less than 0 more flux in than out uniform flow: div F = 0 in = out pure vortex: div F = 0 too circulation, no sources

A useful mental test: a uniform field (every arrow identical) has zero divergence — whatever flows in one face flows out the opposite face. Divergence requires the field to change as you move along its own direction, or for arrows to fan out or converge. A radial 'hedgehog' field F=r\mathbf{F}=\mathbf{r} fans outward everywhere and has constant positive divergence. Divergence is purely local and pointwise. It is not asking whether the field globally spreads, but whether it spreads at this infinitesimal location. The Coulomb field r^/r2\hat{\mathbf{r}}/r^2 looks like it spreads from the origin, yet ∇⋅(r^/r2)=0\nabla\cdot(\hat{\mathbf{r}}/r^2)=0 everywhere except at the origin, where all the 'source' is concentrated into a delta function. Because the dot product collapses three components into one number, divergence detects only the 'outflow' geometry of the field and is blind to circulation. A pure vortex has zero divergence but nonzero curl. The two operators are orthogonal probes of the field's first-order structure — and the E&M payoff is immediate: the divergence of E\mathbf{E} will become Gauss's law, revealing charge wherever field lines begin or end, while ∇⋅B=0\nabla\cdot\mathbf{B}=0 will declare that magnetic field lines never begin or end at all.

Two definitions, one operator

The computational definition dots del into the field, picking out the three diagonal derivatives — how fast each component changes along its own direction:

∇⋅F=∂Fx∂x+∂Fy∂y+∂Fz∂z(1)\nabla\cdot\mathbf{F}=\frac{\partial F_x}{\partial x}+\frac{\partial F_y}{\partial y}+\frac{\partial F_z}{\partial z} \qquad (1)

where: F\mathbf{F} — vector field with components (Fx,Fy,Fz)(F_x,F_y,F_z); ∇\nabla — del operator, x^∂x+y^∂y+z^∂z\hat{\mathbf{x}}\partial_x+\hat{\mathbf{y}}\partial_y+\hat{\mathbf{z}}\partial_z; ∇⋅F\nabla\cdot\mathbf{F} — a scalar field. Note which derivatives appear: ∂x\partial_x acts only on FxF_x, never on FyF_y — sideways variation of a component contributes to curl, not divergence. The geometric definition asks the balloon question directly, with no reference to axes at all:

∇⋅F≡lim⁡V→01V∮SF⋅da(2)\nabla\cdot\mathbf{F}\equiv\lim_{V\to 0}\frac{1}{V}\oint_S\mathbf{F}\cdot\mathrm{d}\mathbf{a} \qquad (2)

where: VV — volume of a small region around the point, shrinking to zero; SS — closed surface bounding VV; da\mathrm{d}\mathbf{a} — outward-pointing surface element. This is the definition that means something: net outward flux per unit volume. Because no coordinate system appears, the number it produces is automatically frame-independent — which is how we know the Cartesian sum (1) is a genuine scalar. The derivation below shows the two definitions are the same thing.

Derivation AThe flux definition reproduces the sum of partials

We are showing that the coordinate-free flux-per-volume definition (2), evaluated on a shrinking box, produces exactly the Cartesian sum (1) — the calculation that welds the geometric meaning of divergence to its computational recipe. The strategy: take an infinitesimal rectangular box of sides Δx,Δy,Δz\Delta x, \Delta y, \Delta z centred at r\mathbf{r}, compute the net flux through each opposite pair of faces by Taylor expansion, add the three pairs, and divide by the volume. The step to watch is the sign bookkeeping on opposite faces: their outward normals point in opposite directions, so the pair contributes a difference of the field — which is what becomes a derivative in the limit.

Step 1. Net flux through the pair of faces perpendicular to x^\hat{\mathbf{x}}. The face at x+Δx2x+\tfrac{\Delta x}{2} has outward normal +x^+\hat{\mathbf{x}} and passes flux Fx(x+Δx2) Δy ΔzF_x(x+\tfrac{\Delta x}{2})\,\Delta y\,\Delta z; the face at x−Δx2x-\tfrac{\Delta x}{2} has normal −x^-\hat{\mathbf{x}}:

[Fx(x+Δx2)−Fx(x−Δx2)] Δy Δz≈∂Fx∂x Δx Δy Δz\Big[F_x\big(x+\tfrac{\Delta x}{2}\big)-F_x\big(x-\tfrac{\Delta x}{2}\big)\Big]\,\Delta y\,\Delta z\approx\frac{\partial F_x}{\partial x}\,\Delta x\,\Delta y\,\Delta z

Why: Taylor-expanding FxF_x about the centre to first order, the constant parts cancel between the two faces and only the derivative term survives — the box detects change, not value.

Step 2. The yy- and zz-face pairs contribute identically with their own derivatives, so the total closed-surface flux is

∮SF⋅da≈(∂Fx∂x+∂Fy∂y+∂Fz∂z)Δx Δy Δz\oint_S\mathbf{F}\cdot\mathrm{d}\mathbf{a}\approx\left(\frac{\partial F_x}{\partial x}+\frac{\partial F_y}{\partial y}+\frac{\partial F_z}{\partial z}\right)\Delta x\,\Delta y\,\Delta z

Why: flux is additive over the six faces, and each Cartesian direction is independent at first order in the box dimensions.

Step 3. Divide by the volume V=Δx Δy ΔzV=\Delta x\,\Delta y\,\Delta z and take the limit:

lim⁡V→01V∮SF⋅da=∂Fx∂x+∂Fy∂y+∂Fz∂z\lim_{V\to 0}\frac{1}{V}\oint_S\mathbf{F}\cdot\mathrm{d}\mathbf{a} = \frac{\partial F_x}{\partial x}+\frac{\partial F_y}{\partial y}+\frac{\partial F_z}{\partial z}

The geometric balloon test and the algebraic recipe are one and the same. Summing this relation over a stack of tiny boxes filling a finite volume — interior faces cancelling pairwise — is precisely the divergence theorem, previewed next. Verified: standard construction, Griffiths §1.3.4 and Purcell §2.7; higher-order Taylor terms vanish as Δx→0\Delta x\to 0, so the limit is exact for differentiable fields.

Figure
The shrinking-box computation — opposite faces report a difference, differences become derivatives
flux in: Fx(x − Δx/2) Δy Δz flux out: Fx(x + Δx/2) Δy Δz (x, y, z) Δx Δy Δz net through this pair = (out − in) → (∂Fx/∂x) ΔxΔyΔz; add three pairs, divide by ΔxΔyΔz the box detects change along the flow, not the flow itself

Summing flux-per-volume over a finite region gives the integral identity this operator was born for — stated here, dissected in its own article:

∫V(∇⋅F) dτ=∮SF⋅da(3)\int_V(\nabla\cdot\mathbf{F})\,\mathrm{d}\tau=\oint_S\mathbf{F}\cdot\mathrm{d}\mathbf{a} \qquad (3)

where: dτ\mathrm{d}\tau — volume element; SS — the closed surface bounding VV. The divergence (Gauss) theorem: total source strength inside equals net flux through the boundary. It is the bridge on which Gauss's law travels between its integral and differential forms.

Curvilinear forms and allied identities

In curved coordinate systems the balloon test still defines the divergence, but the recipe changes because area elements and basis vectors vary from point to point. In spherical coordinates:

∇⋅F=1r2∂∂r ⁣(r2Fr)+1rsin⁡θ∂∂θ ⁣(sin⁡θ Fθ)+1rsin⁡θ∂Fϕ∂ϕ(4)\nabla\cdot\mathbf{F}=\frac{1}{r^2}\frac{\partial}{\partial r}\!\left(r^2 F_r\right)+\frac{1}{r\sin\theta}\frac{\partial}{\partial\theta}\!\left(\sin\theta\,F_\theta\right)+\frac{1}{r\sin\theta}\frac{\partial F_\phi}{\partial\phi} \qquad (4)

where: r,θ,ϕr,\theta,\phi — radius, polar angle, azimuth; Fr,Fθ,FϕF_r,F_\theta,F_\phi — physical (orthonormal) components. The tell-tale structure is r2r^2 inside the radial derivative: an outgoing radial field crosses spheres whose area grows as r2r^2, and the formula tracks that geometry. In cylindrical coordinates the same logic gives:

∇⋅F=1s∂∂s ⁣(s Fs)+1s∂Fϕ∂ϕ+∂Fz∂z(5)\nabla\cdot\mathbf{F}=\frac{1}{s}\frac{\partial}{\partial s}\!\left(s\,F_s\right)+\frac{1}{s}\frac{\partial F_\phi}{\partial\phi}+\frac{\partial F_z}{\partial z} \qquad (5)

where: s,ϕ,zs,\phi,z — cylindrical radius, azimuth, height. Only the zz-term looks Cartesian, because only the zz-direction has constant geometry. Two structural identities tie the divergence to its siblings. Applying it to a gradient produces the Laplacian, the master operator of potential theory:

∇⋅(∇V)=∇2V(6)\nabla\cdot(\nabla V)=\nabla^2 V \qquad (6)

where: VV — scalar field (e.g. electric potential); ∇2\nabla^2 — Laplacian. And applying it to any curl gives exactly zero:

∇⋅(∇×A)=0(7)\nabla\cdot(\nabla\times\mathbf{A})=0 \qquad (7)

where: A\mathbf{A} — any twice-differentiable vector field; mixed partials cancel in pairs. Physically: circulation patterns carry no net outflow. This is the identity that lets B=∇×A\mathbf{B}=\nabla\times\mathbf{A} automatically satisfy ∇⋅B=0\nabla\cdot\mathbf{B}=0. When a scalar multiplies a vector field, the divergence obeys the Leibniz rule:

∇⋅(fF)=f (∇⋅F)+F⋅(∇f)(8)\nabla\cdot(f\mathbf{F})=f\,(\nabla\cdot\mathbf{F})+\mathbf{F}\cdot(\nabla f) \qquad (8)

where: ff — scalar field; F\mathbf{F} — vector field. Each term lets del differentiate one factor; this rule reappears constantly in energy-flow calculations later in the track.

The electromagnetic payoff

Two of Maxwell's four equations are divergence statements:

∇⋅E=ρε0,∇⋅B=0(9)\nabla\cdot\mathbf{E}=\frac{\rho}{\varepsilon_0},\qquad \nabla\cdot\mathbf{B}=0 \qquad (9)

where: E,B\mathbf{E},\mathbf{B} — electric and magnetic fields; ρ\rho — charge density; ε0\varepsilon_0 — permittivity of free space. The first is Gauss's law in differential form: charge density is, literally, the source strength of the electric field — the balloon test applied to E\mathbf{E} measures the charge inside. The second says the magnetic field never passes the balloon test anywhere: no magnetic monopoles, field lines that always close on themselves.

Figure
The divergence reads Maxwell — E lines begin on charge, B lines never begin at all
div E = ρ/ε₀: lines start on q +q any balloon around q catches net flux div B = 0: lines only close every balloon: flux in = flux out, always
Go deeper · Derivation B · 1 minDivergence of the Coulomb field and the delta function
Derivation BDivergence of the Coulomb field and the delta function

We are computing ∇⋅(r^/r2)\nabla\cdot(\hat{\mathbf{r}}/r^2) for the prototype inverse-square field of a point charge — and resolving the famous paradox that the answer is zero everywhere yet the total flux is 4π4\pi. The strategy: apply the spherical divergence formula away from the origin, compute the flux through a sphere directly, and let the collision between the two results force the Dirac delta on us. Watch the special role of the exponent 2: it is precisely the 1/r21/r^2 falloff that makes r2Frr^2F_r constant, and no other power of rr produces this concentrated-source structure.

Step 1. Apply the spherical divergence formula (4) for r≠0r\neq 0, where only Fr=1/r2F_r=1/r^2 is nonzero:

∇⋅F=1r2∂∂r ⁣(r2⋅1r2)=1r2∂∂r(1)=0\nabla\cdot\mathbf{F}=\frac{1}{r^2}\frac{\partial}{\partial r}\!\left(r^2\cdot\frac{1}{r^2}\right)=\frac{1}{r^2}\frac{\partial}{\partial r}(1)=0

Why: r2Fr=1r^2F_r=1 is constant — the growing area of successive spheres exactly compensates the weakening field, so no shell between them gains or loses flux.

Step 2. Compute the flux through a sphere of radius RR centred on the origin:

∮SF⋅da=∫02π ⁣ ⁣∫0π1R2 (R2sin⁡θ dθ dϕ)=4π\oint_S\mathbf{F}\cdot\mathrm{d}\mathbf{a}=\int_0^{2\pi}\!\!\int_0^{\pi}\frac{1}{R^2}\,\big(R^2\sin\theta\,\mathrm{d}\theta\,\mathrm{d}\phi\big)=4\pi

Why: the field is radial and the surface element of a sphere is radial, so the dot product is just the product of magnitudes; the R2R^2 cancellation makes the answer independent of RR.

Step 3. Confront the paradox. By the divergence theorem (3), the volume integral of ∇⋅F\nabla\cdot\mathbf{F} over any ball containing the origin must equal 4π4\pi — but the integrand vanishes at every point except one. A "function" that is zero everywhere except a single point yet integrates to a finite number is precisely the three-dimensional Dirac delta:

∇⋅ ⁣(r^r2)=4π δ3(r)\nabla\cdot\!\left(\frac{\hat{\mathbf{r}}}{r^2}\right)=4\pi\,\delta^3(\mathbf{r})

Why: the delta is defined by exactly this property — ∫f(r) δ3(r) dτ=f(0)\int f(\mathbf{r})\,\delta^3(\mathbf{r})\,\mathrm{d}\tau = f(\mathbf{0}) — and Step 2 fixes its coefficient to 4π4\pi.

Step 4. Read it as electrostatics: with E=q4πε0r^r2\mathbf{E}=\frac{q}{4\pi\varepsilon_0}\frac{\hat{\mathbf{r}}}{r^2}, the identity gives ∇⋅E=qε0δ3(r)\nabla\cdot\mathbf{E}=\frac{q}{\varepsilon_0}\delta^3(\mathbf{r}) — Gauss's law for a point charge, whose density is ρ=q δ3(r)\rho=q\,\delta^3(\mathbf{r}). All the "source" of the Coulomb field lives at the charge itself; empty space, however strong the field, is sourceless. Verified: reproduces Griffiths §1.5.1 and §1.5.3; the flux value 4π4\pi and the delta-function identity are standard.

Go deeper · Derivation C · 1 minThe continuity equation from the divergence theorem
Derivation CThe continuity equation from the divergence theorem

We are deriving the local law of charge conservation, ∇⋅J+∂tρ=0\nabla\cdot\mathbf{J}+\partial_t\rho=0, from the global statement that charge in a region changes only by current crossing its boundary. The strategy is the standard localization move of field theory — write the global balance for an arbitrary fixed volume, convert the surface term to a volume term with the divergence theorem, and then argue that an integral vanishing over every volume forces the integrand to vanish pointwise. That last step is the one to appreciate: it is how integral physics becomes differential physics, and we will reuse it for Gauss's law itself.

Step 1. Global conservation for a fixed volume VV bounded by SS:

dQencdt=−∮SJ⋅da\frac{\mathrm{d}Q_{\rm enc}}{\mathrm{d}t}=-\oint_S\mathbf{J}\cdot\mathrm{d}\mathbf{a}

Why: the enclosed charge decreases at exactly the rate net current flows outward — no teleportation, charge must cross the surface to leave.

Step 2. Write the enclosed charge as a volume integral and pull the time derivative inside:

ddt∫Vρ dτ=∫V∂ρ∂t dτ\frac{\mathrm{d}}{\mathrm{d}t}\int_V\rho\,\mathrm{d}\tau=\int_V\frac{\partial\rho}{\partial t}\,\mathrm{d}\tau

Why: the volume is fixed in space, so only the integrand depends on time — the derivative becomes partial and passes through.

Step 3. Convert the surface flux with the divergence theorem (3):

∮SJ⋅da=∫V(∇⋅J) dτ\oint_S\mathbf{J}\cdot\mathrm{d}\mathbf{a}=\int_V(\nabla\cdot\mathbf{J})\,\mathrm{d}\tau

Why: this is the key structural move — both sides of the balance now live over the same volume and can be compared integrand to integrand.

Step 4. Combine and localize:

∫V(∂ρ∂t+∇⋅J)dτ=0⟹∇⋅J+∂ρ∂t=0\int_V\left(\frac{\partial\rho}{\partial t}+\nabla\cdot\mathbf{J}\right)\mathrm{d}\tau=0 \quad\Longrightarrow\quad \nabla\cdot\mathbf{J}+\frac{\partial\rho}{\partial t}=0

Since VV is arbitrary — the balance holds for every region, however small — the integrand itself must vanish at every point. The same template will localize mass conservation in fluids, probability in quantum mechanics, and energy via the Poynting vector. Verified: standard derivation, Griffiths §5.1.3 and Jackson §6.1; dimensional check, both terms carry C m−3 s−1\mathrm{C\,m^{-3}\,s^{-1}}.

Limiting cases

Reading off the divergence from the field geometry in limiting cases:

CaseResultMeaning
Uniform fieldF=F0=const\mathbf{F}=\mathbf{F}_0=\text{const}∇⋅F=0\nabla\cdot\mathbf{F}=0. No sources or sinks; flux through any closed surface is zero.
Radial 'fanning' fieldF=r=xx^+yy^+zz^\mathbf{F}=\mathbf{r}=x\hat{\mathbf{x}}+y\hat{\mathbf{y}}+z\hat{\mathbf{z}}∇⋅F=3\nabla\cdot\mathbf{F}=3, a constant positive divergence — uniform source density everywhere.
Coulomb / inverse-square fieldF=r^r2\mathbf{F}=\dfrac{\hat{\mathbf{r}}}{r^2}∇⋅F=4π δ3(r)\nabla\cdot\mathbf{F}=4\pi\,\delta^3(\mathbf{r}): zero everywhere except a point source at the origin.
Pure vortex (rotational) fieldF=−yx^+xy^\mathbf{F}=-y\hat{\mathbf{x}}+x\hat{\mathbf{y}}∇⋅F=0\nabla\cdot\mathbf{F}=0. Circulation without sources — divergence is blind to curl.
Magnetic field (always)∇⋅B=0\nabla\cdot\mathbf{B}=0Solenoidal field lines never begin or end; there are no magnetic monopoles.

Worked examples

Example 1 — Cartesian source-hunting with a flux cross-check (confidence builder). Let F=x2 x^+xy y^+z z^\mathbf{F} = x^2\,\hat{\mathbf{x}} + xy\,\hat{\mathbf{y}} + z\,\hat{\mathbf{z}}.

Step 1. Sum the diagonal partials: ∂x(x2)=2x\partial_x(x^2) = 2x, ∂y(xy)=x\partial_y(xy) = x, ∂z(z)=1\partial_z(z) = 1:

∇⋅F=2x+x+1=3x+1\nabla\cdot\mathbf{F} = 2x + x + 1 = 3x + 1

Step 2. Classify by position: at (1,5,−2)(1, 5, -2) the divergence is 3(1)+1=43(1)+1 = \mathbf{4} — a source; at (−1,0,7)(-1, 0, 7) it is 3(−1)+1=−23(-1)+1 = \mathbf{-2} — a sink; the plane x=−1/3x = -1/3 is the sourceless boundary between the two regimes. Note the yy- and zz-coordinates are irrelevant: only variation along each component's own direction registers.

Step 3. Flux cross-check on the simplest fanning field F=r\mathbf{F}=\mathbf{r}, for which the same recipe gives ∇⋅r=1+1+1=3\nabla\cdot\mathbf{r} = 1+1+1 = 3. On a sphere of radius R=0.5 mR = 0.5\ \mathrm{m}: r⋅r^=R\mathbf{r}\cdot\hat{\mathbf{r}} = R on the surface, so the flux is R⋅4πR2=4πR3=1.571 m3R\cdot 4\pi R^2 = 4\pi R^3 = 1.571\ \mathrm{m}^3 (per unit field). The enclosed volume is 43πR3=0.524 m3\tfrac{4}{3}\pi R^3 = 0.524\ \mathrm{m}^3, and

1V∮F⋅da=1.5710.524=3.0\frac{1}{V}\oint\mathbf{F}\cdot\mathrm{d}\mathbf{a} = \frac{1.571}{0.524} = 3.0

— the flux definition and the partial-derivative recipe agree exactly, at any radius.

Example 2 — from field to charge density (exam level). Inside a charged ball the electrostatic field is measured to be radial with E=A r r^\mathbf{E} = A\,r\,\hat{\mathbf{r}}, where A=100 V/m2A = 100\ \mathrm{V/m^2}. What charge density produces it?

Step 1. Use the spherical divergence (4) — the field is radial, so only the first term lives:

∇⋅E=1r2∂∂r(r2⋅Ar)=1r2⋅3Ar2=3A\nabla\cdot\mathbf{E} = \frac{1}{r^2}\frac{\partial}{\partial r}\big(r^2\cdot Ar\big) = \frac{1}{r^2}\cdot 3Ar^2 = 3A

Note the trap avoided: the naive ∂r(Ar)=A\partial_r(Ar) = A is wrong by a factor of 3.

Step 2. Apply Gauss's law (9):

ρ=ε0 ∇⋅E=3ε0A=3 (8.85×10−12)(100)=2.66×10−9 C/m3\rho = \varepsilon_0\,\nabla\cdot\mathbf{E} = 3\varepsilon_0 A = 3\,(8.85\times 10^{-12})(100) = 2.66\times 10^{-9}\ \mathrm{C/m^3}

A linearly growing radial field inside a ball means uniform charge density — here 2.66 nC/m32.66\ \mathrm{nC/m^3}.

Step 3. Sanity check with the integral form: for a ball of radius RR, Qenc=ρ⋅43πR3=4πε0AR3Q_{\rm enc} = \rho\cdot\tfrac43\pi R^3 = 4\pi\varepsilon_0 A R^3, while the flux is E(R)⋅4πR2=4πAR3E(R)\cdot 4\pi R^2 = 4\pi A R^3. The ratio Qenc/ε0Q_{\rm enc}/\varepsilon_0 equals the flux — Gauss's law closes, differential and integral forms telling one story.

Applications

Gauss's law in electrostatics. The differential form ∇⋅E=ρ/ε0\nabla\cdot\mathbf{E}=\rho/\varepsilon_0 says that electric field lines originate on positive charge and terminate on negative charge. Where the divergence is positive there is net positive charge density; where it is zero (empty space) the field is sourceless. Integrating over a volume and applying the divergence theorem recovers the integral form ∮E⋅da=Qenc/ε0\oint\mathbf{E}\cdot\mathrm{d}\mathbf{a}=Q_{\rm enc}/\varepsilon_0, the workhorse for symmetric charge distributions.

Absence of magnetic monopoles. ∇⋅B=0\nabla\cdot\mathbf{B}=0 states that magnetic field lines have no sources or sinks — they always close on themselves. This is why a bar magnet cut in half yields two dipoles rather than isolated north and south poles, and it constrains the vector-potential representation B=∇×A\mathbf{B}=\nabla\times\mathbf{A}, since the divergence of any curl vanishes identically.

Conservation laws as continuity equations. Any locally conserved quantity with density ρ\rho and current density J\mathbf{J} obeys ∇⋅J+∂tρ=0\nabla\cdot\mathbf{J}+\partial_t\rho=0. This applies to electric charge, mass in fluid flow, probability in quantum mechanics, and energy via the Poynting vector. The divergence converts a global conservation statement into a pointwise differential equation.

Heat and fluid flow. For a steady incompressible fluid the velocity field satisfies ∇⋅v=0\nabla\cdot\mathbf{v}=0 (no net creation of fluid), and the heat-flux density q=−k∇T\mathbf{q}=-k\nabla T enters the heat equation through its divergence, ρc ∂tT=−∇⋅q=k∇2T\rho c\,\partial_t T=-\nabla\cdot\mathbf{q}=k\nabla^2 T. The divergence of a gradient appearing here is exactly the Laplacian.

Origins · 1 minCarl Friedrich Gauss and how this was discovered
CF
Carl Friedrich Gauss
1777–1855 · Göttingen Observatory

Gauss corrected his father's payroll arithmetic at age three and summed 1 to 100 in seconds at seven; by the end of his life he had reshaped number theory, geometry, astronomy, statistics — and the mathematics of flux. The divergence theorem that anchors this article emerged from his work on gravitational and magnetic attraction, where he needed to relate what happens inside a body to what can be measured on its surface. Characteristically, he sat on results for years — his motto was pauca sed matura, "few but ripe" — and several theorems he proved privately were rediscovered by others (Ostrogradsky published the general divergence theorem in 1826). With Weber he built one of the first electromagnetic telegraphs and organized the worldwide Magnetic Union to map the Earth's field, work in which the source-free character of magnetism — our ∇⋅B=0\nabla\cdot\mathbf{B}=0 — was hard data before it was theory. The CGS unit of magnetic field bore his name for a century.

History
1813
— Gauss proves special cases of the divergence theorem in his work on the attraction of ellipsoids
1826
— Ostrogradsky states and proves the general theorem converting volume integrals of derivatives to surface integrals
1828
— Green's essay weaves the same surface-volume conversions into electrostatic potential theory
1835
— Gauss, mapping terrestrial magnetism with Weber, quantifies the sourceless character of the magnetic field
1873
— Maxwell's Treatise names the operation "convergence" (the negative of today's divergence); Clifford and Heaviside soon flip the sign and the name
1892
— Heaviside's vector form of Maxwell's equations enshrines div E and div B as two of the four fundamental field laws

Going further

References. Griffiths, Introduction to Electrodynamics, 4th ed., §1.2.4 and §1.3.4 · Jackson, Classical Electrodynamics, 3rd ed., §1.1 and front-cover identities · Purcell & Morin, Electricity and Magnetism, 3rd ed., §2.7–2.10 · Zangwill, Modern Electrodynamics, §1.4

Provenance. Cartesian, spherical, and cylindrical divergence formulas verified against Griffiths front cover and §1.2.4/§1.4. The delta-function identity ∇⋅(r^/r2)=4πδ3(r)\nabla\cdot(\hat{\mathbf{r}}/r^2)=4\pi\delta^3(\mathbf{r}) is Griffiths §1.5.1. Continuity equation derivation follows Griffiths §5.1.3. Maxwell's two divergence equations and constant ∇⋅r=3\nabla\cdot\mathbf{r}=3 are standard; a verifier should recompute the flux integrals (4π4\pi and 33) and the second-derivative cancellation for ∇⋅(∇×A)\nabla\cdot(\nabla\times\mathbf{A}). Cross-check Jackson §1.1 and Purcell §2.7–2.10.

Builds on: Scalar and Vector Fields · The Del Operator (Nabla) · Surface Integrals and Flux · Volume Integrals Leads to: The Divergence (Gauss) Theorem · Second Derivatives and the Laplacian · The Curl of a Vector Field · Spherical Coordinates

The arrows of the Coulomb field visibly spread apart — how can its divergence be zero away from the charge?

Because "spreading apart" is compensated by "weakening". The balloon test counts net flux: between two nearby spheres, the field lines spread over r2r^2-larger area but the field is 1/r21/r^2 weaker, so exactly as much flux leaves the outer sphere as entered the inner one. The spherical formula makes it mechanical: r2Fr=constr^2 F_r = \text{const} means zero radial divergence. Visual spreading of arrows is not divergence; only a genuine imbalance of in-versus-out flux is. The hedgehog field F=r\mathbf{F}=\mathbf{r}, whose magnitude grows with rr, is the one with honest positive divergence.

Why do only the diagonal derivatives appear — what happened to how Fx changes with y?

The divergence asks about outflow, and only the change of a component along its own direction moves flux through a closed box: FxF_x varying with xx makes the flux through the two xx-faces unequal. FxF_x varying with yy tilts the flow sideways — it shifts where the flux crosses, not how much net crosses, and instead feeds the curl. The nine first derivatives ∂iFj\partial_i F_j split cleanly: the diagonal trace is the divergence, the antisymmetric off-diagonal part is the curl, and the symmetric traceless remainder (shear) belongs to continuum mechanics.

What are the units of divergence, and what does a value like 5 per second mean?

Divergence divides field units by length: if v\mathbf{v} is a velocity in m/s, ∇⋅v\nabla\cdot\mathbf{v} has units 1/s. And it has a beautiful direct meaning there: it is the fractional expansion rate of an infinitesimal fluid blob — ∇⋅v=(1/V) dV/dt\nabla\cdot\mathbf{v} = (1/V)\,\mathrm{d}V/\mathrm{d}t. A value of 5 s⁻¹ means a small parcel is inflating by a factor e5e^5 per second's worth of that rate. For E\mathbf{E} in V/m, the divergence carries V/m², which times ε0\varepsilon_0 is exactly a charge density — Gauss's law is dimensionally forced.

What does solenoidal mean, and why is that word used for divergence-free fields?

A field with ∇⋅F=0\nabla\cdot\mathbf{F}=0 everywhere is called solenoidal, after the solenoid coil, whose magnetic field is the archetype: lines that never start or stop, only loop. Solenoidal fields have three equivalent characterizations — zero divergence, zero flux through every closed surface, and expressibility as a curl, F=∇×A\mathbf{F}=\nabla\times\mathbf{A}. The magnetic field satisfies all three globally. Incompressible flow satisfies them too, which is why fluid dynamicists and electromagnetists constantly borrow each other's mathematics.

Is the divergence theorem the same as Gauss's law?

No — one is mathematics, the other physics, and the naming collision confuses everyone once. The divergence theorem (also called Gauss's theorem) is an identity true for any well-behaved vector field: volume integral of divergence equals boundary flux. Gauss's law is a statement about nature: the flux of the electric field specifically is Qenc/ε0Q_{\rm enc}/\varepsilon_0. The theorem is the converter that lets the law wear two outfits — integral (∮E⋅da=Q/ε0\oint\mathbf{E}\cdot\mathrm{d}\mathbf{a}=Q/\varepsilon_0) and differential (∇⋅E=ρ/ε0\nabla\cdot\mathbf{E}=\rho/\varepsilon_0). You need both: the integral form for symmetric problems, the differential form for field theory.

How literally should I take the delta function in the point-charge divergence?

Take it as precise shorthand for a limiting procedure. A point charge is an idealization; smear the same total charge qq over a tiny ball of radius aa and everything is finite: ∇⋅E=ρ/ε0\nabla\cdot\mathbf{E} = \rho/\varepsilon_0 inside the ball, zero outside, with the inside value growing as a−3a^{-3} while the region shrinks as a3a^3 — the volume integral stays q/ε0q/\varepsilon_0 throughout. The delta function is the a→0a\to 0 limit of this family. All delta manipulations in electrodynamics can be checked by re-inflating the point into a small ball, doing honest calculus, and shrinking again.

Does positive divergence at a point mean field lines are actually created there?

For the electric field, yes in exactly the field-line-drawing sense: lines begin on positive charge, in proportion to it. In general the statement is about flux, not line count — field lines are a visualization whose density conventions you choose. What is rigorously true: positive ∇⋅F\nabla\cdot\mathbf{F} at a point means every sufficiently small closed surface around it exports net flux, so any honest field-line drawing must start new lines there. That is why ∇⋅B=0\nabla\cdot\mathbf{B}=0 translates to "magnetic field lines have no ends" — a statement checked to extraordinary precision by the continued non-observation of magnetic monopoles.

Before this

Where this leads