The Divergence (Gauss) Theorem

Here is the payoff of all the vector calculus you have been assembling. You know what divergence is — the faucet-density of a vector field, flux manufactured per unit volume at a point. You know what flux through a surface is. The divergence theorem welds them into one of the most-used identities in physics: add up all the faucets and drains inside a region, and you must get exactly the net flow escaping through its skin. Nothing is created in the interior that does not show up at the boundary. Formally, ∫V(∇⋅F) dτ=∮SF⋅da\int_V(\nabla\cdot\mathbf{F})\,\mathrm{d}\tau=\oint_S\mathbf{F}\cdot\mathrm{d}\mathbf{a} — a volume integral of a derivative traded for a surface integral of the field itself. That trade is the whole game. It is the three-dimensional sibling of the fundamental theorem of calculus, where ∫abf′(x) dx\int_a^b f'(x)\,\mathrm{d}x collapses to the boundary data f(b)−f(a)f(b)-f(a); here the "boundary data" is the flux through the closed surface S=∂VS=\partial V. For electrodynamics this theorem is not a curiosity, it is load-bearing. It is the exact bridge between the two forms of Gauss's law — the local statement ∇⋅E=ρ/ε0\nabla\cdot\mathbf{E}=\rho/\varepsilon_0 and the integral statement ∮E⋅da=Qenc/ε0\oint\mathbf{E}\cdot\mathrm{d}\mathbf{a}=Q_{\mathrm{enc}}/\varepsilon_0 that lets you extract fields from symmetry without solving a single differential equation. It turns ∇⋅B=0\nabla\cdot\mathbf{B}=0 into "no net magnetic flux through anything closed," and the local continuity equation into global charge conservation. Master the proof once — it is an honest telescoping argument, no magic — and you will use the result on nearly every page of this subject.

Key takeaways
  • The divergence theorem states ∮SF⋅da=∫V(∇⋅F) dτ\oint_{S}\mathbf{F}\cdot\mathrm{d}\mathbf{a}=\int_{V}(\nabla\cdot\mathbf{F})\,\mathrm{d}\tau: the outward flux of a vector field through a closed surface equals the volume integral of its divergence over the enclosed region.
  • It is the three-dimensional analogue of the fundamental theorem of calculus — the integral of a derivative over a region is fixed entirely by data on the region's boundary.
  • The proof is a telescoping argument: chop VV into tiny cells; flux across every interior face cancels pairwise between neighbours, leaving only the outer skin.
  • It converts Gauss's law from differential form ∇⋅E=ρ/ε0\nabla\cdot\mathbf{E}=\rho/\varepsilon_0 to integral form ∮E⋅da=Qenc/ε0\oint\mathbf{E}\cdot\mathrm{d}\mathbf{a}=Q_{\mathrm{enc}}/\varepsilon_0, and powers Green's identities, the continuity equation, and Poynting's theorem.
  • Validity requires F\mathbf{F} to be continuously differentiable throughout VV; a point-charge singularity must be handled with the Dirac delta, ∇⋅(r^/r2)=4πδ3(r)\nabla\cdot(\hat{\mathbf{r}}/r^2)=4\pi\delta^3(\mathbf{r}).
  • Key idea: Integrate the divergence over a volume and you get the net outward flux through its boundary — interior contributions cancel pairwise across shared faces, leaving only the outer skin.

Where this lives today

Every finite-volume simulation on the planet is the divergence theorem running in a loop. Computational fluid dynamics codes, weather models, and magnetohydrodynamics solvers store one field value per grid cell and update it by summing the fluxes through the cell's faces — Step 3 of the proof, executed trillions of times per second on a GPU cluster. The scheme conserves mass, charge, and energy to machine precision precisely because the interior-face cancellation is built into the arithmetic: whatever leaves one cell enters its neighbour, bit for bit. When plasma physicists battle the numerical sin of ∇⋅B≠0\nabla\cdot\mathbf{B}\neq0 in fusion and astrophysics codes, the fix ("constrained transport") is again the theorem, enforced cell by cell. The identity is just as alive in theory. Poynting's theorem — the energy audit of the electromagnetic field you will meet in E7 — is the divergence theorem applied to E×B\mathbf{E}\times\mathbf{B}; the Maxwell stress tensor turns force-on-charges calculations into surface integrals; and in gravitational physics the ADM mass of a spacetime is read off from a flux integral at infinity, the general-relativistic descendant of ∮g⋅da=−4πGMenc\oint\mathbf{g}\cdot\mathrm{d}\mathbf{a}=-4\pi G M_{\mathrm{enc}}.

