Math Core

Lesson 5.8 · Vector Calculus

The divergence theorem

The flux form of Green's theorem says the net outflow across a closed curve equals the total divergence inside it. The divergence theorem (also called Gauss's theorem) is the same statement one dimension up: the flux of a vector field out of a closed surface equals the triple integral of its divergence over the solid inside. It turns hard flux integrals into easy volume integrals, and it underlies conservation laws in physics.

The theorem

A closed surface is one that encloses a solid, like a sphere, the six faces of a cube, or a cylinder with its top and bottom. Closed surfaces get the outward orientation by default: the unit normal points away from the solid.

The divergence theorem

Let EE be a solid region whose boundary SS is a closed, piecewise-smooth surface with outward orientation. If F\mathbf{F} has continuous partial derivatives on an open region containing EE, then

∬SF⋅dS=∭Ediv⁡F dV.\iint_S \mathbf{F}\cdot d\mathbf{S} = \iiint_E \operatorname{div}\mathbf{F}\,dV.

Why it's true. Think of F\mathbf{F} as fluid velocity. The divergence at a point is the outflow per unit volume from a tiny box there. Stack all the tiny boxes that fill EE: fluid leaving one box through a shared face enters its neighbor, so interior faces cancel. What's left is the flow through the outer boundary SS. Total sources inside equal net flow out.

Worked example: A sphere

Find the outward flux of F=⟨x,y,z⟩\mathbf{F} = \langle x, y, z\rangle across the sphere of radius aa centered at the origin.

div⁡F=1+1+1=3\operatorname{div}\mathbf{F} = 1 + 1 + 1 = 3, so the flux is 3⋅volume=3⋅43πa3=4πa33\cdot\text{volume} = 3\cdot\dfrac{4}{3}\pi a^3 = 4\pi a^3. This matches the direct surface-integral computation from the previous lessons, with no parametrization needed.

Worked example: A variable divergence

Find the outward flux of F=⟨x3, y3, z3⟩\mathbf{F} = \langle x^3,\ y^3,\ z^3\rangle across the unit sphere.

div⁡F=3x2+3y2+3z2=3ρ2\operatorname{div}\mathbf{F} = 3x^2 + 3y^2 + 3z^2 = 3\rho^2. In spherical coordinates, dV=ρ2sin⁡ϕ dρ dϕ dθdV = \rho^2\sin\phi\,d\rho\,d\phi\,d\theta:

∭E3ρ2 dV=∫02π ⁣ ⁣∫0π ⁣ ⁣∫013ρ4sin⁡ϕ dρ dϕ dθ=35⋅2⋅2π=12π5.\iiint_E 3\rho^2\,dV = \int_0^{2\pi}\!\!\int_0^{\pi}\!\!\int_0^1 3\rho^4\sin\phi\,d\rho\,d\phi\,d\theta = \frac{3}{5}\cdot 2\cdot 2\pi = \frac{12\pi}{5}.

Worked example: Six faces at once

Find the outward flux of F=⟨x2, yz, x+z⟩\mathbf{F} = \langle x^2,\ yz,\ x + z\rangle across the boundary of the unit cube 0≤x,y,z≤10 \le x, y, z \le 1.

A direct computation would need six surface integrals. Instead, div⁡F=2x+z+1\operatorname{div}\mathbf{F} = 2x + z + 1, and

∭E(2x+z+1) dV=∫01 ⁣ ⁣∫01 ⁣ ⁣∫01(2x+z+1) dx dy dz=1+12+1=52.\iiint_E (2x + z + 1)\,dV = \int_0^1\!\!\int_0^1\!\!\int_0^1 (2x + z + 1)\,dx\,dy\,dz = 1 + \frac{1}{2} + 1 = \frac{5}{2}.

(Each term integrates separately: ∫012x dx=1\int_0^1 2x\,dx = 1 and ∫01z dz=12\int_0^1 z\,dz = \tfrac{1}{2}, over a cube of volume 11.)

Surfaces that aren't closed

The divergence theorem needs a closed surface. If you want the flux through an open surface, like a hemisphere or a paraboloid cap, you can often close it off with a simple flat piece, apply the theorem to the closed surface, and subtract the flux through the piece you added.

Worked example: Closing a hemisphere

Find the flux of F=⟨x, y, 1⟩\mathbf{F} = \langle x,\ y,\ 1\rangle outward through the upper unit hemisphere x2+y2+z2=1x^2 + y^2 + z^2 = 1, z≥0z \ge 0.

