Physical Applications
Electrostatic Fields
The divergence theorem gives us Gauss's law in electrostatics, which relates the electric flux through a closed surface to the total charge enclosed:
By the divergence theorem, the left side converts to a volume integral:
Since this holds for any volume, the integrands must be equal, giving the differential form:
This is one of Maxwell's equations. The practical payoff: when a charge distribution has symmetry (spherical, cylindrical, or planar), you can use Gauss's law to find directly from the enclosed charge instead of integrating Coulomb's law over the entire distribution.
Fluid Dynamics and Heat Transfer
In fluid dynamics, the divergence theorem underpins the continuity equation, which expresses conservation of mass. The idea is that any net outflow of fluid through a closed surface must equal the rate at which mass decreases inside:
Here's how the derivation works:
- Start with the fact that the total mass inside a volume is .
- The rate of mass leaving through the boundary surface is .
- Apply the divergence theorem to convert that surface integral: .
- Set the rate of mass decrease equal to the outflow: .
- Since this holds for any volume, the integrands must match, yielding the continuity equation.
Heat transfer follows the same pattern. Fourier's law says heat flux is . The divergence theorem converts the total heat flow through a surface into a volume integral of , which then relates to the rate of heat generation (or temperature change) inside.

Gravitational Fields
Gauss's law for gravity mirrors the electrostatic version. The gravitational flux through a closed surface depends only on the enclosed mass :
Applying the divergence theorem and using gives the differential form:
The negative sign reflects that gravity is always attractive (mass acts as a "sink" for the gravitational field, never a source). Compare this to electrostatics, where charges can be positive or negative, so can be positive or negative.
Mathematical Concepts

Conservation Laws and the Continuity Equation
The divergence theorem is the mathematical backbone of conservation laws. A conservation law says that some physical quantity (mass, energy, momentum, charge) is neither created nor destroyed, only redistributed.
Every conservation law takes the same general form. If is the density of the conserved quantity and is its flux, then:
This is the continuity equation in its general form. The divergence theorem is what lets you move between the integral version (which talks about total quantities flowing through surfaces) and the differential version (which holds at every point). The integral form is often easier for computing specific problems with symmetry, while the differential form is what you need for solving PDEs.
Flux Density and Source Density
These two ideas sit at the heart of every divergence theorem application:
- Flux density is a vector field representing the rate of flow of some quantity per unit area. Think of for electric field or for mass flow.
- Source density is a scalar field representing how much of that quantity is being generated (or absorbed) per unit volume at each point.
The divergence theorem says these are two views of the same thing:
The divergence is the source density. Where , there's a net source (quantity is being produced). Where , there's a net sink (quantity is being absorbed).
For example, in electrostatics: is the flux density, charge density is the source density, and they're linked by . Positive charges act as sources of electric field lines; negative charges act as sinks.