The physical picture

Imagine the vector field as the velocity of water laced with hidden faucets and drains. The divergence at a point is the net rate at which water is created there per unit volume — positive for a faucet, negative for a drain. Now seal off any region of the flow with an imaginary closed surface and do the audit: every litre per second manufactured inside has nowhere to go but out through the skin, and every litre swallowed by a drain must be supplied through the skin. Total interior production equals net outward flow. That sentence is the divergence theorem; the mathematics only makes it precise. The mechanism behind it is a cancellation you can draw. Chop the volume into tiny cubes. Each interior face is shared by two adjacent cubes, and the outward normal of one is the inward normal of the other: whatever flux leaves cube A across that face enters cube B, so in the grand sum those two contributions kill each other exactly. Stack up millions of cells and the interior becomes a perfectly silent ledger — only the faces on the outer boundary have no partner to cancel against, and they alone survive.

Figure
Interior faces cancel in pairs — only the outer skin survives the sum
two neighbouring cells cell A cell B flux out of A = flux into B shared face cancels exactly many cells: only the skin speaks + + sum of all cell fluxes = flux through the outer boundary alone

The cancellation buys you something remarkable for free: the shape of the surface does not matter. Wrap a source in a neat sphere or in a lumpy potato-shaped surface — as long as the same faucets are inside, the same net flux comes out, because the volume between the two surfaces contains no sources and therefore contributes nothing. This surface-independence is what will make Gauss's law a practical tool rather than a curiosity: you get to choose the surface that makes the integral trivial.

Figure
Same sources inside, same flux out — the surface shape is yours to choose
source q sphere S1 any surface S2 no sources between S1 and S2, so both catch the same net flux: q divided by epsilon-zero

Two consequences of this picture are worth carrying with you. First, the theorem is bookkeeping, not physics: it holds for any smooth vector field whatsoever — electric, magnetic, fluid, or purely abstract. Physics enters only when a law tells you what the divergence equals, as in ∇⋅E=ρ/ε0\nabla\cdot\mathbf{E}=\rho/\varepsilon_0. Second, it belongs to a family. All three integral theorems of this chapter share one skeleton — ∫region(derivative of field)=(field data on the boundary)\int_{\text{region}}(\text{derivative of field}) = (\text{field data on the boundary}) — with the fundamental theorem for gradients working on curves, the Stokes theorem on surfaces, and this one on volumes. In the language of differential forms they are literally one theorem, ∫Mdω=∫∂Mω\int_M \mathrm{d}\omega = \int_{\partial M}\omega.

The theorem, stated carefully

Everything in this article expands one line. Suppose F\mathbf{F} is continuously differentiable throughout a compact region VV, bounded by the closed, piecewise-smooth surface S=∂VS=\partial V with outward-pointing area elements. Then

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

where: dτ\mathrm{d}\tau — volume element; da=n^ da\mathrm{d}\mathbf{a}=\hat{\mathbf{n}}\,\mathrm{d}a — outward area element on SS; ∇⋅F\nabla\cdot\mathbf{F} — the divergence, the local flux density. Read it as a conservation audit: the left side counts sources point by point, the right side catches everything at the border. The outward orientation is part of the theorem — flip the normals and you flip the sign. The deepest way to see why (1) must be true is to recall the coordinate-free definition of divergence, which you met when the operator was first built:

∇⋅F≡lim⁡V→01V∮∂VF⋅da(2)\nabla\cdot\mathbf{F}\equiv\lim_{V\to0}\frac{1}{V}\oint_{\partial V}\mathbf{F}\cdot\mathrm{d}\mathbf{a} \qquad (2)