Add the disk DD: x2+y2≤1x^2 + y^2 \le 1 in the plane z=0z = 0, with outward (downward) normal −k-\mathbf{k}. Together they bound the solid half-ball EE.

Whole closed surface. div⁡F=1+1+0=2\operatorname{div}\mathbf{F} = 1 + 1 + 0 = 2, and EE has volume 23π\tfrac{2}{3}\pi, so the total outward flux is 4π3\tfrac{4\pi}{3}.

Bottom disk. F⋅(−k)=−1\mathbf{F}\cdot(-\mathbf{k}) = -1, so the flux through DD is −1⋅π=−π-1\cdot\pi = -\pi.

Hemisphere. 4π3−(−π)=7π3\dfrac{4\pi}{3} - (-\pi) = \dfrac{7\pi}{3}.

Gauss's law

The inverse-square field E=q x∣x∣3\mathbf{E} = \dfrac{q\,\mathbf{x}}{\lvert\mathbf{x}\rvert^3} (the electric field of a point charge at the origin, in suitable units) has div⁡E=0\operatorname{div}\mathbf{E} = 0 everywhere except the origin, where it is undefined. Two cases:

  • If a closed surface SS does not enclose the origin, the divergence theorem applies and the flux is 00.
  • If SS does enclose the origin, cut out a tiny sphere around it. The divergence theorem on the region between them shows the flux through SS equals the flux through the tiny sphere, which a direct computation gives as 4πq4\pi q.

So the flux depends only on the enclosed charge, not on the shape of the surface. That is Gauss's law.

Common mistake

Check two things before using the theorem: the surface must be closed (otherwise close it off and subtract), and F\mathbf{F} must be smooth everywhere inside. A field like x/∣x∣3\mathbf{x}/\lvert\mathbf{x}\rvert^3 that blows up inside the surface needs the cut-out argument above.

Tip

If div⁡F=0\operatorname{div}\mathbf{F} = 0, the outward flux through every closed surface (enclosing only points where F\mathbf{F} is smooth) is 00. Spot this before doing any integrals.

Practice

Practice 1

Find the outward flux of F=⟨2x, 3y, z⟩\mathbf{F} = \langle 2x,\ 3y,\ z\rangle across the unit sphere.

Enter a number. Fractions like 3/4 and sqrt(2) are OK.

Practice 2

Find the outward flux of F=⟨x2, y2, z2⟩\mathbf{F} = \langle x^2,\ y^2,\ z^2\rangle across the boundary of the cube 0≤x,y,z≤20 \le x, y, z \le 2.

Enter a number. Fractions like 3/4 and sqrt(2) are OK.

Practice 3

Let F=⟨y, z, x⟩\mathbf{F} = \langle y,\ z,\ x\rangle and let SS be the boundary of any solid region, oriented outward. Find ∬SF⋅dS\displaystyle\iint_S \mathbf{F}\cdot d\mathbf{S}.

Enter a number. Fractions like 3/4 and sqrt(2) are OK.

Practice 4

Find the outward flux of F=⟨x,y,z⟩\mathbf{F} = \langle x, y, z\rangle across the closed cylinder bounded by x2+y2=4x^2 + y^2 = 4, z=0z = 0 and z=3z = 3 (including the top and bottom).

Enter a number. Fractions like 3/4 and sqrt(2) are OK.

Practice 5

Find the outward flux of F=⟨x3, y3, 0⟩\mathbf{F} = \langle x^3,\ y^3,\ 0\rangle across the closed cylinder bounded by x2+y2=1x^2 + y^2 = 1, z=0z = 0 and z=2z = 2.

Enter a number. Fractions like 3/4 and sqrt(2) are OK.

Practice 6

Let EE be the solid between the spheres of radius 11 and 22 centered at the origin. Find the outward flux of F=⟨x,y,z⟩\mathbf{F} = \langle x, y, z\rangle across the boundary of EE (both spheres, each oriented away from EE).

Enter a number. Fractions like 3/4 and sqrt(2) are OK.

Practice 7

Find the flux of F=⟨0,0,z⟩\mathbf{F} = \langle 0, 0, z\rangle upward through the paraboloid z=4−x2−y2z = 4 - x^2 - y^2, z≥0z \ge 0.

Enter a number. Fractions like 3/4 and sqrt(2) are OK.

Practice 8

Let E=q x∣x∣3\mathbf{E} = \dfrac{q\,\mathbf{x}}{\lvert\mathbf{x}\rvert^3}. A closed surface SS is a cube centered at (10,0,0)(10, 0, 0) with side length 22, oriented outward. What is the flux of E\mathbf{E} across SS?