Section 2.4 · Topic 2 of 5

2.4.2 The divergence (Gauss's) theorem

Interactive: Vector Field Explorer

The divergence was defined in Eq. (2.3.51) as the outward flux per unit volume of an infinitesimal volume. The divergence theorem extends this local statement to a region of finite size.

Divergence theorem

Let be a volume bounded by the closed surface , with pointing outwards from , and let have continuous first derivatives in . Then

In words: the net outward flux of a vector field through a closed surface equals the volume integral of its divergence over the region enclosed by the surface.

The divergence theorem relates a volume V and the closed surface S that bounds it. The surface element d\vec S is everywhere directed outwards from V.
Figure 2.4.3. The divergence theorem relates a volume and the closed surface that bounds it. The surface element is everywhere directed outwards from .
Physical picture

Think of as the velocity of water and of as a region of a pool with some taps (sources, ) and drains (sinks, ) in it. Water is neither created nor destroyed anywhere else, so the net amount flowing out through the walls of the region per second must equal what the taps inside deliver minus what the drains inside swallow. The left side of Eq. (2.4.2) measures the flow through the walls, and the right side adds up the taps and drains.

Why it is true

Divide into a large number of small cells (Figure 2.4.4). By the definition (2.3.51), the outward flux from each cell is , to first order. Now add the fluxes of all the cells. Every interior face is shared by two neighbouring cells, and its outward normal for one cell is the inward normal for the other: the flux leaving one cell through that face enters its neighbour, and the two contributions cancel exactly (panel b). Only the faces that lie on the outer surface have no partner, so the sum of all cell fluxes is the flux through :

(a) one cell
(a) one cell
(b) two neighbours
(b) two neighbours
Why the divergence theorem holds (cross-sections of the cells). (a) The outward flux of one small cell is (\nabla\cdot\vec A)_k\,\Delta V_k. (b) On a face shared by two cells the outward normals are opposite, so what leaves one cell through that face enters the other: the two contributions cancel. (c) When the whole volume is filled with cells, all interior faces cancel in pairs and only the flux through the outer surface S survives.
Figure 2.4.4. Why the divergence theorem holds (cross-sections of the cells). (a) The outward flux of one small cell is . (b) On a face shared by two cells the outward normals are opposite, so what leaves one cell through that face enters the other: the two contributions cancel. (c) When the whole volume is filled with cells, all interior faces cancel in pairs and only the flux through the outer surface survives.

Try it yourself: drag and resize the loop in the source field below. The outward flux through the boundary and the integral of the divergence over the enclosed area agree for every shape and position.

InteractiveLoading simulation…

Meaning

The divergence measures the strength of the sources (positive divergence) and sinks (negative divergence) of a field at each point. The theorem says that what flows out through the boundary is exactly what is produced inside. If a field is divergence-free in a region, its net flux through every closed surface that encloses only points of that region is zero: whatever enters also leaves (the Remark below shows why the enclosed volume, not just the surface, must lie in the region). In electrostatics this theorem is the bridge between the integral form of Gauss's law (a statement about the flux through a closed surface) and its differential form (a statement about the divergence at a point), see Section 3.2. The theorem is also an important computational tool: a surface integral over six faces of a box may be replaced by a single volume integral, or vice versa.

Remark

The hypothesis that be continuously differentiable throughout matters. The field of the Physical picture in Section 2.3.10 has zero divergence everywhere except at the origin, yet its flux through a sphere centred at the origin is , not . There is no contradiction: the field is singular at the origin, which lies inside , so the theorem in the form (2.4.2) does not apply to that volume. The entire flux originates from the singular point, which is the mathematical model of a point charge.

The same effect can be seen in the plane with the field , the two-dimensional analogue of : its divergence is zero away from the origin, yet every loop that encloses the origin has outward flux . Move the loop on and off the singular point.

InteractiveLoading simulation…
Common mistake

Using an inward on part of the surface, or forgetting a face (all six faces for a box, the side and both lids for a cylinder). The divergence theorem needs the closed surface with pointing outwards everywhere.

Recipe · Verifying an integral theorem in a concrete case
  1. Sketch the region and its boundary, and fix the orientation ( outwards for a closed surface, right-hand rule between and for Stokes).
  2. Derivative side: compute or in the system that fits the region, and integrate it with the proper or .
  3. Boundary side: split the boundary into smooth pieces (faces, sides, arcs), write or on each piece, evaluate the dot product, integrate, and add the pieces.
  4. Compare the two numbers. If they differ, re-check orientations and missing pieces first.
Example 2.4.2Divergence theorem for a unit cube
Face-by-face bookkeeping for Example 2.4.2. The three faces that touch the corner (1,1,1) carry outward flux 2, 4 and 2, while each of the three faces through the origin carries the inward flux 1. The sum of the face fluxes equals the volume integral of \nabla\cdot\vec A=2x+6y+2z.
Figure 2.4.5. Face-by-face bookkeeping for Example 2.4.2. The three faces that touch the corner carry outward flux , and , while each of the three faces through the origin carries the inward flux . The sum of the face fluxes equals the volume integral of .
Example 2.4.3Divergence theorem for a sphere
The divergence theorem for \vec A=r^3\,\vec a_r checked on spheres of every radius R: the outward flux (line) and the volume integral of \nabla\cdot\vec A=5r^2 (circles) are both 4\pi R^5. Example 2.4.3 is the point R=2.
Figure 2.4.6. The divergence theorem for checked on spheres of every radius : the outward flux (line) and the volume integral of (circles) are both . Example 2.4.3 is the point .
Quick check

Use the divergence theorem and to find the outward flux of the position vector through a sphere of radius centred at the origin. Check the result directly.

. Directly: on the sphere , so the flux is .

← Back to Section 2.4 contents

Electromagnetic Fields and Waves · Prof. Gökhan Çınar© 2026 Gökhan Çınar. All rights reserved. Copyright