where: the limit shrinks the volume onto a point. Equation (2) is the divergence theorem in miniature — flux per unit volume at a point. The theorem proper just integrates this local statement back up over a finite region, with the interior cancellations doing the assembly work. For computations you will usually deploy the Cartesian recipe ∇⋅F=∂xFx+∂yFy+∂zFz\nabla\cdot\mathbf{F}=\partial_x F_x+\partial_y F_y+\partial_z F_z, and the proof below shows the two definitions cooperating.

Derivation AProof of the divergence theorem by telescoping cells

We are proving equation (1) at the honesty level of Griffiths §1.3.4: rigorous in spirit, with the analytic fine print (exactly how rough SS may be) left to the mathematicians. The strategy is the one the hero figure advertises — partition VV into infinitesimal rectangular cells, show that a single cell's outward flux is (∇⋅F) dτ(\nabla\cdot\mathbf{F})\,\mathrm{d}\tau by Taylor expansion, then sum over all cells and watch every interior face cancel against its neighbour. The step to watch is the cancellation: it works only because the two cells sharing a face use opposite outward normals, which is why the closed-surface orientation convention is not decoration but the engine of the proof.

Step 1. Take a single box of dimensions dx×dy×dz\mathrm{d}x\times\mathrm{d}y\times\mathrm{d}z centred at (x,y,z)(x,y,z) and compute the net outward flux through its two faces perpendicular to x^\hat{\mathbf{x}}. The outgoing flux on the right face minus the incoming on the left is

[Fx(x+dx2)−Fx(x−dx2)]dy dz≈∂Fx∂x dx dy dz\Big[F_x\big(x+\tfrac{\mathrm{d}x}{2}\big)-F_x\big(x-\tfrac{\mathrm{d}x}{2}\big)\Big]\mathrm{d}y\,\mathrm{d}z \approx \frac{\partial F_x}{\partial x}\,\mathrm{d}x\,\mathrm{d}y\,\mathrm{d}z

Why a derivative appears: only the difference between the two face values survives, and to first order in dx\mathrm{d}x that difference is the partial derivative times the separation — the same move that proves the one-dimensional fundamental theorem.

Step 2. Add the analogous yy- and zz-face pairs. The six faces together give

∮∂cellF⋅da=(∂Fx∂x+∂Fy∂y+∂Fz∂z)dτ=(∇⋅F) dτ\oint_{\partial\text{cell}}\mathbf{F}\cdot\mathrm{d}\mathbf{a} = \left(\frac{\partial F_x}{\partial x}+\frac{\partial F_y}{\partial y}+\frac{\partial F_z}{\partial z}\right)\mathrm{d}\tau = (\nabla\cdot\mathbf{F})\,\mathrm{d}\tau

Why this is also a proof of equation (2): divide by dτ\mathrm{d}\tau and shrink — the Cartesian divergence formula and the coordinate-free flux-density definition are the same object.

Step 3. Now sum the left-hand sides over all the cells tiling VV. Every interior face is shared by exactly two cells whose outward normals point in opposite directions through it, so its two flux contributions are equal and opposite and cancel identically. The only faces with no partner are those lying on the outer boundary SS:

∑cells∮∂cellF⋅da=∮SF⋅da\sum_{\text{cells}}\oint_{\partial\text{cell}}\mathbf{F}\cdot\mathrm{d}\mathbf{a} = \oint_S\mathbf{F}\cdot\mathrm{d}\mathbf{a}

Why continuity of F\mathbf{F} matters here: the cancellation needs the field to take the same value on both sides of each interior face — a discontinuous or singular field breaks the telescoping, which is exactly what goes wrong at a point charge.

Step 4. Sum the right-hand sides of Step 2 over the same cells. In the continuum limit the Riemann sum becomes the volume integral:

∑cells(∇⋅F) dτ  ⟶  ∫V(∇⋅F) dτ\sum_{\text{cells}}(\nabla\cdot\mathbf{F})\,\mathrm{d}\tau \;\longrightarrow\; \int_V(\nabla\cdot\mathbf{F})\,\mathrm{d}\tau

