The Divergence (Gauss) Theorem

The divergence theorem is the three-dimensional grammar of conservation. It says that whatever a vector field F\mathbf{F} is doing deep inside a region — the way it spreads apart or converges at every interior point — is completely legible from its behaviour on the boundary alone. Written as ∫V(∇⋅F) dV=∮SF⋅n^ dS\int_V(\nabla\cdot\mathbf{F})\,\mathrm{d}V=\oint_S\mathbf{F}\cdot\hat{\mathbf{n}}\,\mathrm{d}S, it equates the total source strength packed into a solid region VV with the net outward flux through its enclosing surface S=∂VS=\partial V. Add up all the little faucets and drains inside; the surplus has nowhere to go but out across the skin. That single identity does enormous work in physics. It turns Gauss's law from a statement about field lines into the differential ∇⋅E=ρ/ε0\nabla\cdot\mathbf{E}=\rho/\varepsilon_0; it forces every conserved quantity — charge, mass, energy, probability — to obey a local continuity equation ∂tρ+∇⋅J=0\partial_t\rho+\nabla\cdot\mathbf{J}=0; and it is the origin of Green's identities and hence of nearly every uniqueness proof in potential theory. Trade a hard surface integral for an easy volume integral, or promote a global balance into a pointwise law: both moves are this theorem. Underneath the vector-calculus dress it is one line of a deeper story. The generalized Stokes theorem ∫Vdω=∫∂Vω\int_V\mathrm{d}\omega=\int_{\partial V}\omega contains the fundamental theorem of calculus, Green's theorem, the curl theorem, and the divergence theorem as instances of a single sentence: the integral of a derivative over a region is fixed by the values on its boundary. This article proves the theorem, verifies it on real numbers, and traces where it lives in modern physics.

Key takeaways
  • The divergence theorem equates the volume integral of ∇⋅F\nabla\cdot\mathbf{F} over a region VV to the outward flux of F\mathbf{F} through its closed boundary surface S=∂VS=\partial V.
  • It promotes the local meaning of divergence — flux per unit volume — into a global balance law tying interior sources to what crosses the boundary.
  • It is the three-dimensional fundamental theorem of calculus and one instance of the master identity ∫Vdω=∫∂Vω\int_V\mathrm{d}\omega=\int_{\partial V}\omega.
  • It converts Gauss's law, the continuity equation, and Green's identities into differential form, underpinning electromagnetism, fluid mechanics, and potential theory.
  • Validity needs F∈C1\mathbf{F}\in C^1 on a compact region with piecewise-smooth, outward-oriented boundary; interior singularities (like a 1/r21/r^2 point source) must be excised and treated as delta-function sources.
  • Key idea: the net outward flux of a field through any closed surface equals the total divergence enclosed — interior sources and sinks are exactly paid for by what crosses the boundary.
The core insight

The net outward flux of a field through any closed surface equals the total divergence (source strength) it encloses: interior sources and sinks are precisely accounted for by what crosses the boundary.

Where this lives today

The divergence theorem is a live tool across computational and experimental physics. Every finite-volume solver in computational fluid dynamics — the codes that design aircraft wings, turbine blades, and combustion chambers — is built directly on it: the method discretizes the integral conservation laws cell by cell, so that flux leaving one cell enters its neighbour exactly, and mass, momentum, and energy are conserved to machine precision by construction. In electromagnetics the same identity turns Maxwell's ∇⋅D=ρ\nabla\cdot\mathbf{D}=\rho and ∇⋅B=0\nabla\cdot\mathbf{B}=0 into the integral laws that finite-element field solvers enforce on a mesh, forbidding spurious magnetic monopoles in a simulated antenna or MRI coil. In gravitation it is the engine of the shell theorem and of Poisson's equation ∇2Φ=4πGρ\nabla^2\Phi=4\pi G\rho, which every NN-body and stellar-structure code integrates, and it underlies the boundary-element methods of acoustics and biomolecular electrostatics, where a hard three-dimensional problem collapses to a surface integral. At the frontier, the generalized form ∫Vdω=∫∂Vω\int_V\mathrm{d}\omega=\int_{\partial V}\omega is the classical shadow of the boundary operators in gauge theory and topology — the same "boundary of a boundary is zero" bookkeeping that constrains conserved currents in the Standard Model.

The physical picture

Imagine VV filled with an incompressible fluid and sealed inside a balloon-shaped surface SS. If nothing creates or destroys fluid inside, every drop that enters must leave: the net flux through SS is zero, mirroring ∇⋅F=0\nabla\cdot\mathbf{F}=0 everywhere within. Now open a faucet inside — a source. The extra fluid it injects has only one exit, across the boundary, so the total outward flux equals the faucet's strength, which is exactly the integrated divergence. The theorem is bookkeeping: sources and sinks in the interior are settled, to the last drop, by the traffic across the skin. The proof's engine is the cancellation of interior walls. Tile VV with tiny boxes. The outward flux of one box across a wall it shares with a neighbour is the exact negative of the neighbour's outward flux across that same wall, because the two outward normals point in opposite directions. Sum over all boxes and every interior wall is counted twice with opposite sign — they annihilate in pairs — leaving only the true outer boundary. Meanwhile each box's flux divided by its volume converges, by definition, to the divergence there, so the surviving sum becomes ∫V∇⋅F dV\int_V\nabla\cdot\mathbf{F}\,\mathrm{d}V.

