Vector Fields and Divergence
Vector Fields and Their Properties
A vector field assigns a vector to each point in some region of space. Think of it as a function that takes a point and returns a vector at that point. Velocity fields in fluid flow, gravitational fields, and electric fields are all classic examples.
For the divergence theorem to apply, the vector field needs to be sufficiently well-behaved. Specifically, must be continuously differentiable () on the region in question, meaning all its partial derivatives exist and are continuous.
Divergence as a Measure of Vector Field Flow
The divergence of a vector field is the scalar field:
Divergence measures the net rate of "expansion" or "outflow" of the field at a point:
- Positive divergence at a point means the field is acting as a source there (fluid spreading outward)
- Negative divergence means the field is acting as a sink (fluid converging inward)
- Zero divergence everywhere means the field is solenoidal (incompressible flow, for instance)
A useful way to think about it: divergence is the infinitesimal flux per unit volume. That intuition is exactly what the divergence theorem formalizes.
Flux as the Flow of a Vector Field Through a Surface
Flux quantifies how much of a vector field passes through a given surface. It's computed by integrating the normal component of the field over the surface:
where is the unit normal to the surface. The sign of the flux depends on the orientation you choose for :
- Positive flux means net flow in the direction of
- Negative flux means net flow opposite to
For closed surfaces, the convention is always to take pointing outward.
Integral Formulations

Surface Integrals for Calculating Flux
To actually compute a surface integral, you parameterize the surface and convert everything into a double integral. Here's the process:
- Parameterize the surface using two parameters: for in some domain .
- Compute the normal vector via the cross product: .
- Check orientation. For a closed surface, should point outward. If it doesn't, swap the order.
- Set up the integral:
Notice that already accounts for the surface area element, so you don't divide by the magnitude here.
Volume Integrals for Calculating Total Divergence
A volume integral of the divergence sums up all the local source/sink contributions throughout a region :
This is typically evaluated by choosing an appropriate coordinate system (Cartesian, cylindrical, or spherical) and setting up iterated integrals. The result represents the total net outward flux from the entire region, which is precisely the claim of the divergence theorem.
Closed Surfaces and Their Properties
A closed surface is one that fully encloses a bounded volume with no boundary curve of its own (no edges, no holes). Spheres, cubes, ellipsoids, and tori are all closed surfaces.
For the divergence theorem, the enclosed region must be bounded, and the surface must be piecewise smooth. Piecewise smooth means the surface can have edges (like a cube does) as long as it's smooth on each piece. The outward unit normal is defined everywhere except possibly along those edges, which is fine since edges have zero area.
Divergence Theorem

Statement of the Divergence Theorem
Let be a bounded region in with piecewise smooth boundary surface , and let be a vector field on an open set containing and . Then:
where is the outward-pointing unit normal to .
In words: the total outward flux of through the boundary equals the integral of the divergence of over the enclosed volume.
Proof Outline
The standard proof works by reducing the theorem to three simpler identities and then handling each component of separately.
Step 1: Decompose into components. Write . It suffices to prove each of the three component identities independently:
and similarly for with and with . Adding these three gives the full theorem.
Step 2: Prove one component identity (the case is standard). Assume the region is simple in the -direction, meaning it can be described as:
where is the projection of onto the -plane, and are smooth functions.
Step 3: Evaluate the volume integral. By Fubini's theorem:
The inner integral evaluates by the Fundamental Theorem of Calculus:
Step 4: Evaluate the surface integral. The boundary splits into three pieces: the top surface , the bottom surface , and possibly vertical side walls.
- On the top surface, the outward normal points upward, and the surface integral contributes .
- On the bottom surface, the outward normal points downward (note the sign flip), contributing .
- On the side walls, , so the component contributes nothing.
Adding these gives exactly the same expression from Step 3.
Step 5: Extend to general regions. For regions that aren't simple in all three coordinate directions simultaneously, decompose into finitely many subregions that are each simple. Apply the theorem to each subregion. When you sum the results, the surface integrals over shared internal faces cancel (the outward normals point in opposite directions on shared boundaries), leaving only the integral over the outer boundary .
The key ideas are: the Fundamental Theorem of Calculus handles each component, and cancellation of internal faces handles the extension to general regions. The divergence theorem is, at its core, a higher-dimensional generalization of the Fundamental Theorem of Calculus.
Outward Unit Normal Vector and Its Role
The outward unit normal at each point of determines the orientation of the surface. Without a consistent choice of , the flux integral is ambiguous.
- For a sphere of radius , the outward normal is , pointing radially outward.
- For a cube, the outward normal on each face is the constant unit vector perpendicular to that face, pointing away from the interior.
- For a surface given as (top boundary), the outward normal is when the outward direction is upward.
The convention that points outward is what makes the two sides of the divergence theorem match. Reversing the orientation flips the sign of the flux integral.
Applications and Examples of the Divergence Theorem
Simplifying flux computations. Suppose you need the outward flux of through the unit sphere. Computing the surface integral directly requires parameterizing the sphere. Instead, compute:
Then switch to spherical coordinates:
That's much cleaner than the surface integral would have been.
Going the other direction. Sometimes the volume integral of the divergence is hard, but the surface integral is easy. The theorem works both ways. If has a convenient geometry (a sphere, a cylinder), you might prefer to evaluate the surface side.
Gauss's Law in electrostatics. The divergence theorem gives the integral form of Gauss's law directly. If is the electric field and is the charge density, then , so:
Verifying consistency. If you compute both sides of the divergence theorem for a given and region and get different answers, you've made an error somewhere. This is a useful check on your work.