Equating the two evaluations of the same sum gives ∫V(∇⋅F) dτ=∮SF⋅da\int_V(\nabla\cdot\mathbf{F})\,\mathrm{d}\tau=\oint_S\mathbf{F}\cdot\mathrm{d}\mathbf{a} — the divergence theorem.

The workhorse corollary: Gauss's law in two costumes

Why does an E&M course care so much about a calculus identity? Because Maxwell's first equation is a statement about a divergence, and experiments and problem-solving live on surfaces. Suppose you accept the local law ∇⋅E=ρ/ε0\nabla\cdot\mathbf{E}=\rho/\varepsilon_0 — the field's flux density at each point is the charge density there. The divergence theorem instantly globalizes it.

Go deeper · Derivation B · 1 minFrom the point form of Gauss's law to the integral form
Derivation BFrom the point form of Gauss's law to the integral form

The goal is the equivalence of the differential and integral statements of Gauss's law — the single most-used conversion in electrostatics. The strategy is almost embarrassingly short: integrate the local law over an arbitrary volume and let the divergence theorem swap the left side for a flux. The subtlety worth watching sits at the end: the argument runs in both directions precisely because the volume is arbitrary — if two volume integrals agree for every region, their integrands must agree point by point.

Step 1. Integrate the local law ∇⋅E=ρ/ε0\nabla\cdot\mathbf{E}=\rho/\varepsilon_0 over any volume VV and apply equation (1) to the left-hand side:

∮SE⋅da=∫V(∇⋅E) dτ=1ε0∫Vρ dτ\oint_S\mathbf{E}\cdot\mathrm{d}\mathbf{a} = \int_V(\nabla\cdot\mathbf{E})\,\mathrm{d}\tau = \frac{1}{\varepsilon_0}\int_V\rho\,\mathrm{d}\tau

Step 2. Recognize the volume integral of charge density as the total enclosed charge, ∫Vρ dτ=Qenc\int_V\rho\,\mathrm{d}\tau = Q_{\mathrm{enc}}:

∮SE⋅da=Qencε0\oint_S\mathbf{E}\cdot\mathrm{d}\mathbf{a}=\frac{Q_{\mathrm{enc}}}{\varepsilon_0}

Why this is the useful direction: the integral form needs no derivatives of E\mathbf{E} — for symmetric charge distributions you can pull EE out of the integral and solve algebraically, as in the worked examples below.

Step 3. Run it backwards. If ∮SE⋅da=Qenc/ε0\oint_S\mathbf{E}\cdot\mathrm{d}\mathbf{a}=Q_{\mathrm{enc}}/\varepsilon_0 holds for every closed surface, then ∫V(∇⋅E−ρ/ε0) dτ=0\int_V(\nabla\cdot\mathbf{E}-\rho/\varepsilon_0)\,\mathrm{d}\tau=0 for every volume, and an integrand whose integral vanishes over all regions must vanish identically. Why: if it were positive somewhere, a small ball around that point would give a positive integral — contradiction. The two forms are logically equivalent for smooth fields.

The same two-line manoeuvre generates a family of results you will use all track long. Applied to F=ϕ∇ψ\mathbf{F}=\phi\nabla\psi together with the product rule ∇⋅(ϕ∇ψ)=ϕ∇2ψ+∇ϕ⋅∇ψ\nabla\cdot(\phi\nabla\psi)=\phi\nabla^2\psi+\nabla\phi\cdot\nabla\psi, the theorem yields Green's first identity, and antisymmetrizing in ϕ↔ψ\phi\leftrightarrow\psi gives Green's second identity,

∫V(ϕ∇2ψ−ψ∇2ϕ) dτ=∮S(ϕ∇ψ−ψ∇ϕ)⋅da(3)\int_V(\phi\nabla^2\psi-\psi\nabla^2\phi)\,\mathrm{d}\tau=\oint_S(\phi\nabla\psi-\psi\nabla\phi)\cdot\mathrm{d}\mathbf{a} \qquad (3)