Figure
Tiling V into cells: each shared interior wall is crossed twice with opposite outward normals, so those fluxes cancel in pairs (red); only the true boundary S = ∂V survives (green), and the cell sum of flux-per-volume becomes ∫ ∇·F dV, giving ∫ ∇·F dV = ∮ F·n̂ dS
Interior faces cancel in pairs — only the boundary S = ∂V survives shared wall: opposite normals cancel source cell ∇·F positive net outward flux = ∮ F·n̂ dS ∫ ∇·F dV (interior) = ∮ F·n̂ dS (boundary)

The theorem is, at heart, a higher-dimensional fundamental theorem of calculus. In one dimension ∫abf′(x) dx=f(b)−f(a)\int_a^b f'(x)\,\mathrm{d}x=f(b)-f(a) evaluates the integral of a derivative purely from boundary data; here a divergence integrated over a solid region is fixed by boundary flux. Both say integrate the derivative, read off the boundary. The second figure makes this concrete for the most important field in physics — the inverse-square field of a point source — where the flux comes out to a clean number independent of the surface chosen.

Figure
An inverse-square field has ∇·E = 0 everywhere except at the source, so the flux through the dashed sphere S_R and the irregular surface S is identical: the geometric cancellation (1/R²)(4πR²) = 4π makes it independent of size and shape. With q = 1 nC the flux is q/ε₀ ≈ 113 N·m² per C through any enclosing surface
Point-charge flux is q/ε₀ through any enclosing surface — R² area cancels 1/R² field + +q sphere S_R any surface S ∮ E·n̂ dS = q/ε₀ same for S and S_R On the sphere S_R: (q/4πε₀)·(1/R²)·(4πR²) = q/ε₀ (R cancels) q = 1 nC → q/ε₀ ≈ 113 N·m² per C

The core equations

The theorem itself is a single equation, but it is worth stating with full care about what each symbol must satisfy. The left side sums the local source density throughout the interior; the right side measures the net rate at which the field pierces the enclosing surface outward. Equality holds whenever the field is smooth enough and the region is well behaved.

∫V(∇⋅F) dV=∮S=∂VF⋅n^ dS(1)\int_V (\nabla\cdot\mathbf{F})\,\mathrm{d}V = \oint_{S=\partial V} \mathbf{F}\cdot\hat{\mathbf{n}}\,\mathrm{d}S \qquad (1)

where: VV — compact region of R3\mathbb{R}^3 with piecewise-smooth boundary; S=∂VS=\partial V — closed boundary surface, outward oriented; F\mathbf{F} — continuously differentiable (C1C^1) vector field on VV; n^\hat{\mathbf{n}} — outward unit normal to SS; ∇⋅F=∂xFx+∂yFy+∂zFz\nabla\cdot\mathbf{F}=\partial_xF_x+\partial_yF_y+\partial_zF_z — the divergence; dV, dS\mathrm{d}V,\ \mathrm{d}S — volume and surface elements. Read it as: total source inside = net outflow across the skin. The right-hand quantity has a purely local meaning that makes the whole theorem almost tautological once granted. The divergence at a point is defined as the outward flux through a small closed surface around it, divided by the enclosed volume, in the limit that the surface shrinks to the point. This is the microscopic seed of which equation (1) is the macroscopic harvest.

∇⋅F(r)=lim⁡V→01V∮∂VF⋅n^ dS(2)\nabla\cdot\mathbf{F}(\mathbf{r}) = \lim_{V\to 0}\frac{1}{V}\oint_{\partial V}\mathbf{F}\cdot\hat{\mathbf{n}}\,\mathrm{d}S \qquad (2)

where: V→0V\to 0 — a region collapsing onto the point r\mathbf{r}; ∂V\partial V — its shrinking boundary. Read it as: divergence is flux per unit volume in the small-region limit — sum this over a partition and interior walls cancel, delivering equation (1). Equations (1) and (2) are the vector-calculus face of a deeper statement. In the language of differential forms the field defines a flux 2-form ω\omega, its divergence is the exterior derivative dω\mathrm{d}\omega, and the theorem becomes the generalized Stokes theorem, which reads identically in every dimension.

∫Vdω=∮∂Vω,ω=Fx dy∧dz+Fy dz∧dx+Fz dx∧dy(3)\int_V \mathrm{d}\omega = \oint_{\partial V}\omega,\qquad \omega = F_x\,\mathrm{d}y\wedge\mathrm{d}z + F_y\,\mathrm{d}z\wedge\mathrm{d}x + F_z\,\mathrm{d}x\wedge\mathrm{d}y \qquad (3)

where: ω\omega — flux 2-form built from F\mathbf{F}; dω=(∇⋅F) dx∧dy∧dz\mathrm{d}\omega=(\nabla\cdot\mathbf{F})\,\mathrm{d}x\wedge\mathrm{d}y\wedge\mathrm{d}z — its exterior derivative, the volume form weighted by divergence. Read it as: the same sentence — integral of a derivative equals boundary values — that gives the fundamental theorem of calculus in one dimension and Green's and Stokes' theorems in two. Feeding the theorem a cleverly chosen field turns it into an identity relating scalar fields. Taking F=ϕ ∇ψ\mathbf{F}=\phi\,\nabla\psi and expanding its divergence with the product rule yields Green's first identity, the workhorse of potential theory and boundary-value problems.

