Divergence of a Vector Field

Divergence is the operator that turns a flow into a bookkeeping question: at this exact point, is stuff being made, destroyed, or merely passing through? It is one of the three first-order operators built from the del symbol ∇ — the gradient acts on a scalar and returns a vector, the curl acts on a vector and returns a vector, and the divergence acts on a vector field F\mathbf{F} and returns a scalar field ∇⋅F\nabla\cdot\mathbf{F}. The notation is engineered to look like the dot product of the symbolic vector ∇=(∂x,∂y,∂z)\nabla=(\partial_x,\partial_y,\partial_z) with F\mathbf{F}, and in Cartesian coordinates that mnemonic is exact: ∇⋅F=∂xFx+∂yFy+∂zFz\nabla\cdot\mathbf{F}=\partial_xF_x+\partial_yF_y+\partial_zF_z. But the Cartesian sum is the shadow, not the substance. The substance is geometric: shrink a closed surface onto a point and measure how much more flux of F\mathbf{F} leaves than enters, per unit volume enclosed. That flux-density ratio is a genuine scalar — every observer in every coordinate system agrees on its value — and it is why divergence is the language conservation laws are written in. Charge, mass, energy, and probability are all conserved by one differential sentence, ∂tρ+∇⋅J=0\partial_t\rho+\nabla\cdot\mathbf{J}=0: whatever accumulates in a region got there by flowing across its boundary and nowhere else. Two ideas run through everything below. First, divergence is local flux density, and the Divergence (Gauss) Theorem promotes it to the global statement ∫V∇⋅F dV=∮SF⋅dS\int_V\nabla\cdot\mathbf{F}\,\mathrm{d}V=\oint_S\mathbf{F}\cdot\mathrm{d}\mathbf{S}. Second, because the definition is intrinsic, re-expressing it in curved coordinates drags in the metric: the Jacobian's derivatives produce the 1/r21/r^2 and 1/ρ1/\rho weights of spherical and cylindrical systems, and forgetting them is the single most common way to get divergence wrong.

Key takeaways
  • The divergence of a vector field F\mathbf{F} is a scalar field ∇⋅F\nabla\cdot\mathbf{F} measuring the net outward flux per unit volume produced at each point — positive at a source, negative at a sink, zero for a pass-through (solenoidal) flow.
  • In Cartesian coordinates it is the sum of the diagonal partial derivatives, ∇⋅F=∂xFx+∂yFy+∂zFz\nabla\cdot\mathbf{F}=\partial_xF_x+\partial_yF_y+\partial_zF_z, but that formula is only the coordinate-free flux limit evaluated on an infinitesimal box.
  • The intrinsic definition ∇⋅F=lim⁡V→01V∮SF⋅dS\nabla\cdot\mathbf{F}=\lim_{V\to0}\frac1V\oint_S\mathbf{F}\cdot\mathrm{d}\mathbf{S} is what makes it a true scalar and what ties it to the Divergence (Gauss) Theorem.
  • Curvilinear forms carry metric factors: spherical divergence has 1r2∂r(r2Fr)\frac1{r^2}\partial_r(r^2F_r), not ∂rFr\partial_rF_r — the general rule is ∇⋅F=1g∂i(g Fi)\nabla\cdot\mathbf{F}=\frac1{\sqrt g}\partial_i(\sqrt g\,F^i).
  • The inverse-square field is the signature example: ∇⋅(r^/r2)=0\nabla\cdot(\hat{\mathbf r}/r^2)=0 away from the origin yet flux =4π=4\pi through any enclosing sphere, so ∇⋅(r^/r2)=4π δ3(r)\nabla\cdot(\hat{\mathbf r}/r^2)=4\pi\,\delta^3(\mathbf r) — a point source.
  • Divergence writes every conservation law in differential form: Gauss's law ∇⋅E=ρ/ε0\nabla\cdot\mathbf{E}=\rho/\varepsilon_0, no monopoles ∇⋅B=0\nabla\cdot\mathbf{B}=0, mass continuity, and probability conservation.
  • Key idea: Divergence is flux density, ∇⋅F=lim⁡V→01V∮SF⋅dS\nabla\cdot\mathbf{F}=\lim_{V\to0}\frac1V\oint_S\mathbf{F}\cdot\mathrm{d}\mathbf{S}; the Cartesian sum of diagonal derivatives is merely this limit evaluated on an infinitesimal box.
The core insight

Divergence is flux density: ∇⋅F=lim⁡V→01V∮SF⋅dS\nabla\cdot\mathbf{F}=\lim_{V\to0}\frac1V\oint_S\mathbf{F}\cdot\mathrm{d}\mathbf{S}. The Cartesian sum of diagonal derivatives is merely this limit evaluated on an infinitesimal box, which is why the operator returns a coordinate-independent scalar.