where: ϕ,ψ\phi,\psi — any twice-differentiable scalar fields. This unassuming identity is the engine behind the uniqueness theorems of electrostatics and the whole method of Green's functions in E2. Applied instead to the current density with charge conservation ∇⋅J=−∂ρ/∂t\nabla\cdot\mathbf{J}=-\partial\rho/\partial t, the theorem gives the integral continuity statement

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

where: J\mathbf{J} — current density and QencQ_{\mathrm{enc}} — the charge inside SS: net current leaving any closed surface equals the rate at which the enclosed charge decreases. This is charge conservation in its global form, and Kirchhoff's current law is its steady-state shadow.

Which statement answers which question

you wantusenotes
trade a volume integral of ∇⋅F\nabla\cdot\mathbf{F} for a fluxequation (1)needs a closed surface, outward normals
the field of a symmetric charge distribution∮E⋅da=Qenc/ε0\oint\mathbf{E}\cdot\mathrm{d}\mathbf{a}=Q_{\mathrm{enc}}/\varepsilon_0symmetry must let you pull EE out
divergence at a point, no coordinatesequation (2)the theorem shrunk to a point
uniqueness and Green's functionsequation (3)two scalar fields, boundary data
global charge conservationequation (4)continuity equation integrated
volume from a surface integral∮Sr⋅da=3V\oint_S\mathbf{r}\cdot\mathrm{d}\mathbf{a}=3Vsince ∇⋅r=3\nabla\cdot\mathbf{r}=3

Limiting cases

CaseResultMeaning
divergence-free field∇⋅F=0 ⇒ ∮SF⋅da=0\nabla\cdot\mathbf{F}=0\ \Rightarrow\ \oint_S\mathbf{F}\cdot\mathrm{d}\mathbf{a}=0solenoidal fields (like B\mathbf{B}) have zero net flux through anything closed — field lines neither start nor end inside
constant fieldF=c ⇒ ∮Sc⋅da=0\mathbf{F}=\mathbf{c}\ \Rightarrow\ \oint_S\mathbf{c}\cdot\mathrm{d}\mathbf{a}=0equal inflow and outflow; equivalently the closed-surface identity ∮Sda=0\oint_S\mathrm{d}\mathbf{a}=0
identity field F=r\mathbf{F}=\mathbf{r}∇⋅r=3 ⇒ ∮Sr⋅da=3V\nabla\cdot\mathbf{r}=3\ \Rightarrow\ \oint_S\mathbf{r}\cdot\mathrm{d}\mathbf{a}=3Va surface integral that measures volume — handy and exam-loved
point source inside∮Sr^r2⋅da=4π\oint_S\dfrac{\hat{\mathbf{r}}}{r^2}\cdot\mathrm{d}\mathbf{a}=4\pi for any enclosing SSthe naive divergence vanishes for r≠0r\neq0; the flux is carried by the delta function at the origin
shrink VV to a point(1)→(2)(1)\to(2)the theorem degenerates into the definition of divergence

Worked examples

1 · Auditing both sides over a unit cube (confidence builder)

Verify the divergence theorem for F=xy x^+2yz y^+3zx z^\mathbf{F}=xy\,\hat{\mathbf{x}}+2yz\,\hat{\mathbf{y}}+3zx\,\hat{\mathbf{z}} over the unit cube 0≤x,y,z≤10\le x,y,z\le 1.

Step 1. The volume side. ∇⋅F=∂x(xy)+∂y(2yz)+∂z(3zx)=y+2z+3x\nabla\cdot\mathbf{F}=\partial_x(xy)+\partial_y(2yz)+\partial_z(3zx)=y+2z+3x. Integrate over the cube using ∫01x dx=12\int_0^1 x\,\mathrm{d}x=\tfrac12 for each variable in turn: ∫V(∇⋅F) dτ=12+2⋅12+3⋅12=3\int_V(\nabla\cdot\mathbf{F})\,\mathrm{d}\tau = \tfrac12+2\cdot\tfrac12+3\cdot\tfrac12 = \boxed{3}.