∫V(ϕ ∇2ψ+∇ϕ⋅∇ψ) dV=∮Sϕ ∇ψ⋅n^ dS(4)\int_V (\phi\,\nabla^2\psi + \nabla\phi\cdot\nabla\psi)\,\mathrm{d}V = \oint_S \phi\,\nabla\psi\cdot\hat{\mathbf{n}}\,\mathrm{d}S \qquad (4)

where: ϕ,ψ\phi,\psi — twice-differentiable scalar fields; ∇2\nabla^2 — the Laplacian; ∇ψ⋅n^=∂ψ/∂n\nabla\psi\cdot\hat{\mathbf{n}}=\partial\psi/\partial n — the outward normal derivative. Read it as: an integration by parts in three dimensions, trading a Laplacian in the volume for a normal derivative on the surface plus a gradient-overlap term. Interchanging ϕ\phi and ψ\psi and subtracting cancels the overlap term and gives Green's second identity, the symmetric statement behind Green's-function representations and uniqueness proofs. Finally, feeding the theorem a conserved current turns a global conservation statement into a local one. Equating the rate of decrease of a conserved quantity inside VV to its outward flux, then converting that flux to a volume integral, forces the integrands to match pointwise because VV is arbitrary.

∂ρ∂t+∇⋅J=0(5)\frac{\partial \rho}{\partial t} + \nabla\cdot\mathbf{J} = 0 \qquad (5)

where: ρ\rho — density of a conserved quantity; J\mathbf{J} — its flux (current) density. Read it as: whatever accumulates locally must have flowed in through the neighbourhood — the universal template for conservation of charge, mass, energy, and quantum probability.

Derivation AProof by reduction to the fundamental theorem of calculus

The goal is to prove equation (1) honestly for the concrete case of a region that is "simple" in each coordinate direction — one where vertical, and likewise horizontal, lines pierce the boundary in exactly two points — and then to indicate how a general region is stitched together from such pieces. The strategy is to prove the zz-component identity alone, because the xx- and yy-components follow by identical arguments and add; the whole three-dimensional theorem then collapses onto three one-dimensional applications of the fundamental theorem of calculus, which is where the "derivative integrated equals boundary values" content actually enters.

Step 1. Let VV be bounded below by z=g(x,y)z=g(x,y) and above by z=h(x,y)z=h(x,y) over a base region DD in the xyxy-plane, and write the volume integral of ∂Fz/∂z\partial F_z/\partial z as an iterated integral, doing the zz-integration first along each vertical column: ∫V∂Fz∂z dV=∬D[∫gh∂Fz∂z dz]dx dy\int_V\frac{\partial F_z}{\partial z}\,\mathrm{d}V=\iint_D\left[\int_{g}^{h}\frac{\partial F_z}{\partial z}\,\mathrm{d}z\right]\mathrm{d}x\,\mathrm{d}y. Why: Fubini's theorem lets us integrate along the direction in which the derivative acts, setting up a one-dimensional fundamental-theorem step inside each column.

Step 2. Evaluate the inner integral by the fundamental theorem of calculus: ∫gh∂zFz dz=Fz(x,y,h)−Fz(x,y,g)\int_g^h\partial_zF_z\,\mathrm{d}z=F_z(x,y,h)-F_z(x,y,g), so the volume integral becomes ∬D[Fz(x,y,h)−Fz(x,y,g)] dx dy\iint_D[F_z(x,y,h)-F_z(x,y,g)]\,\mathrm{d}x\,\mathrm{d}y. Why: the antiderivative of ∂zFz\partial_zF_z in zz is FzF_z itself, so the whole interior integral collapses to values on the top and bottom sheets — boundary data, exactly as the theorem promises.

Step 3. Reinterpret each sheet as part of the closed surface. On the top sheet the outward normal tilts upward, so k^⋅n^ dS=+dx dy\hat{\mathbf{k}}\cdot\hat{\mathbf{n}}\,\mathrm{d}S=+\mathrm{d}x\,\mathrm{d}y; on the bottom sheet it tilts downward, giving −dx dy-\mathrm{d}x\,\mathrm{d}y; on any vertical side wall n^⊥k^\hat{\mathbf{n}}\perp\hat{\mathbf{k}} so that face contributes nothing to this component. Why: the two signs in the bracket of Step 2 are precisely the two signs of k^⋅n^\hat{\mathbf{k}}\cdot\hat{\mathbf{n}} on the upper and lower caps, which is what lets the difference recombine into a single closed-surface integral.

Step 4. Assemble the two caps and the (zero) side walls into one closed integral: ∬D[Fz(x,y,h)−Fz(x,y,g)] dx dy=∮SFz k^⋅n^ dS\iint_D[F_z(x,y,h)-F_z(x,y,g)]\,\mathrm{d}x\,\mathrm{d}y=\oint_SF_z\,\hat{\mathbf{k}}\cdot\hat{\mathbf{n}}\,\mathrm{d}S, establishing the zz-component identity ∫V∂zFz dV=∮SFz k^⋅n^ dS\int_V\partial_zF_z\,\mathrm{d}V=\oint_SF_z\,\hat{\mathbf{k}}\cdot\hat{\mathbf{n}}\,\mathrm{d}S. Why: the top and bottom surface integrals, once their signs are absorbed into the normal, are literally the two contributions of the closed surface to Fzk^⋅n^F_z\hat{\mathbf{k}}\cdot\hat{\mathbf{n}}.