Where this lives today

Divergence is the differential grammar of every conservation law running in modern physics and engineering. In computational fluid dynamics, enforcing ∇⋅v=0\nabla\cdot\mathbf v=0 (incompressibility) at every grid cell is the central constraint of the pressure-projection methods that simulate everything from aircraft wings to blood flow; a solver that lets divergence leak makes mass from nothing and blows up. In electromagnetism, particle-in-cell plasma codes and finite-difference Maxwell solvers must hold the discrete Gauss law ∇⋅E=ρ/ε0\nabla\cdot\mathbf E=\rho/\varepsilon_0 to machine precision, and "divergence cleaning" algorithms exist to scrub the accumulated error. In geophysics, the divergence theorem turns a satellite's measured gravity flux into the mass distribution below — the inverse problem behind GRACE maps of ice-sheet loss. And at the frontier, ∇⋅B=0\nabla\cdot\mathbf B=0 — the statement that magnetic monopoles do not exist — remains an open experimental question: MoEDAL at the LHC and superconducting induction searches still hunt for a single monopole, whose discovery would put a nonzero source on the right-hand side of one of the tidiest zeros in physics.

The physical picture

Picture F\mathbf{F} as the velocity field of a fluid and drop a tiny imaginary balloon at a point. If more fluid streams out across the balloon's skin than in, fluid is being created inside — that excess outflow, divided by the balloon's volume as it shrinks to nothing, is the divergence. A faucet is a source (positive divergence), a drain a sink (negative), and a steady pass-through current has zero divergence. Crucially, divergence sees only the spreading of field lines along their own direction; a pure swirl or shear, where lines neither converge nor separate, contributes nothing — that rotational part is what the curl measures. Divergence and curl together partition the local behaviour of any field into "spreading" and "spinning".

Figure
Divergence as flux density: a small region with more field lines leaving than entering has positive ∇·F, a source; equal flow in and out gives ∇·F = 0, a solenoidal pass-through; more entering than leaving gives negative ∇·F, a sink. The pointwise value is the limit ∇·F = lim(V→0) (1/V) ∮ F·dS.
Source, solenoidal, sink — divergence is the net outflow per unit volume ∇·F greater than 0 source ∇·F = 0 solenoidal ∇·F less than 0 sink

Because divergence is a limit of an intrinsic flux ratio, it is a genuine scalar: the Cartesian neatness ∂xFx+∂yFy+∂zFz\partial_xF_x+\partial_yF_y+\partial_zF_z is a happy accident of constant orthonormal basis vectors, and in curved coordinates the basis vectors vary, generating extra metric terms. The cleanest demonstration of the geometry is the inverse-square field F=r^/r2\mathbf{F}=\hat{\mathbf r}/r^2 — the shape of every point charge and point mass. Its divergence is zero everywhere it is defined, yet the flux through any sphere around the origin is a radius-independent 4π4\pi: the field weakens as 1/r21/r^2 at exactly the rate the sphere's area grows as r2r^2. The only way a field can be source-free everywhere yet emit a fixed flux is to hide a singular source at one point.

Figure
The inverse-square field F = r̂/r² has zero divergence everywhere except the origin. At radii r = 1, 2, 3 the field magnitude falls as 1, 1/4, 1/9 while the sphere area grows as 4π, 16π, 36π, so the flux is the same 4π through every shell — which forces a point source ∇·F = 4π δ³(r) concentrated at r = 0.
The punchline: flux = 4π through every sphere, so ∇·F = 4π δ³(r) r = 1: |F| = 1, area = 4π, flux = 4π r = 2: |F| = 1/4, area = 16π, flux = 4π r = 3: |F| = 1/9, area = 36π, flux = 4π the field weakens as fast as the sphere grows — the flux never changes ∇·F = 0 for r ≠ 0 ∮ F·dS = 4π for every sphere ⇒ ∇·F = 4π δ³(r)

The core equations

The operational definition is the Cartesian sum: differentiate each component along its own axis and add. It is the fastest way to compute in flat coordinates and makes the "dot product with ∇" mnemonic exact.

∇⋅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=(Fx,Fy,Fz)\mathbf{F}=(F_x,F_y,F_z) — the vector field; ∇=(∂x,∂y,∂z)\nabla=(\partial_x,\partial_y,\partial_z) — the del operator; each ∂iFi\partial_iF_i — the rate at which the ii-component of F\mathbf{F} grows along the ii-axis. Only the diagonal derivatives enter; cross terms like ∂xFy\partial_xF_y belong to the curl. The geometric definition is the more fundamental one, because it never mentions a coordinate system. It says divergence is the flux per unit volume in the limit of a vanishing region, which is why it returns a scalar.