Step 2. The surface side, face by face. On x=1x=1 (da=dy dz x^\mathrm{d}\mathbf{a}=\mathrm{d}y\,\mathrm{d}z\,\hat{\mathbf{x}}): F⋅da=y dy dz\mathbf{F}\cdot\mathrm{d}\mathbf{a}=y\,\mathrm{d}y\,\mathrm{d}z, giving 12\tfrac12. On x=0x=0 the integrand xyxy vanishes: 00.

Step 3. On y=1y=1 (da=dx dz y^\mathrm{d}\mathbf{a}=\mathrm{d}x\,\mathrm{d}z\,\hat{\mathbf{y}}): 2z dx dz2z\,\mathrm{d}x\,\mathrm{d}z integrates to 11. On y=0y=0: the integrand 2yz2yz vanishes, 00. On z=1z=1: 3x dx dy3x\,\mathrm{d}x\,\mathrm{d}y gives 32\tfrac32; on z=0z=0: 00.

Step 4. Total flux: 12+1+32=3\tfrac12+1+\tfrac32 = \boxed{3} — equal to the volume integral, as the theorem promises. Notice the economy: the volume side was one integral; the surface side was six. That asymmetry is exactly why you will usually use the theorem to trade toward whichever side is easier.

2 · Gauss's law inside a charged ball (exam level)

A solid sphere of radius R=0.10 mR=0.10\ \mathrm{m} carries charge density ρ(r)=kr\rho(r)=kr with k=2.0 μC/m4k=2.0\ \mu\mathrm{C/m^4}. Find the total charge, and the electric field at r=0.05 mr=0.05\ \mathrm{m} and at the surface.

Step 1. Total charge, integrating in spherical shells dτ=4πr2 dr\mathrm{d}\tau = 4\pi r^2\,\mathrm{d}r: Q=∫0Rkr⋅4πr2 dr=πkR4=π×2.0×10−6×(0.10)4=6.3×10−10 C≈0.63 nCQ=\int_0^R kr\cdot4\pi r^2\,\mathrm{d}r = \pi k R^4 = \pi\times2.0\times10^{-6}\times(0.10)^4 = \boxed{6.3\times10^{-10}\ \mathrm{C}\approx 0.63\ \mathrm{nC}}.

Step 2. By symmetry E=E(r) r^\mathbf{E}=E(r)\,\hat{\mathbf{r}}, so on a concentric Gaussian sphere the flux is E⋅4πr2E\cdot4\pi r^2 and the integral form of Gauss's law — equation (1) applied to E\mathbf{E} — gives E(r)=Qenc(r)/(4πε0r2)E(r) = Q_{\mathrm{enc}}(r)/(4\pi\varepsilon_0 r^2) with Qenc(r)=πkr4Q_{\mathrm{enc}}(r)=\pi k r^4.

Step 3. Simplify: E(r)=πkr44πε0r2=kr24ε0E(r) = \dfrac{\pi k r^4}{4\pi\varepsilon_0 r^2} = \dfrac{k r^2}{4\varepsilon_0} inside the ball — the field grows like r2r^2 because enclosed charge accumulates faster (r4r^4) than the surface dilutes it (r2r^2).

Step 4. Numbers. At r=0.05 mr=0.05\ \mathrm{m}: E=2.0×10−6×(0.05)24×8.854×10−12=1.4×102 V/mE = \dfrac{2.0\times10^{-6}\times(0.05)^2}{4\times8.854\times10^{-12}} = \boxed{1.4\times10^{2}\ \mathrm{V/m}}. At the surface: E=kR24ε0=2.0×10−6×0.013.54×10−11=5.6×102 V/mE = \dfrac{kR^2}{4\varepsilon_0} = \dfrac{2.0\times10^{-6}\times0.01}{3.54\times10^{-11}} = \boxed{5.6\times10^{2}\ \mathrm{V/m}} — and a cross-check from outside, E=Q/(4πε0R2)=6.3×10−10/(1.11×10−10×0.01)E=Q/(4\pi\varepsilon_0R^2)=6.3\times10^{-10}/(1.11\times10^{-10}\times0.01), gives the same 5.6×102 V/m5.6\times10^{2}\ \mathrm{V/m}.