Step 5. Run the identical argument for the xx- and yy-components and add all three: ∫V∇⋅F dV=∮SF⋅n^ dS\int_V\nabla\cdot\mathbf{F}\,\mathrm{d}V=\oint_S\mathbf{F}\cdot\hat{\mathbf{n}}\,\mathrm{d}S. A region that is not simple is chopped into simple sub-regions; the flux across every internal cut appears twice with opposite normals and cancels, so only the true outer boundary survives — the same telescoping seen in the tiling picture. Why: summing the three coordinate identities reconstitutes the full dot product F⋅n^=Fxnx+Fyny+Fznz\mathbf{F}\cdot\hat{\mathbf{n}}=F_x n_x+F_y n_y+F_z n_z, completing the theorem.

Go deeper · Derivation B · 2 minThe inverse-square field, shape independence, and the delta-function source
Derivation BThe inverse-square field, shape independence, and the delta-function source

The goal is to reconcile the divergence theorem with the single most important field in physics — the Coulomb or Newtonian 1/r21/r^2 field — which appears at first to violate it, because its divergence is zero everywhere the field is defined yet its flux through any enclosing sphere is emphatically not zero. The resolution is that the field fails to be C1C^1 at the origin, so the naive divergence misses a delta-function source concentrated there; making that source explicit both saves the theorem and produces Gauss's law of electrostatics.

Step 1. Take E=q4πε0r^r2\mathbf{E}=\dfrac{q}{4\pi\varepsilon_0}\dfrac{\hat{\mathbf{r}}}{r^2} and compute its divergence for r≠0r\neq0 using the spherical-coordinate radial formula ∇⋅(Arr^)=1r2∂r(r2Ar)\nabla\cdot(A_r\hat{\mathbf{r}})=\frac{1}{r^2}\partial_r(r^2A_r): here r2Ar=constr^2A_r=\text{const}, so ∇⋅E=1r2∂r(1)⋅q4πε0=0\nabla\cdot\mathbf{E}=\frac{1}{r^2}\partial_r(1)\cdot\frac{q}{4\pi\varepsilon_0}=0. Why: away from the origin the field genuinely has no source — the 1/r21/r^2 falloff exactly balances the r2r^2 growth of spherical shells, which is special to three dimensions.

Step 2. Compute the flux through a sphere SRS_R of radius RR centred on the charge, where n^=r^\hat{\mathbf{n}}=\hat{\mathbf{r}} and the area is 4πR24\pi R^2: ∮SRE⋅n^ dS=q4πε0⋅1R2⋅4πR2=qε0\oint_{S_R}\mathbf{E}\cdot\hat{\mathbf{n}}\,\mathrm{d}S=\frac{q}{4\pi\varepsilon_0}\cdot\frac{1}{R^2}\cdot 4\pi R^2=\frac{q}{\varepsilon_0}. Why: the 1/R21/R^2 field strength and the 4πR24\pi R^2 surface area cancel exactly, so the flux is q/ε0q/\varepsilon_0 regardless of the sphere's radius — the first sign that the answer is geometric, not metric.

Step 3. Extend to any closed surface enclosing the charge by excising a tiny sphere around the origin and applying the theorem to the thin shell between it and the outer surface, where ∇⋅E=0\nabla\cdot\mathbf{E}=0: the theorem then forces the outward flux through the outer surface to equal the flux through the small sphere, namely q/ε0q/\varepsilon_0. Why: shape independence is not luck — it is the divergence theorem applied in the source-free region, so any two surfaces enclosing the same charge carry the same flux.

Step 4. Reconcile with equation (1). Since ∫V∇⋅E dV\int_V\nabla\cdot\mathbf{E}\,\mathrm{d}V must equal q/ε0q/\varepsilon_0 whenever the origin is enclosed and 00 otherwise, the divergence cannot really be zero — it must be a point source: ∇⋅E=qε0 δ3(r)\nabla\cdot\mathbf{E}=\dfrac{q}{\varepsilon_0}\,\delta^3(\mathbf{r}), equivalently ∇⋅(r^/r2)=4π δ3(r)\nabla\cdot(\hat{\mathbf{r}}/r^2)=4\pi\,\delta^3(\mathbf{r}). Why: the delta function is the only distribution that integrates to a fixed nonzero number over any region containing the origin and to zero otherwise, which is exactly the flux behaviour just derived. *The steps above reproduce Gauss's law ∮E⋅n^ dS=q/ε0\oint\mathbf{E}\cdot\hat{\mathbf{n}}\,\mathrm{d}S=q/\varepsilon_0 and establish the identity ∇⋅(r^/r2)=4πδ3(r)\nabla\cdot(\hat{\mathbf{r}}/r^2)=4\pi\delta^3(\mathbf{r}).*

Go deeper · Derivation C · 1 minGreen's identities and the continuity equation from one master theorem
Derivation CGreen's identities and the continuity equation from one master theorem

