Review / Chapter 2 — Vector Calculus

Divergence Theorem

Chapter 2 — Vector Calculus

The divergence theorem (also called Gauss's theorem, not to be confused with Gauss's law) converts a volume integral of a divergence into a surface integral of flux:

\[\int_V (\vec{\nabla}\cdot\vec{F})\,dV = \oint_{\partial V} \vec{F}\cdot d\vec{A}.\]

Here \(V\) is any well-behaved volume, \(\partial V\) is its closed bounding surface, and \(d\vec{A}\) is an outward-pointing area element.

Why it works (the tiling argument)

Chop the volume \(V\) into many tiny sub-volumes \(V_i\). The divergence is defined so that, for each tiny piece,

\[(\vec{\nabla}\cdot\vec{F})_i\,V_i \approx \oint_{\partial V_i} \vec{F}\cdot d\vec{A}.\]

Now add up all the sub-volumes. On the left you get a Riemann sum for \(\int_V(\vec{\nabla}\cdot\vec{F})\,dV\). On the right, every internal face is shared between two neighboring cells with oppositely-oriented outward normals — those contributions cancel in pairs. Only the external faces survive, and they assemble into \(\oint_{\partial V}\vec{F}\cdot d\vec{A}\). Taking the limit gives the theorem.

How to read it

The left side is a volume integral of a local scalar (divergence). The right side is a surface integral of the field itself (flux). The theorem says these are always equal — the total "source content" inside a volume equals the net outflow through its boundary.

You can use the theorem in either direction:

Worked example

Let \(\vec{F} = \vec{r} = (x,y,z)\) and take \(V\) to be a sphere of radius \(R\) centered at the origin.

Volume side: we already know \(\vec{\nabla}\cdot\vec{r} = 3\), so

\[\int_V 3\,dV = 3\cdot\frac{4}{3}\pi R^3 = 4\pi R^3.\]

Surface side: on the sphere \(\vec{r}\cdot d\vec{A} = r\,dA = R\,dA\), so

\[\oint_{\partial V}\vec{r}\cdot d\vec{A} = R\cdot(4\pi R^2) = 4\pi R^3.\]

They match.

Relation to Gauss's law

Applying the divergence theorem to the electric field gives

\[\oint_{\partial V}\vec{E}\cdot d\vec{A} = \int_V (\vec{\nabla}\cdot\vec{E})\,dV.\]

The left side is \(Q_{\rm enc}/\epsilon_0\) by the integral Gauss's law. The right side is the volume integral of whatever local quantity equals the charge density divided by \(\epsilon_0\). Equating integrands (valid because \(V\) is arbitrary) gives the differential form of Gauss's law, \(\vec{\nabla}\cdot\vec{E} = \rho/\epsilon_0\).

Practice Problems

Problem 1easy
Using the divergence theorem, compute \(\oint_S \vec{F}\cdot d\vec{A}\) for \(\vec{F}=(x,0,0)\) on the surface of the unit cube \([0,1]^3\).
Hint
Compute \(\vec{\nabla}\cdot\vec{F}\) and integrate.
Solution

\(\vec{\nabla}\cdot\vec{F} = 1\), so the volume integral is just the volume: \(\int_V 1\,dV = 1\).

Answer: \(1\).

Problem 2easy
For any closed volume \(V\), show that \(\oint_{\partial V}\vec{F}\cdot d\vec{A} = 0\) when \(\vec{F}\) is uniform.
Hint
What is the divergence of a constant vector field?
Solution

\(\vec{\nabla}\cdot\vec{F}=0\) for any constant \(\vec{F}\). The divergence theorem then says \(\oint\vec{F}\cdot d\vec{A}=\int_V 0\,dV = 0\).

Answer: flux of a uniform field through any closed surface is zero.

Problem 3medium
Use the divergence theorem to compute \(\oint_S \vec{F}\cdot d\vec{A}\) for \(\vec{F} = (x^3,y^3,z^3)\) on the sphere of radius \(R\) centered at the origin.
Hint
\(\vec{\nabla}\cdot\vec{F} = 3(x^2+y^2+z^2) = 3r^2\); integrate with spherical shells.
Solution

\(\int_V 3r^2\,dV = 3\int_0^R r^2\cdot 4\pi r^2\,dr = 12\pi\cdot R^5/5 = \frac{12\pi R^5}{5}\).

Answer: \(\frac{12\pi R^5}{5}\).

Problem 4medium
A vector field has \(\vec{\nabla}\cdot\vec{F} = 2\) everywhere. What is the flux of \(\vec{F}\) out of an arbitrary solid region of volume \(V_0\)?
Hint
Plug straight into the theorem.
Solution

\(\oint\vec{F}\cdot d\vec{A} = \int_V 2\,dV = 2V_0\).

Answer: \(2V_0\).

Problem 5hard
A Coulomb field \(\vec{E} = k\hat{r}/r^2\) has \(\vec{\nabla}\cdot\vec{E}=0\) away from the origin, yet \(\oint_S\vec{E}\cdot d\vec{A} = 4\pi k\) for any sphere enclosing the origin. How is this consistent with the divergence theorem?
Hint
The divergence is zero only off the origin; right at the origin, the field isn't smooth.
Solution

The divergence theorem requires \(\vec{F}\) to be smooth inside \(V\). For the Coulomb field, the "missing" flux of \(4\pi k\) is concentrated in a delta-function divergence at the origin: treating \(\vec{\nabla}\cdot(\hat{r}/r^2) = 4\pi\delta^3(\vec{r})\) makes the theorem work. Physically, this delta function is the point source — it's exactly \(\rho/\epsilon_0\) for a point charge.

Answer: the divergence isn't zero at the origin; it contains a delta function representing the point source.