Step 5. Where the theorem worked: no differential equation was solved anywhere. The divergence theorem converted the local law into a flux statement, symmetry pulled EE outside the integral, and the rest was arithmetic.

Figure
The field of the charged ball — growing like r squared inside, falling like one over r squared outside
r E(r) R E = kR²/4ε₀ ≈ 5.6×10² V/m inside: E ∝ r² enclosed charge grows as r⁴ outside: E ∝ 1/r² all of Q enclosed, point-charge law charged ball, ρ = kr
Origins · 1 minCarl Friedrich Gauss and how this was discovered
CF
Carl Friedrich Gauss
1777–1855 · Göttingen Observatory

Gauss ran the Göttingen observatory for almost half a century and treated mathematics as its instrument shop. The theorem bearing his name emerged from his 1813 study of the gravitational attraction of ellipsoids — he needed to convert volume integrals over an attracting body into integrals over its surface, and proved the special cases that mattered. Characteristically, he published it as a tool, not a monument; the general statement was formulated and proved by Mikhail Ostrogradsky in the 1820s, and George Green, a self-taught miller's son, built the potential-theory identities on top of it in 1828. Gauss returned the favour to physics for decades: with Wilhelm Weber he built one of the first working telegraphs, mapped the Earth's magnetic field, and formulated the flux law ∮E⋅da=Qenc/ε0\oint\mathbf{E}\cdot\mathrm{d}\mathbf{a}=Q_{\mathrm{enc}}/\varepsilon_0 that makes this theorem a daily instrument of electrostatics. The magnetic-field unit and the method of least squares keep his name in the laboratory to this day.

History
1762
— Lagrange, computing sound propagation, converts special volume integrals to surface integrals — the theorem's first sighting.
1813
— Gauss proves the key special cases while studying the gravitational pull of ellipsoids.
1826
— Ostrogradsky presents the general theorem in Paris; his proof is published in 1831.
1828
— Green's privately printed Essay derives the potential-theory identities — equation (3) — from the theorem; only 51 subscribers buy it.
1873
— Maxwell's Treatise makes the theorem the standing bridge between the differential and integral forms of the field equations.

Going further

References. Griffiths, Introduction to Electrodynamics, 4th ed., §1.3.4–1.3.5 · Jackson, Classical Electrodynamics, 3rd ed., §I.5 and front-cover formula sheet · Purcell & Morin, Electricity and Magnetism, 3rd ed., §2.9–2.11 · Zangwill, Modern Electrodynamics, §1.4 · Arfken, Weber & Harris, Mathematical Methods for Physicists, 7th ed., §3.5 All numbers in this article are exact analytic constants: the flux 4π4\pi and the factor of 33 in ∇⋅r=3\nabla\cdot\mathbf{r}=3 (and hence ∮Sr⋅da=3V\oint_S\mathbf{r}\cdot\mathrm{d}\mathbf{a}=3V) involve no empirical values. The worked-example results — both sides equal 33 for the unit-cube audit of F=xy x^+2yz y^+3zx z^\mathbf{F}=xy\,\hat{\mathbf{x}}+2yz\,\hat{\mathbf{y}}+3zx\,\hat{\mathbf{z}}; Q=0.63Q=0.63 nC, E=1.4×102E=1.4\times10^2 V/m at r=5r=5 cm, and E=5.6×102E=5.6\times10^2 V/m at the surface for ρ=kr\rho=kr — are arithmetic consequences of the boxed formulas.

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

Is the divergence theorem physics or mathematics?

Pure mathematics — it is an identity that holds for every continuously differentiable vector field, whether or not it means anything physical. That is precisely its power: the theorem is a guaranteed-correct conversion between local and global statements, so all the physical content of a law like Gauss's can be carried back and forth between its differential form (best for theory and for deriving consequences) and its integral form (best for symmetric problems and for experiments, which always measure fluxes through finite surfaces). When a physicist says "by Gauss's theorem," no approximation has been made.

Why must the surface be closed? Can I use the theorem on a hemisphere?