The goal is to show that two of the most consequential equations in mathematical physics — Green's first identity, which anchors potential theory, and the continuity equation, which encodes every local conservation law — are not independent facts but immediate corollaries of the divergence theorem, obtained by feeding it the right field. This is where the theorem stops being a computational convenience and becomes a generator of physical law.

Step 1. Substitute F=ϕ ∇ψ\mathbf{F}=\phi\,\nabla\psi into equation (1) and expand its divergence with the product rule ∇⋅(ϕ A)=∇ϕ⋅A+ϕ ∇⋅A\nabla\cdot(\phi\,\mathbf{A})=\nabla\phi\cdot\mathbf{A}+\phi\,\nabla\cdot\mathbf{A} taking A=∇ψ\mathbf{A}=\nabla\psi, so that ∇⋅(ϕ ∇ψ)=∇ϕ⋅∇ψ+ϕ ∇2ψ\nabla\cdot(\phi\,\nabla\psi)=\nabla\phi\cdot\nabla\psi+\phi\,\nabla^2\psi. Why: choosing a scalar times a gradient is the trick that converts the vector theorem into a statement about scalar fields and their Laplacians.

Step 2. Insert this divergence and the flux F⋅n^=ϕ ∇ψ⋅n^=ϕ ∂ψ/∂n\mathbf{F}\cdot\hat{\mathbf{n}}=\phi\,\nabla\psi\cdot\hat{\mathbf{n}}=\phi\,\partial\psi/\partial n into the theorem to obtain Green's first identity, equation (4): ∫V(ϕ ∇2ψ+∇ϕ⋅∇ψ) dV=∮Sϕ ∂ψ∂n dS\int_V(\phi\,\nabla^2\psi+\nabla\phi\cdot\nabla\psi)\,\mathrm{d}V=\oint_S\phi\,\frac{\partial\psi}{\partial n}\,\mathrm{d}S. Why: this is the three-dimensional integration by parts — the volume Laplacian term is traded for a surface normal-derivative term, which is exactly what makes Dirichlet and Neumann boundary conditions tractable.

Step 3. Separately, express global conservation of a quantity with density ρ\rho and current J\mathbf{J} as ddt∫Vρ dV=−∮SJ⋅n^ dS\frac{\mathrm{d}}{\mathrm{d}t}\int_V\rho\,\mathrm{d}V=-\oint_S\mathbf{J}\cdot\hat{\mathbf{n}}\,\mathrm{d}S, the statement that the interior amount falls exactly at the rate the current carries it out. Why: this is the physical input — conservation means the only way to change the contents of VV is to move stuff across its boundary, with no creation or destruction inside.

Step 4. Convert the flux with the divergence theorem, ∮SJ⋅n^ dS=∫V∇⋅J dV\oint_S\mathbf{J}\cdot\hat{\mathbf{n}}\,\mathrm{d}S=\int_V\nabla\cdot\mathbf{J}\,\mathrm{d}V, and combine to get ∫V(∂tρ+∇⋅J)dV=0\int_V\left(\partial_t\rho+\nabla\cdot\mathbf{J}\right)\mathrm{d}V=0. Because VV is arbitrary, the integrand must vanish pointwise, yielding the continuity equation (5): ∂tρ+∇⋅J=0\partial_t\rho+\nabla\cdot\mathbf{J}=0. Why: an integral that vanishes over every region forces its integrand to be zero everywhere — this "localization" step is how a global balance law becomes a local differential law.

Limiting cases

Degenerate and special configurations expose exactly what the theorem is claiming — and where its hypotheses bite.

CaseResultMeaning
Solenoidal (source-free) field∇⋅F=0  ⇒  ∮SF⋅n^ dS=0\nabla\cdot\mathbf{F}=0 \;\Rightarrow\; \oint_S \mathbf{F}\cdot\hat{\mathbf{n}}\,\mathrm{d}S = 0A divergence-free field has zero net flux through every closed surface; total flux depends only on the sources enclosed, not on the field elsewhere.
Point source / inverse-square fieldF=q4πε0r^r2, ∮SF⋅n^ dS=qε0\mathbf{F}=\dfrac{q}{4\pi\varepsilon_0}\dfrac{\hat{\mathbf{r}}}{r^2},\ \oint_S\mathbf{F}\cdot\hat{\mathbf{n}}\,\mathrm{d}S=\dfrac{q}{\varepsilon_0}Here ∇⋅F=qε0δ3(r)\nabla\cdot\mathbf{F}=\dfrac{q}{\varepsilon_0}\delta^3(\mathbf{r}): the singularity is a Dirac source and must be counted, giving Gauss's law.
Constant fieldF=c  ⇒  ∮Sc⋅n^ dS=c⋅∮Sn^ dS=0\mathbf{F}=\mathbf{c}\;\Rightarrow\; \oint_S \mathbf{c}\cdot\hat{\mathbf{n}}\,\mathrm{d}S = \mathbf{c}\cdot\oint_S \hat{\mathbf{n}}\,\mathrm{d}S = 0Since ∇⋅c=0\nabla\cdot\mathbf{c}=0 and c\mathbf{c} is arbitrary, the vector area of any closed surface vanishes: ∮Sn^ dS=0\oint_S\hat{\mathbf{n}}\,\mathrm{d}S=\mathbf{0}.
Two-dimensional reduction∮C(F⋅n^) ds=∬A∇⋅F dA\oint_C (\mathbf{F}\cdot\hat{\mathbf{n}})\,\mathrm{d}s = \iint_A \nabla\cdot\mathbf{F}\,\mathrm{d}AApplying the theorem to a unit-height cylinder collapses it to the divergence (normal) form of Green's theorem in the plane.
One-dimensional reduction∫abf′(x) dx=f(b)−f(a)\int_a^b f'(x)\,\mathrm{d}x=f(b)-f(a)The "surface" is two endpoints with outward orientations −1-1 and +1+1: the fundamental theorem of calculus is the theorem in one dimension.