∇⋅F=lim⁡V→01V∮SF⋅dS(2)\nabla\cdot\mathbf{F} = \lim_{V\to 0}\frac{1}{V}\oint_{S}\mathbf{F}\cdot\mathrm{d}\mathbf{S} \qquad (2)

where: VV — the volume of a small region collapsing onto the point; SS — the closed surface bounding VV; dS=n^ dS\mathrm{d}\mathbf{S}=\hat{\mathbf n}\,\mathrm{d}S — the outward-pointing area element. Reading it: sum the field poking out through the skin, divide by the volume inside, shrink to a point. In spherical coordinates the intrinsic scalar of equation (2) picks up metric factors, because a radial face's area grows as r2r^2 and the angular faces shrink toward the poles. These are not decorations — they keep the operator coordinate-independent.

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

where: r,θ,ϕr,\theta,\phi — radius, polar angle, azimuth; Fr,Fθ,FϕF_r,F_\theta,F_\phi — the physical (orthonormal) components of F\mathbf{F}; the factor r2sin⁡θr^2\sin\theta is the Jacobian, and its derivatives generate every metric weight you see. Notice the radial term is 1r2∂r(r2Fr)\frac1{r^2}\partial_r(r^2F_r), never the naive ∂rFr\partial_rF_r. Cylindrical coordinates carry the same lesson with a simpler geometry: the radial face grows as ρ\rho, and the axial direction is flat.

∇⋅F=1ρ∂(ρFρ)∂ρ+1ρ∂Fϕ∂ϕ+∂Fz∂z(4)\nabla\cdot\mathbf{F} = \frac{1}{\rho}\frac{\partial(\rho F_\rho)}{\partial \rho} + \frac{1}{\rho}\frac{\partial F_\phi}{\partial \phi} + \frac{\partial F_z}{\partial z} \qquad (4)

where: ρ,ϕ,z\rho,\phi,z — cylindrical radius, azimuth, height; Fρ,Fϕ,FzF_\rho,F_\phi,F_z — physical components on the local orthonormal basis. The zz-term is bare because the zz-direction has no metric stretch. All three special cases are instances of one master formula, valid in any coordinate system, written with the metric determinant gg — the cleanest statement that divergence is the metric-weighted derivative of the flow.

∇⋅F=1g ∂i ⁣(g Fi)(5)\nabla\cdot\mathbf{F} = \frac{1}{\sqrt{g}}\,\partial_i\!\left(\sqrt{g}\,F^i\right) \qquad (5)

where: gg — the determinant of the metric tensor gijg_{ij}; FiF^i — the contravariant components of F\mathbf{F}; ∂i\partial_i — derivative with respect to coordinate uiu^i, repeated index summed. Set g=r2sin⁡θ\sqrt g=r^2\sin\theta to recover (3), or g=ρ\sqrt g=\rho to recover (4). The local statement becomes global through the Divergence (Gauss) Theorem — the identity that makes divergence useful, converting a volume integral of sources into a surface integral of flux.

∫V(∇⋅F) dV=∮SF⋅dS(6)\int_V (\nabla\cdot\mathbf{F})\,\mathrm{d}V = \oint_S \mathbf{F}\cdot\mathrm{d}\mathbf{S} \qquad (6)

where: VV — any finite region; S=∂VS=\partial V — its closed bounding surface. Reading it: the total source strength inside a region equals the net flux escaping its boundary. Two identities pin down divergence's place among the operators. The first: the divergence of any curl vanishes identically — a purely rotational field has no sources — which is why ∇⋅B=0\nabla\cdot\mathbf{B}=0 follows the moment B=∇×A\mathbf{B}=\nabla\times\mathbf{A}.

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

where: A\mathbf{A} — any twice-differentiable vector field. It holds because the symmetric mixed-partial ∂i∂j\partial_i\partial_j is contracted against the antisymmetric Levi-Civita symbol. The product rule distributes divergence over a scalar times a vector — the workhorse behind integration by parts in field theory.

