The divergence theorem is more than a way to trade one integral for another. It handles open surfaces (close them up, then subtract), fields with a singular point (cut it out with a small sphere), and it computes volumes from boundaries. Each idea below is a pattern you will use again in physics.
Key idea
Three patterns:
- Open surface: add pieces to make a closed surface. Flux through the original surface $=$ $\iiint \nabla \cdot \mathbf{F}\,dV$ $-$ flux through the added pieces (with their outward normals).
- Singular point: if $\nabla \cdot \mathbf{F} = 0$ except at a point inside $S$, the flux through $S$ equals the flux through any small sphere around that point.
- Volume: with $\mathbf{F} = \frac{1}{3}\langle x, y, z \rangle$, $\nabla \cdot \mathbf{F} = 1$, so $\text{Volume}(E) = \frac{1}{3}\iint_S \langle x, y, z \rangle \cdot d\mathbf{S}$.
Why it works
The singular point: let $S_\varepsilon$ be a tiny sphere around the point, inside $S$. On the solid between $S_\varepsilon$ and $S$ the field is smooth with zero divergence. That solid's boundary is $S$ (normal outward) together with $S_\varepsilon$ (normal pointing toward the point, which is outward for the solid between). The theorem gives flux through $S$ minus flux out of $S_\varepsilon$ $= 0$.
For the inverse-square field $\mathbf{F} = \frac{\mathbf{r}}{|\mathbf{r}|^3}$, on $S_\varepsilon$ we have $\mathbf{F} \cdot \mathbf{n} = \frac{1}{\varepsilon^2}$, so the flux is $\frac{1}{\varepsilon^2} \cdot 4\pi\varepsilon^2 = 4\pi$, whatever the size and shape of $S$, as long as it surrounds the origin.
For the inverse-square field $\mathbf{F} = \frac{\mathbf{r}}{|\mathbf{r}|^3}$, on $S_\varepsilon$ we have $\mathbf{F} \cdot \mathbf{n} = \frac{1}{\varepsilon^2}$, so the flux is $\frac{1}{\varepsilon^2} \cdot 4\pi\varepsilon^2 = 4\pi$, whatever the size and shape of $S$, as long as it surrounds the origin.
Worked examples
Worked example: A hemisphere without its base
Find the upward flux of $\mathbf{F} = \langle 0, 0, z + 1 \rangle$ through the upper hemisphere $x^2 + y^2 + z^2 = a^2$, $z \ge 0$.
- Close it with the disk $D$ at $z = 0$, outward normal $-\mathbf{k}$. On $D$: $\mathbf{F} \cdot (-\mathbf{k}) = -(0 + 1) = -1$, so the disk's flux is $-\pi a^2$.
- $\nabla \cdot \mathbf{F} = 1$: the half ball gives $\frac{2}{3}\pi a^3$.
- Hemisphere $= \frac{2}{3}\pi a^3 - (-\pi a^2) = \frac{2}{3}\pi a^3 + \pi a^2$.
Answer: $\frac{2}{3}\pi a^3 + \pi a^2$
Worked example: Any surface around the origin
Find the outward flux of $\mathbf{F} = \frac{\langle x, y, z \rangle}{(x^2 + y^2 + z^2)^{3/2}}$ through the cube $[-1, 1]^3$, and through the sphere of radius ${}1$ centered at $(5, 0, 0)$.
- Away from the origin, $\nabla \cdot \mathbf{F} = 0$ (a direct computation).
- The cube surrounds the origin, so its flux equals that of a small sphere: ${}4\pi$.
- The second sphere does not contain the origin; $\mathbf{F}$ is smooth inside, so its flux is $\iiint 0\,dV = 0$.
Answer: ${}4\pi$ and ${}0$
Worked example: Five faces of a cube
Find the outward flux of $\mathbf{F} = \langle x^2, y, z \rangle$ through the faces of $[0, 1]^3$ other than the top $z = 1$.
- All six faces: $\nabla \cdot \mathbf{F} = 2x + 2$, and $\iiint (2x + 2)\,dV = 1 + 2 = 3$.
- Top face, normal $\mathbf{k}$: $\mathbf{F} \cdot \mathbf{k} = z = 1$, so its flux is ${}1$.
- Five faces: ${}3 - 1 = 2$.
Answer: ${}2$