Worked examples

1 · Direct verification for the radial field (confidence builder)

Verify the divergence theorem for F=r=(x,y,z)\mathbf{F}=\mathbf{r}=(x,y,z) over the solid ball of radius a=2a=2, then read off why the two sides must agree.

Step 1. Compute the volume side. The divergence is ∇⋅r=∂xx+∂yy+∂zz=3\nabla\cdot\mathbf{r}=\partial_xx+\partial_yy+\partial_zz=3, a constant, so ∫V∇⋅F dV=3⋅Vol(V)=3⋅43πa3=4πa3\int_V\nabla\cdot\mathbf{F}\,\mathrm{d}V=3\cdot\text{Vol}(V)=3\cdot\frac{4}{3}\pi a^3=4\pi a^3. With a=2a=2 this is 4π⋅8=32π≈100.54\pi\cdot8=\mathbf{32\pi\approx100.5}.

Step 2. Compute the surface side. On the sphere of radius aa the outward normal is n^=r^=r/a\hat{\mathbf{n}}=\hat{\mathbf{r}}=\mathbf{r}/a, so F⋅n^=r⋅r/a=r2/a=a\mathbf{F}\cdot\hat{\mathbf{n}}=\mathbf{r}\cdot\mathbf{r}/a=r^2/a=a everywhere on the surface. Then ∮SF⋅n^ dS=a⋅(4πa2)=4πa3\oint_S\mathbf{F}\cdot\hat{\mathbf{n}}\,\mathrm{d}S=a\cdot(4\pi a^2)=4\pi a^3, again 32π≈100.5\mathbf{32\pi\approx100.5} for a=2a=2.

Step 3. Interpret. Both sides give 4πa34\pi a^3 because the field points radially outward with strength rr, spreading uniformly — its divergence 33 is the isotropic "three directions each contributing one" of expansion in space. This field is the position field whose flux literally measures three times the volume it encloses. Volume side = surface side = 4πa³ = 32π ≈ 100.5, exactly as the theorem demands.

2 · A fully numerical check on the unit cube

Verify the theorem for F=(x2, y2, z2)\mathbf{F}=(x^2,\,y^2,\,z^2) over the unit cube [0,1]3[0,1]^3, computing both sides to a number.

Step 1. Volume side. The divergence is ∇⋅F=2x+2y+2z\nabla\cdot\mathbf{F}=2x+2y+2z. Integrate over the cube: ∫01 ⁣ ⁣∫01 ⁣ ⁣∫01(2x+2y+2z) dx dy dz\int_0^1\!\!\int_0^1\!\!\int_0^1(2x+2y+2z)\,\mathrm{d}x\,\mathrm{d}y\,\mathrm{d}z. Each term integrates independently — ∫012x dx=1\int_0^1 2x\,\mathrm{d}x=1 and the other two unit-length directions contribute a factor 11 each — giving 1+1+1=31+1+1=\mathbf{3}.

Step 2. Surface side, face by face. The cube has six faces; on each, n^\hat{\mathbf{n}} is a coordinate axis, so only the matching component of F\mathbf{F} contributes. On x=1x=1 (with n^=+x^\hat{\mathbf{n}}=+\hat{\mathbf{x}}), F⋅n^=x2=1\mathbf{F}\cdot\hat{\mathbf{n}}=x^2=1, and the face area is 11, giving flux +1+1. On x=0x=0 (with n^=−x^\hat{\mathbf{n}}=-\hat{\mathbf{x}}), F⋅n^=−x2=0\mathbf{F}\cdot\hat{\mathbf{n}}=-x^2=0. The yy- and zz-pairs behave identically: +1+1 on the far face, 00 on the near face.

Step 3. Add the six faces: (1+0)+(1+0)+(1+0)=3(1+0)+(1+0)+(1+0)=\mathbf{3}. The volume and surface sides match exactly. Notice where the flux comes from: the near faces (at coordinate 00) contribute nothing because the field vanishes there, so the entire outflow is carried by the three far faces — the field grows from 00 to 11 across the cube, and that growth is its divergence. Both sides equal 3.

3 · Gauss's law for a uniformly charged sphere (numbers)

