On this page
The divergence theorem, also called Gauss's theorem, turns an integral over a closed surface into a volume integral, which is often easier. It sits behind Gauss's law in electrostatics. Below: the statement, why it is true, one example checked both ways, and the orientation slip that flips the sign of your answer.
What does the divergence theorem say?
In OpenStax Calculus Volume 3, section 6.8, the theorem reads: let S be a piecewise smooth closed surface that encloses a solid E, let S be oriented outward, and let F be a vector field with continuous partial derivatives on an open region containing E. Then the flux of F out through S equals the triple integral of div F over E.
In symbols: ∯ F · n dS over S = ∭ div F dV over E, where n is the outward unit normal.
The divergence of F = (P, Q, R) is div F = ∂P/∂x + ∂Q/∂y + ∂R/∂z, as defined in OpenStax section 6.5 on divergence and curl.
Three conditions do the work: the surface is closed, the normal points outward, and F is smooth everywhere inside. Drop any one and the equation can fail.
Why does flux equal the volume integral of divergence?
Think of div F at a point as a tap or a drain. OpenStax describes divergence as the net rate of outward flux per unit volume at a point. Where div F is positive, the field is a source (more leaves a tiny box than enters); where it is negative, it is a sink.
Now chop the solid into tiny boxes. Each box's outward flux is roughly its divergence times its volume. Every inside wall is shared by two neighbours, and what leaves one enters the other, so those terms cancel. Only the outer walls, which make up S, survive. In the words of the Wikipedia article on the divergence theorem, the sum of all sources in a region, with sinks counted as negative sources, gives the net flux out of the region.
Physics students meet this as Gauss's law, which OpenStax states as: the flux of an electrostatic field across a closed surface is the total charge enclosed divided by an electric constant (ε0). The book uses the theorem to justify the point-charge case. Charge is the source. If Gauss's law trips you up, read our list of Gauss's law and electric dipole mistakes in JEE Main and NEET.
How do you calculate flux through a sphere with the divergence theorem?
Take F = (x, y, z), which points straight out from the origin and grows with distance, and let S be the sphere x² + y² + z² = R².
Route 1, the volume integral:
Divergence: ∂x/∂x + ∂y/∂y + ∂z/∂z = 1 + 1 + 1 = 3.
The divergence is constant, so the triple integral is 3 times the volume of the ball.
Volume of the ball = (4/3)πR³, so the flux = 3 × (4/3)πR³ = 4πR³.
Route 2, the surface integral directly:
On the sphere the outward unit normal is n = (x, y, z)/R.
So F · n = (x² + y² + z²)/R = R²/R = R, the same at every point of S.
A constant integrand times the area: R × 4πR² = 4πR³.
Both routes agree. For R = 2 the flux is 32π, about 100.5.
What orientation mistake do students make with the divergence theorem?
A common slip is using the inward normal. The theorem is stated for an outward-oriented surface; point n inward and every F · n changes sign, so the same sphere gives -4πR³. If a question asks for flux into the surface, compute the outward flux and flip the sign at the end.
Another slip is applying the theorem to a surface that is not closed. The dome of a hemisphere (z ≥ 0) has no lid, so close it first:
Add the flat disc at z = 0 and apply the theorem to the half-ball: 3 × (2/3)πR³ = 2πR³.
On the disc the outward normal is (0, 0, -1), so F · n = -z = 0. The disc carries no flux.
Flux through the dome alone = 2πR³ - 0 = 2πR³, half the full sphere, as symmetry predicts.
A third slip is ignoring a point where F blows up. The field r̂/r² has zero divergence away from the origin, yet OpenStax (Theorem 6.21) shows its flux out of any closed surface around the origin is 4π, not 0. The theorem needs continuous partial derivatives on a region containing the whole solid, and the origin breaks that.
Where to practise next
The divergence theorem is the three-dimensional cousin of Green's theorem for line integrals, and the triple integrals it produces build on double integrals for area and volume. If divergence itself still feels vague, the Fermi Concept Library gives each concept in mathematics and physics its own lesson and its place in the map. To test the sign checks above on fresh questions, the Fermi Problem Library has worked problems with a step-by-step solver that explains the reasoning rather than printing an answer.
Try the hemisphere with F = (x, y, z²) next, and check your answer both ways.