∇⋅(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 — a scalar field; ∇f\nabla f — its gradient. The result mixes the sources of F\mathbf F with the way ff varies along F\mathbf F. Finally, composing divergence with gradient produces the Laplacian, the operator behind every equilibrium and diffusion problem in physics.

∇⋅(∇f)=∇2f(9)\nabla\cdot(\nabla f) = \nabla^2 f \qquad (9)

where: ∇2=∂x2+∂y2+∂z2\nabla^2=\partial_x^2+\partial_y^2+\partial_z^2 — the Laplacian, measuring how a scalar's value at a point compares to its neighbourhood average: the divergence of the gradient flow.

Derivation ACartesian divergence from the flux definition

The goal is to prove that the intrinsic definition in equation (2) collapses to the Cartesian sum in equation (1), so the two are not two operators but one seen from two angles. We apply the flux-density limit to an infinitesimal box whose faces align with the axes, evaluate the six face contributions with a first-order Taylor expansion, and watch the higher-order corrections die as the box shrinks — leaving exactly the sum of diagonal derivatives.

Step 1. Centre a box of sides Δx,Δy,Δz\Delta x,\Delta y,\Delta z at r\mathbf r and take the two faces normal to xx. Their outward normals oppose, so their fluxes subtract: the net xx-flux is Φx=[Fx(x+Δx2)−Fx(x−Δx2)] Δy Δz\Phi_x=[F_x(x+\tfrac{\Delta x}2)-F_x(x-\tfrac{\Delta x}2)]\,\Delta y\,\Delta z. Why: outward flux across a flat face is the normal component of F\mathbf F times the face area, and pairing opposite faces extracts a difference of FxF_x across the box.

Step 2. Taylor-expand to first order: Fx(x+Δx2)−Fx(x−Δx2)≈∂Fx∂xΔxF_x(x+\tfrac{\Delta x}2)-F_x(x-\tfrac{\Delta x}2)\approx\frac{\partial F_x}{\partial x}\Delta x, so Φx≈∂Fx∂xΔx Δy Δz=∂Fx∂x V\Phi_x\approx\frac{\partial F_x}{\partial x}\Delta x\,\Delta y\,\Delta z=\frac{\partial F_x}{\partial x}\,V. Why: over an infinitesimal gap only the first derivative survives; the constant part of FxF_x cancels in the difference.

Step 3. Repeat for the yy- and zz-face pairs, add, and divide by the volume: 1V(Φx+Φy+Φz)=∂xFx+∂yFy+∂zFz\frac1V(\Phi_x+\Phi_y+\Phi_z)=\partial_xF_x+\partial_yF_y+\partial_zF_z. Why: the three axes are independent, so their contributions add, and the shared factor VV cancels.

Step 4. Take V→0V\to0. The neglected terms are of order Δx2\Delta x^2 relative to the leading ones, so they vanish, leaving the Cartesian formula exactly. Why: the limit discards the box shape — the answer is intrinsic even though the scaffold was rectangular. *The same construction on curved faces — where a spherical face carries area r2sin⁡θ Δθ Δϕr^2\sin\theta\,\Delta\theta\,\Delta\phi — produces the metric factors of equation (3) by exactly the same logic.*

Go deeper · Derivation B · 1 minThe continuity equation from local conservation
Derivation BThe continuity equation from local conservation

The goal is to show that divergence is the exact mathematical form of a conservation law, deriving the continuity equation ∂tρ+∇⋅J=0\partial_t\rho+\nabla\cdot\mathbf J=0 from the plain statement that a conserved quantity leaves a region only by flowing across its boundary. The same three lines underlie charge conservation in electromagnetism, mass conservation in fluids, and probability conservation in quantum mechanics, with ρ\rho and J\mathbf J reinterpreted each time.

Step 1. Fix a region VV with boundary SS; let ρ\rho be the density of the conserved stuff and J\mathbf J its current. Global balance: the amount inside changes only by flow across the boundary, ddt∫Vρ dV=−∮SJ⋅dS\frac{\mathrm d}{\mathrm dt}\int_V\rho\,\mathrm dV=-\oint_S\mathbf J\cdot\mathrm d\mathbf S. Why: with no sources inside, every unit that appears or vanishes crossed SS; the minus sign encodes that outward flux depletes the interior.

Step 2. Convert the surface flux to a volume integral with the Divergence Theorem: ∮SJ⋅dS=∫V(∇⋅J) dV\oint_S\mathbf J\cdot\mathrm d\mathbf S=\int_V(\nabla\cdot\mathbf J)\,\mathrm dV. Why: trading a boundary integral for a bulk one lets both sides be compared integrand-to-integrand.

Step 3. Since VV is fixed, the time derivative slides inside and both terms live over the same volume: ∫V(∂ρ∂t+∇⋅J)dV=0\int_V\big(\frac{\partial\rho}{\partial t}+\nabla\cdot\mathbf J\big)\mathrm dV=0. Why: with the region not moving, ddt\frac{\mathrm d}{\mathrm dt} acts only on ρ\rho, so the integrals combine.

Step 4. The integral vanishes for every VV, which forces the integrand to zero: ∂ρ∂t+∇⋅J=0\frac{\partial\rho}{\partial t}+\nabla\cdot\mathbf J=0. Why: a continuous function whose integral over every region is zero is itself zero everywhere — this localisation turns a global balance into a pointwise law. *The same four steps recover ∂tρ+∇⋅(ρv)=0\partial_t\rho+\nabla\cdot(\rho\mathbf v)=0 for fluid mass conservation, charge conservation behind Maxwell's equations, and ∂t∣ψ∣2+∇⋅j=0\partial_t|\psi|^2+\nabla\cdot\mathbf j=0 for probability in quantum mechanics — only the interpretation of ρ\rho and J\mathbf J changes.*

Go deeper · Derivation C · 1 minThe inverse-square field and its delta-function source
Derivation CThe inverse-square field and its delta-function source

The goal is to resolve a paradox at the foundation of electrostatics and gravitation: the field F=r^/r2\mathbf F=\hat{\mathbf r}/r^2 has strictly zero divergence everywhere it is defined, yet it clearly emanates from the origin. We compute the divergence away from the origin, the total flux through an enclosing sphere, and reconcile the two with the Divergence Theorem — discovering that the divergence is a Dirac delta concentrated at the source point.

Step 1. Apply the spherical radial term for r≠0r\neq0: ∇⋅(r^/r2)=1r2∂∂r(r2⋅1r2)=1r2∂(1)∂r=0\nabla\cdot(\hat{\mathbf r}/r^2)=\frac1{r^2}\frac{\partial}{\partial r}\big(r^2\cdot\frac1{r^2}\big)=\frac1{r^2}\frac{\partial(1)}{\partial r}=0. Why: the metric factor r2r^2 cancels the field's 1/r21/r^2, leaving the derivative of a constant — so the field is genuinely source-free everywhere except the origin, where the formula is singular.

Step 2. Compute the flux through a sphere of any radius RR: ∮Sr^r2⋅r^ r2sin⁡θ dθ dϕ=∫02π ⁣ ⁣∫0πsin⁡θ dθ dϕ=4π\oint_S\frac{\hat{\mathbf r}}{r^2}\cdot\hat{\mathbf r}\,r^2\sin\theta\,\mathrm d\theta\,\mathrm d\phi=\int_0^{2\pi}\!\!\int_0^\pi\sin\theta\,\mathrm d\theta\,\mathrm d\phi=4\pi. Why: the area element carries r2r^2, cancelling the field's 1/r21/r^2, so the integrand is radius-independent — a fixed 4π4\pi through every sphere.

Step 3. Reconcile with the Divergence Theorem: the volume integral of the divergence over any region containing the origin must equal 4π4\pi, yet the divergence is zero everywhere except one point. Why: a function zero almost everywhere integrates to zero; getting 4π4\pi instead demands a source of zero width and finite strength — a Dirac delta.

Step 4. Identify it: ∇⋅(r^/r2)=4π δ3(r)\nabla\cdot(\hat{\mathbf r}/r^2)=4\pi\,\delta^3(\mathbf r), with defining property ∫V4π δ3(r) dV=4π\int_V4\pi\,\delta^3(\mathbf r)\,\mathrm dV=4\pi for every VV enclosing the origin. Why: this is exactly the distribution that is zero away from a point yet integrates to a fixed nonzero value. *Multiplying by q/4πε0q/4\pi\varepsilon_0 turns this result directly into Gauss's law ∇⋅E=ρ/ε0\nabla\cdot\mathbf E=\rho/\varepsilon_0 for a point charge, and the total flux 4π4\pi is the geometric root of the factor 4π4\pi that appears throughout Gaussian electromagnetism.*

Limiting cases

Four special cases fix the operator's meaning and are worth carrying in memory:

CaseResultMeaning
Uniform (constant) field∇⋅C=0, C=const\nabla\cdot\mathbf C=0,\ \mathbf C=\text{const}No spreading anywhere; every region takes in exactly what it lets out — no sources.
Solenoidal (source-free) field∇⋅F=0\nabla\cdot\mathbf F=0Flux is conserved at every point; field lines form closed loops or run to infinity. The magnetic field B\mathbf B is the canonical case.
Linear radial flow∇⋅(k r)=3k\nabla\cdot(k\,\mathbf r)=3kFor r=(x,y,z)\mathbf r=(x,y,z), the divergence is the constant 3k3k — uniform isotropic expansion, contributing one kk per spatial dimension.
Inverse-square radial field∇⋅(r^/r2)=4π δ3(r)\nabla\cdot(\hat{\mathbf r}/r^2)=4\pi\,\delta^3(\mathbf r)Zero everywhere except a delta-function source at the origin — the seed of Gauss's law and the Coulomb and gravitational fields.

Worked examples

1 · Cartesian divergence at a point (confidence builder)

Compute ∇⋅F\nabla\cdot\mathbf F for F=(x2y, y2z, z2x)\mathbf F=(x^2y,\ y^2z,\ z^2x) and evaluate it at the point (1,2,3)(1,2,3).

Step 1. Differentiate each component along its own axis. ∂x(x2y)=2xy\partial_x(x^2y)=2xy; ∂y(y2z)=2yz\partial_y(y^2z)=2yz; ∂z(z2x)=2zx\partial_z(z^2x)=2zx. Only the diagonal derivatives matter — the field's dependence on the other variables is invisible to the divergence.

Step 2. Add them: ∇⋅F=2xy+2yz+2zx=2(xy+yz+zx)\nabla\cdot\mathbf F=2xy+2yz+2zx=2(xy+yz+zx). This is the divergence as a field, valid at every point.

Step 3. Evaluate at (1,2,3)(1,2,3): xy+yz+zx=(1)(2)+(2)(3)+(3)(1)=2+6+3=11xy+yz+zx=(1)(2)+(2)(3)+(3)(1)=2+6+3=11, so ∇⋅F=2×11=22\nabla\cdot\mathbf F=2\times11=\mathbf{22}. Because the result is positive, the point (1,2,3)(1,2,3) acts as a net source — a tiny box there leaks more of F\mathbf F than it collects. ∇·F = 2(xy + yz + zx), which is 22 at (1, 2, 3).

2 · Verifying the Divergence Theorem for F = r (fully worked)

Confirm equation (6) directly for the radial field F=r=(x,y,z)\mathbf F=\mathbf r=(x,y,z) over a solid ball of radius R=2R=2 by computing both sides.

Step 1. The volume side. ∇⋅r=∂xx+∂yy+∂zz=1+1+1=3\nabla\cdot\mathbf r=\partial_xx+\partial_yy+\partial_zz=1+1+1=3, a constant. So ∫V(∇⋅F) dV=3×(volume of the ball)=3×43πR3=4πR3\int_V(\nabla\cdot\mathbf F)\,\mathrm dV=3\times(\text{volume of the ball})=3\times\frac43\pi R^3=4\pi R^3. With R=2R=2, this is 4π×8=32π≈100.54\pi\times8=\mathbf{32\pi}\approx100.5.

Step 2. The surface side. On the sphere the outward normal is r^\hat{\mathbf r}, and F⋅r^=r⋅r^=∣r∣=R\mathbf F\cdot\hat{\mathbf r}=\mathbf r\cdot\hat{\mathbf r}=|\mathbf r|=R, a constant over the whole surface. So ∮SF⋅dS=R×(area of the sphere)=R×4πR2=4πR3\oint_S\mathbf F\cdot\mathrm d\mathbf S=R\times(\text{area of the sphere})=R\times4\pi R^2=4\pi R^3. With R=2R=2, this is again 4π×8=32π4\pi\times8=\mathbf{32\pi}.

Step 3. The two sides agree: 32π=32π32\pi=32\pi. The check exposes the geometry — the field grows linearly with rr while the enclosing area grows as r2r^2, and the theorem stitches the two together consistently. Both sides equal 32π ≈ 100.5, confirming ∫ ∇·F dV = ∮ F·dS.

3 · Spherical divergence: the metric factor in action

Using the spherical formula, compute the divergence of (a) F=r r^\mathbf F=r\,\hat{\mathbf r} and (b) G=r^/r2\mathbf G=\hat{\mathbf r}/r^2, and reconcile with the Cartesian results.

Step 1. For (a), Fr=rF_r=r and Fθ=Fϕ=0F_\theta=F_\phi=0, so only the radial term survives: ∇⋅F=1r2∂r(r2⋅r)=1r2∂r(r3)=1r2⋅3r2=3\nabla\cdot\mathbf F=\frac1{r^2}\partial_r(r^2\cdot r)=\frac1{r^2}\partial_r(r^3)=\frac1{r^2}\cdot3r^2=3. This matches ∇⋅r=3\nabla\cdot\mathbf r=3 from Example 2 — the same scalar, two coordinate systems, one answer.

Step 2. For (b), Gr=1/r2G_r=1/r^2, so ∇⋅G=1r2∂r(r2⋅r−2)=1r2∂r(1)=0\nabla\cdot\mathbf G=\frac1{r^2}\partial_r(r^2\cdot r^{-2})=\frac1{r^2}\partial_r(1)=0 for r≠0r\neq0. The metric factor r2r^2 did the essential work: it cancelled the field's 1/r21/r^2 before differentiating, which is why the answer is 00 and not the naive ∂r(r−2)=−2/r3\partial_r(r^{-2})=-2/r^3.

Step 3. The contrast is the lesson: r r^r\,\hat{\mathbf r} spreads uniformly (divergence 33 everywhere, a distributed source), while r^/r2\hat{\mathbf r}/r^2 is source-free away from the origin and hides its whole source in a delta at r=0r=0. ∇·(r r̂) = 3 (matching the Cartesian value) and ∇·(r̂/r²) = 0 for r ≠ 0 — both obtained only by keeping the 1/r² metric factor.

Physics of the portrait

Divergence is a rare concept that was used for two centuries before it had a name or a symbol. It began as an integral identity in the hands of the potential theorists, and only became a pointwise operator when vector analysis was invented at the end of the nineteenth century.

Origins · 1 mindivergence and how this was discovered
D
divergence
the flux-density operator ∇·F = lim(V→0) (1/V) ∮ F·dS · vector calculus of continuum physics

The divergence is the child of two lineages that met late. The first is potential theory: Joseph-Louis Lagrange met the flux integral in fluid mechanics in the 1760s, and Carl Friedrich Gauss, in his 1813 memoir on the attraction of ellipsoids, proved a special case of what we now call the Divergence Theorem. The general theorem — the identity ∫V∇⋅F dV=∮SF⋅dS\int_V\nabla\cdot\mathbf F\,\mathrm dV=\oint_S\mathbf F\cdot\mathrm d\mathbf S that makes the operator useful — was first proved by the Russian mathematician Mikhail Ostrogradsky in 1826, which is why continental texts still call it the Gauss–Ostrogradsky theorem; George Green's 1828 essay on electricity and magnetism gave the parallel identities that carry his name. But none of these workers had a divergence operator: they had surface and volume integrals and the relation between them. The pointwise object ∇⋅F\nabla\cdot\mathbf F arrived with vector analysis. James Clerk Maxwell, in his 1873 Treatise, used the quantity but named its negative the "convergence", and William Kingdon Clifford introduced the word "divergence" in his 1878 Elements of Dynamic. The modern notation and the clean split of ∇\nabla into gradient, divergence, and curl were forged in the 1880s by Josiah Willard Gibbs at Yale and Oliver Heaviside in England, working independently to strip Hamilton's quaternions down to the three-dimensional vector calculus physicists actually use. What Gauss and Ostrogradsky wrote as a theorem about integrals became, in their hands, a differential operator whose value at a point is flux density — the form in every physics course today.

History
1813
— Gauss proves a special case of the flux–volume theorem in his memoir on the attraction of ellipsoids
1826
— Ostrogradsky gives the first general proof of the divergence theorem
1828
— Green's essay founds potential theory and states the identities that bear his name
1873
— Maxwell's Treatise uses the operator, naming its negative the convergence
1881
— Gibbs and Heaviside standardize the notation ∇·F and the split of del into grad, div, curl

Going further

Texts. Stone and Goldbart, Mathematics for Physics, §10 (vector calculus) · Arfken, Weber and Harris, Mathematical Methods for Physicists, 7th ed., §3.5–3.6 and §3.10 (curvilinear forms) · Hassani, Mathematical Physics, Ch. 15 (vector analysis) · Nakahara, Geometry, Topology and Physics, §5.4 (divergence as 1g∂i(g Fi)\frac1{\sqrt g}\partial_i(\sqrt g\,F^i)) · Riley, Hobson and Bence, Mathematical Methods for Physics and Engineering, 3rd ed., §10.7–10.9 · Griffiths, Introduction to Electrodynamics, 4th ed., §1.2.4 and §1.5.3. Key numerical anchors: ∇⋅r=3\nabla\cdot\mathbf r=3; the flux of r^/r2\hat{\mathbf r}/r^2 over any enclosing sphere is exactly 4π4\pi; the Divergence-Theorem check for F=r\mathbf F=\mathbf r over the ball R=2R=2 gives 32π≈100.532\pi\approx100.5 on both sides.

Prerequisites. Scalar and Vector Fields · The Del Operator and Vector Differential Identities · Surface Integrals and Flux · Partial derivatives. Leads to. The Divergence (Gauss) Theorem · The Laplacian Operator · Curl of a Vector Field · Volume Integrals.

Ask the tutor: Ask me to walk through why the metric factor r2r^2 makes ∇⋅(r^/r2)\nabla\cdot(\hat{\mathbf r}/r^2) vanish away from the origin yet hide a 4π4\pi delta-function source at it.

Is divergence the same thing as the divergence theorem?

No — they are the local and global versions of one idea. The divergence ∇⋅F\nabla\cdot\mathbf F is a pointwise scalar: the flux per unit volume produced right at a point. The divergence theorem (equation 6) is an integral identity that adds up that pointwise flux density over a whole region and equates it to the total flux through the boundary, ∫V∇⋅F dV=∮SF⋅dS\int_V\nabla\cdot\mathbf F\,\mathrm dV=\oint_S\mathbf F\cdot\mathrm d\mathbf S. You can compute the operator at a single point without ever mentioning a surface; the theorem is what lets you trade a volume of sources for a surface of flux.

Why does divergence return a scalar while gradient and curl return vectors?

Because it is built as a contraction — a dot product — rather than a directional derivative or a cross product. The gradient asks "in which direction does a scalar increase fastest?", which has a direction, so it is a vector. The curl asks "about which axis does a vector circulate?", again directional. Divergence asks "how much is the field spreading, summed over all directions at once?", a single number with no preferred direction. Formally, ∇⋅F\nabla\cdot\mathbf F contracts the two indices of ∂iFj\partial_iF_j by setting i=ji=j and summing, and a fully contracted object is a scalar — invariant under rotations of the axes.

What does it mean physically for divergence to be negative?

A negative divergence marks a sink — a point where more of the field flows in than out, so field lines are absorbed or the flowing quantity is disappearing. For a fluid velocity field, ∇⋅v<0\nabla\cdot\mathbf v<0 means the fluid is compressed there: a small parcel shrinks in volume as it moves. For an electric field, a region of negative divergence contains negative charge, since ∇⋅E=ρ/ε0\nabla\cdot\mathbf E=\rho/\varepsilon_0. The sign is a strict verdict: positive is net creation or outflow, negative is net destruction or inflow, zero means the point merely relays whatever passes through it.

Why is ∇·B = 0 but ∇·E is not?

Because electric charges exist as isolated sources while magnetic charges (monopoles) apparently do not. Gauss's law ∇⋅E=ρ/ε0\nabla\cdot\mathbf E=\rho/\varepsilon_0 says that wherever there is charge density ρ\rho, the electric field has a source or sink — lines start on positive charges and end on negative ones. The magnetic law ∇⋅B=0\nabla\cdot\mathbf B=0 says magnetic field lines never start or end; they always close on themselves. This follows the moment you write B=∇×A\mathbf B=\nabla\times\mathbf A, because the divergence of any curl is identically zero (equation 7). Experimentally no isolated magnetic pole has been found, which is why the right-hand side stays exactly zero — though searches continue.

Why can't I just add ∂F_r/∂r + ∂F_θ/∂θ + ∂F_φ/∂φ in spherical coordinates?

Because the spherical basis vectors change direction from point to point, so their derivatives contribute terms the naive sum omits. The clean way to see it is the master formula ∇⋅F=1g∂i(g Fi)\nabla\cdot\mathbf F=\frac1{\sqrt g}\partial_i(\sqrt g\,F^i): the Jacobian g=r2sin⁡θ\sqrt g=r^2\sin\theta must sit inside the derivatives, producing 1r2∂r(r2Fr)\frac1{r^2}\partial_r(r^2F_r) and 1rsin⁡θ∂θ(sin⁡θ Fθ)\frac1{r\sin\theta}\partial_\theta(\sin\theta\,F_\theta). Physically, a radial face of a spherical cell has area proportional to r2r^2, so the outer face is larger than the inner, and that growth weights the flux — an effect the bare ∂rFr\partial_rF_r misses. Skipping the metric factors breaks conservation; a real source-free field would appear to have nonzero divergence.

What does ∇·(r̂/r²) = 4π δ³(r) actually mean?

It means the inverse-square field has all of its source packed into a single point of zero size. Away from the origin the field is perfectly source-free — you can verify ∇⋅(r^/r2)=0\nabla\cdot(\hat{\mathbf r}/r^2)=0 directly — yet the flux through any sphere around the origin is a fixed 4π4\pi, however small the sphere. A quantity that is zero everywhere except one point yet integrates to a nonzero value is, by definition, a Dirac delta. The coefficient 4π4\pi is the total flux, and the geometric origin of the 4π4\pi that peppers Gaussian electromagnetism. Multiply by q/4πε0q/4\pi\varepsilon_0 and this becomes Gauss's law for a point charge, ∇⋅E=ρ/ε0\nabla\cdot\mathbf E=\rho/\varepsilon_0.

Before this

Where this leads