A solid sphere of radius a=5 cma=5\ \mathrm{cm} carries total charge Q=1 nCQ=1\ \mathrm{nC} spread uniformly. Use the divergence theorem in integral (Gauss's-law) form to find the electric field just outside the surface and halfway to the centre.

Step 1. Choose a Gaussian sphere of radius rr concentric with the charge. By symmetry E=E(r)r^\mathbf{E}=E(r)\hat{\mathbf{r}}, so ∮SE⋅n^ dS=E(r)⋅4πr2\oint_S\mathbf{E}\cdot\hat{\mathbf{n}}\,\mathrm{d}S=E(r)\cdot4\pi r^2. Gauss's law — the integral form of ∇⋅E=ρ/ε0\nabla\cdot\mathbf{E}=\rho/\varepsilon_0 delivered by the theorem — sets this equal to Qenc(r)/ε0Q_{\text{enc}}(r)/\varepsilon_0.

Step 2. Outside (r≥ar\ge a), all the charge is enclosed, Qenc=QQ_{\text{enc}}=Q, so E(r)=Q4πε0r2=kQr2E(r)=\dfrac{Q}{4\pi\varepsilon_0 r^2}=\dfrac{kQ}{r^2} with k=8.99×109 N m2/C2k=8.99\times10^9\ \mathrm{N\,m^2/C^2}. At the surface r=a=0.05 mr=a=0.05\ \mathrm{m}: E=(8.99×109)(1×10−9)(0.05)2=8.990.0025≈3.6×103 V/mE=\dfrac{(8.99\times10^9)(1\times10^{-9})}{(0.05)^2}=\dfrac{8.99}{0.0025}\approx\mathbf{3.6\times10^{3}\ V/m}.

Step 3. Inside (r<ar<a), only the fraction of charge within radius rr is enclosed: Qenc=Q r3/a3Q_{\text{enc}}=Q\,r^3/a^3, so E(r)=Q r4πε0a3=kQ ra3E(r)=\dfrac{Q\,r}{4\pi\varepsilon_0 a^3}=\dfrac{kQ\,r}{a^3}, which grows linearly from the centre. At r=a/2=0.025 mr=a/2=0.025\ \mathrm{m}: E=(8.99×109)(1×10−9)(0.025)(0.05)3=0.22481.25×10−4≈1.8×103 V/mE=\dfrac{(8.99\times10^9)(1\times10^{-9})(0.025)}{(0.05)^3}=\dfrac{0.2248}{1.25\times10^{-4}}\approx\mathbf{1.8\times10^{3}\ V/m}, exactly half the surface value — as it must be, since E∝rE\propto r inside and rr has halved. Surface field ≈ 3.6 kV/m; field at half-radius ≈ 1.8 kV/m, linear inside and inverse-square outside.

Physics of the portrait

The theorem carries Gauss's name the way a river carries the name of the town at its mouth — for prominence, not priority. The first general proof was another mathematician's, but the identity sits so squarely inside Gauss's potential theory that the attribution has never come loose.

Origins · 1 minCarl Friedrich Gauss and how this was discovered
CF
Carl Friedrich Gauss
1777–1855 · Göttingen; potential theory, geodesy, and the flux–source law of the inverse-square field

Carl Friedrich Gauss dominated nineteenth-century mathematics from Göttingen, and the flux theorem grew directly out of his physics. In an 1813 memoir on the gravitational attraction of homogeneous ellipsoids he proved the special case that now bears his name, using the flux of the inverse-square field to attack the potential of an ellipsoid, a problem that resisted every direct assault. Yet the general divergence theorem, for an arbitrary field and region, was first stated and proved by Mikhail Ostrogradsky, who presented it to the Paris Academy in 1826 and published it in 1831 — which is why in the Russian and French literatures it is often called the Ostrogradsky, or Gauss–Ostrogradsky, theorem. Joseph-Louis Lagrange had met the flux–volume relation in his 1762 study of sound, and George Green, in his privately printed 1828 Essay, built the potential-theory machinery the theorem makes possible, working in provincial isolation as a self-taught miller's son. What ties these strands to Gauss is that his conception of the potential — a scalar whose gradient is the force and whose flux measures the enclosed source — is exactly the setting in which the theorem is most natural, and it was through Gauss's law of electrostatics, later fused into Maxwell's equations, that the identity entered the daily vocabulary of physics. The name records where the theorem lives, even if Ostrogradsky is where it was first proved in full.

History
1762
— Lagrange meets the flux–volume relation while analysing the propagation of sound
1813
— Gauss proves special cases in his memoir on the attraction of homogeneous ellipsoids
1826
— Ostrogradsky states and proves the general theorem, presenting it to the Paris Academy (published 1831)
1828
— Green's Essay develops the identities and potential theory that rest on the theorem
1873
— Maxwell's Treatise makes the theorem the bridge between differential and integral field laws

Going further

Texts. Arfken and Weber, Mathematical Methods for Physicists, 7th ed., §3.9 (Gauss's theorem) · Stone and Goldbart, Mathematics for Physics, ch. on vector calculus and the integral theorems · Riley, Hobson and Bence, Mathematical Methods for Physics and Engineering, ch. 11 · Hassani, Mathematical Physics, ch. on vector analysis · Spivak, Calculus on Manifolds (the generalized Stokes theorem) · Griffiths, Introduction to Electrodynamics, §1.3.4 and §1.5 for the delta-function divergence. Key results to keep in mind: the identity ∇⋅(r^/r2)=4πδ3(r)\nabla\cdot(\hat{\mathbf{r}}/r^2)=4\pi\delta^3(\mathbf{r}); the two direct checks — F=r\mathbf{F}=\mathbf{r} over a ball giving 4πa34\pi a^3 on both sides (32π32\pi at a=2a=2) and F=(x2,y2,z2)\mathbf{F}=(x^2,y^2,z^2) over the unit cube giving 33 on both sides; the uniformly charged sphere with E=kQ/r2E=kQ/r^2 outside and E=kQr/a3E=kQr/a^3 inside, numerically ≈3.6\approx3.6 and ≈1.8 kV/m\approx1.8\ \mathrm{kV/m}; and the product-rule route to Green's first identity together with the localization argument that yields the continuity equation.

Prerequisites. Divergence of a Vector Field · Surface Integrals and Flux · Volume Integrals · The Del Operator and Vector Differential Identities. Leads to. Stokes' Theorem · Green's Theorem in the Plane · The Laplacian Operator.

Ask the tutor: Want to watch the divergence theorem verified on a shape of your choosing, or see it collapse into Gauss's law, Green's identities, or a continuity equation line by line? Ask and we will work it out together.

Is the divergence theorem really just the fundamental theorem of calculus in three dimensions?

Essentially yes, and the analogy is exact rather than loose. The one-dimensional fundamental theorem says the integral of a derivative f′f' over an interval equals ff evaluated on the boundary — the two endpoints, with signs −1-1 and +1+1 for the outward orientations. The divergence theorem says the integral of a "derivative" ∇⋅F\nabla\cdot\mathbf{F} over a solid region equals F\mathbf{F} evaluated (as flux) on the boundary surface. Both are instances of the single master statement ∫Vdω=∫∂Vω\int_V\mathrm{d}\omega=\int_{\partial V}\omega: integrate the derivative over the region, read the answer off the boundary. Green's theorem and the curl form of Stokes' theorem are the two-dimensional members of the same family.

Why must the surface be closed, and what goes wrong for an open surface?

The proof works by tiling the region into cells whose shared interior walls cancel in pairs, leaving only the outer boundary. That cancellation only completes if the boundary wraps all the way around — a closed surface with no exposed edge. An open surface, like a hemispherical cap, has a rim; the cells along that rim have faces with no neighbour to cancel against, so the interior sum does not reduce cleanly to the divergence integral. Physically, flux is only conserved bookkeeping when you account for every exit; leave a hole and you have simply failed to measure some of the outflow. For open surfaces the relevant theorem is the curl form of Stokes' theorem, which relates a surface integral to a line integral around the rim.

How can a field with zero divergence everywhere still have nonzero flux?

This is the famous puzzle of the 1/r21/r^2 field, and its answer is that "everywhere" quietly excludes the one point that matters. The field r^/r2\hat{\mathbf{r}}/r^2 has ∇⋅F=0\nabla\cdot\mathbf{F}=0 at every point where it is defined — but it is not defined, and certainly not C1C^1, at the origin. The divergence theorem requires the field to be continuously differentiable throughout the region, so with the singularity inside, the naive computation misses a concentrated source there. Treated properly as a distribution, the divergence is 4πδ3(r)4\pi\delta^3(\mathbf{r}), a delta function whose integral over any region containing the origin is 4π4\pi — exactly the flux. The theorem is not violated; the source was hiding at a point where the smoothness hypothesis failed.

What is the difference between the differential and integral forms of Gauss's law?

They are the same physics viewed at two scales, and the divergence theorem is the translator. The differential form ∇⋅E=ρ/ε0\nabla\cdot\mathbf{E}=\rho/\varepsilon_0 is a local statement: it fixes the divergence of the field at every point in terms of the charge density there. The integral form ∮SE⋅n^ dS=Qenc/ε0\oint_S\mathbf{E}\cdot\hat{\mathbf{n}}\,\mathrm{d}S=Q_{\text{enc}}/\varepsilon_0 is a global statement: it relates the total flux through a closed surface to the total charge inside. Integrating the differential form over a volume and applying the divergence theorem to the left side turns one into the other. The integral form is what you use to compute fields of symmetric charge distributions; the differential form is what you use in the field equations and to describe the field pointwise.

Why does the theorem generate conservation laws instead of just relating integrals?

Because it lets you demote a global truth to a local one. Suppose a quantity is genuinely conserved — the only way to change the amount inside a region VV is to move it across the boundary. That is a statement about integrals: rate of change inside equals minus the flux out. The divergence theorem rewrites the flux as a volume integral of ∇⋅J\nabla\cdot\mathbf{J}, so both sides are now integrals over the same region VV. Since the region was arbitrary — the conservation law holds for every choice of VV — the integrands themselves must be equal at every point, giving ∂tρ+∇⋅J=0\partial_t\rho+\nabla\cdot\mathbf{J}=0. Without the theorem you would be stuck with a global balance; with it, conservation becomes a differential equation valid pointwise, which is what makes it a field law.

Does the theorem hold in dimensions other than three, or on curved regions?

Yes to both, and this is where the modern viewpoint pays off. In its differential-form guise ∫Vdω=∫∂Vω\int_V\mathrm{d}\omega=\int_{\partial V}\omega, the theorem holds on any compact oriented manifold with boundary, in any dimension, curved or flat — you need only a form, its exterior derivative, and an orientable boundary. One dimension gives the fundamental theorem of calculus; two, Green's theorem; three, the divergence and curl theorems; four dimensions govern relativistic field theory, where flux integrals express charge conservation covariantly. On a curved region the elements pick up metric factors, but the identity is unchanged because it is fundamentally topological — about boundaries, not distances.

Before this

Where this leads