The theorem needs a boundary that completely seals a volume, because the proof counts every face of every interior cell: an open surface like a hemispherical shell bounds no volume, so there is nothing to telescope. What you can do is close the surface yourself — add the flat disk to the hemisphere, apply the theorem to the closed combination, and subtract the disk's flux at the end. That closing-the-surface trick is used constantly. If instead your integral is a circulation around the open surface's rim, you want the Stokes theorem, which is the boundary theorem for surfaces rather than volumes.

Which side of the theorem should I compute in practice?

Whichever is easier — and that is the entire art. The theorem is a free exchange between one triple integral of a derivative and one closed-surface integral. In the first worked example the volume side was a single easy integral while the surface side took six; in Gauss's-law problems the surface side is trivial (symmetry pulls EE out) while the volume side would require knowing the field everywhere. Before grinding through any flux integral over a closed surface, take ten seconds to compute the divergence: if it is simple — especially if it is zero or constant — the theorem has already done your homework.

What exactly does the outward orientation convention do, and what happens for a volume with a cavity?

The outward normal defines the sign of "flux out," and the proof depends on it: interior cancellation works because neighbouring cells disagree about which way is out through their shared face. For a volume with a cavity — say the region between two concentric spheres — the boundary has two pieces, and "outward from the volume" means away from the material region on each: radially out on the outer sphere, radially in toward the centre on the inner one. Getting that inner-boundary sign wrong is a classic error in shell problems; the theorem is innocent, the bookkeeping was not.

How is this the same theorem as the fundamental theorem of calculus?

Structurally they are one statement in different dimensions: the integral of a derivative over a region equals field data on the boundary. In one dimension the region is an interval [a,b][a,b], the derivative is f′f', the boundary is two points, and the "flux" is f(b)−f(a)f(b)-f(a) — with the endpoint signs playing the role of outward normals. The gradient theorem upgrades the region to a curve, the Stokes theorem to a surface, the divergence theorem to a volume. Differential-forms language makes the family literally one identity, ∫Mdω=∫∂Mω\int_M\mathrm{d}\omega=\int_{\partial M}\omega, called the generalized Stokes theorem.

Does the divergence theorem work in two dimensions?

Yes — the pattern is dimension-blind. In the plane, the flux of F\mathbf{F} through a closed curve equals the area integral of the two-dimensional divergence: ∮F⋅n^ dℓ=∫(∂xFx+∂yFy) dA\oint\mathbf{F}\cdot\hat{\mathbf{n}}\,\mathrm{d}\ell=\int(\partial_xF_x+\partial_yF_y)\,\mathrm{d}A. This is one of the two vector forms of Green's theorem (the other being the planar Stokes theorem), and the proof is the same telescoping over little squares instead of little cubes. In nn dimensions the analogous statement holds verbatim, which is why the same theorem underwrites everything from soap-film mathematics to flux integrals in general relativity.

What if a point charge sits exactly on the Gaussian surface?

Then the flux integral is genuinely ill-defined as stated — the field is singular on the domain of integration, and neither QencQ_{\mathrm{enc}} nor the surface integral converges cleanly. The limiting answer depends on how the surface approaches the charge: for a smooth surface passing through the charge, symmetric limits give half the usual result, q/2ε0q/2\varepsilon_0, as if half the charge were enclosed. In practice the resolution is to deform the surface by an infinitesimal bump so the charge is unambiguously inside or outside; physical charge distributions have finite density, and the ambiguity evaporates.

Do I need the field to be differentiable on the surface S as well, or only inside?

The clean statement asks for F\mathbf{F} to be continuously differentiable on the closed region — interior plus boundary — and SS itself to be piecewise smooth (corners and edges, like a cube's, are fine; the flux integral just splits into faces). What actually breaks the theorem in physics practice is almost never surface roughness but interior singularities: a point charge, a line current, an idealized dipole. The safe habit is a two-second scan of VV for places where the field blows up before quoting equation (1) — and if you find one, the three-dimensional delta function article shows how to keep calculating anyway.

Before this

Where this leads