All chapters Unit 2 · Integral & Vector Calculus

The divergence theorem

Chapter 15 of 15
The hook

Total outflow, without ever touching the boundary

You want to know the net flow of a field out through a sealed box. The direct way is brutal: six face integrals, one per side, each with its own orientation. But there is a shortcut that feels like cheating — the total outflow equals the sum of the sources inside, read off in a single line. The boundary's books are balanced entirely by what is happening in the interior.

+ + Σ sources = net outflow
You can know everything crossing a sealed boundary without ever touching the boundary — just add up the sources inside. The six-face slog and the one-line interior sum give the same number.

That is the divergence theorem, and underneath it is conservation: what leaves a region through its surface is exactly what its interior produces or loses — nothing appears from nowhere, nothing vanishes. It is the precise step every fluid, smoke, and weather simulation runs millions of times a second (the "finite-volume method"): track each cell's sources, and the flux across its walls takes care of itself.

Why this matters

This is the last theorem of the course, and it completes a pattern. As with Green's and Stokes', we never picture the whole flux at once — we trade the surface for the solid it encloses and compute whichever side is easier. By the end of this chapter you will have the whole Unit-2 toolbox and the one idea that ties it — and Unit 1 — together.

Flux out = sources inside

The divergence theorem

The divergence of a field measures its local source strength — how much it spreads out from a point:

Divergence, and the divergence (Gauss) theorem
divF=F=Px+Qy+Rz,SFn^dS=V(divF)dV.\operatorname{div}\mathbf F = \nabla\cdot\mathbf F = P_x + Q_y + R_z, \qquad \iint_S \mathbf F\cdot\hat{\mathbf n}\,dS = \iiint_V (\operatorname{div}\mathbf F)\,dV.

Here SS is a closed surface — the complete boundary of the solid VV — oriented outward. That is the new structure: Chapter 14's surfaces were open sheets; here the surface seals a volume, and "flux out = total sources within." One last time, the Unit-2 process rule: compute whichever side is easier, and when both are doable they agree.

Worked example · WE1 · both sides agree

Flux of F=(x,y,z)\mathbf F = (x, y, z) out of the sphere of radius aa. Here divF=1+1+1=3\operatorname{div}\mathbf F = 1 + 1 + 1 = 3.

Volume side

V3dV=343πa3=4πa3.\displaystyle\iiint_V 3\,dV = 3\cdot\tfrac{4}{3}\pi a^3 = 4\pi a^3.

Surface side

On the sphere n^=(x,y,z)a\hat{\mathbf n} = \tfrac{(x,y,z)}{a}, so Fn^=x2+y2+z2a=a\mathbf F\cdot\hat{\mathbf n} = \tfrac{x^2+y^2+z^2}{a} = a; flux =a4πa2=4πa3.= a\cdot 4\pi a^2 = 4\pi a^3.

Both give 4πa34\pi a^3 — the theorem, confirmed.

Worked example · WE2 · six face integrals become one

Flux of F=(x2,y2,z2)\mathbf F = (x^2, y^2, z^2) out of the unit cube [0,1]3[0,1]^3. The divergence is divF=2x+2y+2z\operatorname{div}\mathbf F = 2x + 2y + 2z, so

V(2x+2y+2z)dV=301 ⁣ ⁣01 ⁣ ⁣012xdxdydz=31=3.\iiint_V (2x + 2y + 2z)\,dV = 3\int_0^1\!\!\int_0^1\!\!\int_0^1 2x\,dx\,dy\,dz = 3\cdot 1 = 3.

Check it the hard way: of the six faces, only x=1x=1, y=1y=1, z=1z=1 carry outward flux (the =0=0 faces have F=0\mathbf F = 0 there), each contributing 11, total 33. The theorem turned six face integrals into one easy volume integral.

Playground 1 — Flux Box

A sealed box holds four point sources. Set each source's strength, then — before you reveal — predict the net outward flux. The divergence theorem makes it just the sum: SFn^dS=VdivFdV=si\iint_S \mathbf F\cdot\hat{\mathbf n}\,dS = \iiint_V \operatorname{div}\mathbf F \,dV = \sum s_i.

Flux Box  ·  net outflow = Σ (source strengths)
sources in the box
source 1+1
source 2+1
source 3+1
source 4+1
Predict net flux:

Make the strengths cancel (say +2, −2, +1, −1) and the net flux is 0 — sealed box, live sources, nothing net crosses. Only the total matters, not the arrangement — the same lesson as Stokes' surface-independence.

End of sitting 1 — you have the divergence theorem and the flux-out-equals-sources-inside picture. After the break: the exam move it is built for (a nasty surface integral made easy), and then the close — what all of Unit 2, and Unit 1, were really about.

Why it earns its place on the paper

A nasty surface integral, made easy

The divergence theorem earns its exam place when a closed-surface flux is painful to integrate directly but has a simple divergence. You flip to the volume side and the slog disappears.

Worked example · WE3 · the direct integral you don't want to do

Flux of F=(x3,y3,z3)\mathbf F = (x^3, y^3, z^3) out of the sphere of radius aa. The direct surface integral is genuinely ugly. But divF=3(x2+y2+z2)=3ρ2\operatorname{div}\mathbf F = 3(x^2 + y^2 + z^2) = 3\rho^2, so go to the volume side in spherical coordinates:

V3ρ2dV=302π ⁣ ⁣0π ⁣ ⁣0aρ2ρ2sinϕdρdϕdθ=32π2a55=12πa55.\iiint_V 3\rho^2\,dV = 3\int_0^{2\pi}\!\!\int_0^{\pi}\!\!\int_0^{a}\rho^2\cdot\rho^2\sin\phi \,d\rho\,d\phi\,d\theta = 3\cdot 2\pi\cdot 2\cdot\frac{a^5}{5} = \frac{12\pi a^5}{5}.

One spherical integral instead of a page of surface algebra. (And if a surface is open, you can often close it with a flat cap, apply the theorem to the closed solid, then subtract the cap's flux — that is the other exam classic; see PR3.)

The close · the whole course in one idea

The boundary remembers the inside

You have now met three great theorems of vector calculus. Set them side by side and a single shape appears:

theoremboundary integral= interior integral of a derivative
Green (Ch 13)CFdr\displaystyle\oint_C \mathbf F\cdot d\mathbf r=D(QxPy)dA\displaystyle= \iint_D (Q_x - P_y)\,dA
Stokes (Ch 14)CFdr\displaystyle\oint_C \mathbf F\cdot d\mathbf r=S(curlF)n^dS\displaystyle= \iint_S (\operatorname{curl}\mathbf F)\cdot\hat{\mathbf n}\,dS
Gauss (Ch 15)SFn^dS\displaystyle\iint_S \mathbf F\cdot\hat{\mathbf n}\,dS=V(divF)dV\displaystyle= \iiint_V (\operatorname{div}\mathbf F)\,dV

One template, three dimensions: an integral over a boundary equals an integral of a derivative over the region the boundary encloses. The edge of a region carries enough information to recover what the whole interior is doing. The boundary remembers the inside.

And Unit 1 was saying it too

Now look back at the theorem that opened complex integration — Cauchy's integral formula:

f(z0)=12πiCf(z)zz0dz.f(z_0) = \frac{1}{2\pi i}\oint_C \frac{f(z)}{z - z_0}\,dz.

Read it again with today's eyes. The value of ff at a point inside the contour is determined entirely by the values of ff on the contour — boundary data fixing the interior, exactly the trilogy's idea. Chapter 13 already showed that a contour integral is two real line integrals and that Cauchy's theorem is Green's theorem plus the Cauchy–Riemann equations. This is the same kinship, stated at its sharpest: Unit 1's complex integration and Unit 2's vector integration were one idea all along — the boundary determines the inside, whether the field is a complex function or a flow in space. That is the course, in one sentence.

End of sitting 2 — the close is delivered; let it sit. The final sitting is the capstone skill: across the whole of Units 1 and 2, choosing the right tool — which is what an exam actually tests.

The capstone

Choosing the right tool

By now you can execute every method in Unit 2. The exam's real differentiator is not execution — it is reading a problem and knowing which tool it wants. So train exactly that. Each card below is a problem signature: the region, the integrand, what is asked. Predict the best tool, then reveal the verdict and a one-line why.

Method Chooser  ·  the whole Ch 10–15 toolbox
card 1 / 13

The trap to watch: a closed surface wants the divergence theorem, but an open surface does not — there is no solid to fill, so you integrate the flux directly. Closed vs open is the whole game.

Retrieval gauntlet

Test yourself before the finish

Commit before reading the feedback. The first three are computation; the last two are the structural insight the course has been building toward.

Quiz 1 · divergence, sphere

The flux of F=(x,y,z)\mathbf F = (x, y, z) out of the sphere of radius 22 is:

Quiz 2 · non-constant divergence

The flux of F=(x2,y2,z2)\mathbf F = (x^2, y^2, z^2) out of the unit cube [0,1]3[0,1]^3 is:

Quiz 3 · the shared structure

Green's, Stokes', and the divergence theorem all share which structure?

Quiz 4 · pick the route

You need the flux of F\mathbf F out of a closed surface (a sphere) where divF\operatorname{div}\mathbf F is simple but the direct surface integral is messy. The best route is:

Quiz 5 · divergence, cylinder with caps

The flux of F=(x,y,0)\mathbf F = (x, y, 0) out of the closed cylinder x2+y21x^2 + y^2 \le 1, 0z20 \le z \le 2 (caps included) is:

Exam translator — what a divergence question asks

Exam shapes
  • "Find the flux of F\mathbf F out of ⟨closed surface⟩" → divergence theorem: VdivFdV\iiint_V \operatorname{div}\mathbf F\,dV, in whatever coordinates fit the solid (WE1, WE3).
  • "Verify the divergence theorem for …" → compute both sides and show they match (WE1, WE2).
  • "Flux through an open surface" → either integrate directly, or close it with a cap and subtract (PR3). An open surface is not a divergence-theorem problem on its own.

Worked solutions are complete; do them as listed — interleaved on purpose. Three are decision-only (PR5, PR7, PR8); PR3 opens with a faded bridge.

PR1 · flux out of a sphere

Shape · closed surface ⇒ divergence theorem

PR1. Find the flux of F=(2x,2y,2z)\mathbf F = (2x, 2y, 2z) out of the unit sphere.

divF=6\operatorname{div}\mathbf F = 6, so the flux is V6dV=643π=8π\iiint_V 6\,dV = 6\cdot\tfrac{4}{3}\pi = 8\pi.

PR2 · non-constant divergence

Shape · closed box, variable div ⇒ ∭ div F

PR2. Find the flux of F=(xy,yz,zx)\mathbf F = (xy, yz, zx) out of the unit cube [0,1]3[0,1]^3.

divF=y+z+x\operatorname{div}\mathbf F = y + z + x, and [0,1]3(x+y+z)dV=312=32\displaystyle\iiint_{[0,1]^3}(x + y + z)\,dV = 3\cdot\tfrac12 = \tfrac32.

PR3 · faded bridge · close an open surface with a cap

Shape · open surface ⇒ close it, apply divergence, subtract the cap

PR3. Find the flux of F=(x,y,z)\mathbf F = (x, y, z) upward through the open paraboloid z=1x2y2z = 1 - x^2 - y^2, z0z \ge 0.

Bridge: the paraboloid alone is open. Close it with the disk z=0z = 0 (x2+y21x^2+y^2 \le 1) to seal a solid, apply the divergence theorem to that solid, then subtract the disk's flux. Predict: what is divF\operatorname{div}\mathbf F, and what does the disk contribute?

divF=3\operatorname{div}\mathbf F = 3. The sealed solid is 0z1x2y20 \le z \le 1 - x^2 - y^2, whose volume is r1(1r2)dA=π2\iint_{r\le 1}(1 - r^2)\,dA = \tfrac{\pi}{2}, so the closed flux is 3π2=3π23\cdot\tfrac{\pi}{2} = \tfrac{3\pi}{2}. The bottom disk is oriented downward, n^=k\hat{\mathbf n} = -\mathbf k, and there Fn^=z=0\mathbf F\cdot\hat{\mathbf n} = -z = 0 (since z=0z = 0). So the disk adds nothing, and the paraboloid's upward flux is 3π2\tfrac{3\pi}{2}.

That is the same 3π2\tfrac{3\pi}{2} you found by direct surface integral in Chapter 14 (WE3) — two methods, one answer.

PR4 · flux out of a cylinder

Shape · closed cylinder ⇒ divergence theorem

PR4. Find the flux of F=(x,y,z)\mathbf F = (x, y, z) out of the cylinder x2+y21x^2 + y^2 \le 1, 0z30 \le z \le 3.

divF=3\operatorname{div}\mathbf F = 3, and the cylinder's volume is π123=3π\pi\cdot 1^2\cdot 3 = 3\pi, so the flux is 33π=9π3\cdot 3\pi = 9\pi.

PR5 · decision-only · which theorem?

Shape · no computation — name the tool and why

PR5. A closed surface, with divF\operatorname{div} \mathbf F simple but the direct surface integral messy. Which theorem, and why?

The divergence theorem. A closed surface seals a solid, and a simple divergence makes VdivFdV\iiint_V \operatorname{div}\mathbf F\,dV far easier than the direct SFn^dS\iint_S \mathbf F\cdot\hat{\mathbf n}\,dS.

PR6 · a callback · which tool, and the value

Shape · closed planar loop ⇒ Green's theorem

PR6. For C(ydx+xdy)\displaystyle\oint_C(-y\,dx + x\,dy) around the unit circle, name the efficient tool and give the value.

Green's theorem (a closed planar loop): QxPy=1(1)=2Q_x - P_y = 1 - (-1) = 2, so C=D2dA=2π=2π\oint_C = \iint_D 2\,dA = 2\cdot\pi = 2\pi. (This is the Chapter 13 area form — the same 2π2\pi.)

PR7 · decision-only · choose the coordinate system

Shape · match the solid's symmetry to its coordinates

PR7. For each solid, name the coordinate system: (a) a ball; (b) a cylinder-bounded solid.

(a) Spherical — a ball is origin-centred and round, so ρ\rho runs to a constant; dV=ρ2sinϕdρdϕdθdV = \rho^2\sin\phi\,d\rho\,d\phi\,d\theta. (b) Cylindrical — a circular cross-section with an axis; dV=rdrdθdzdV = r\,dr\,d\theta\,dz.

PR8 · synthesis · the one idea

Shape · say it in your own words

PR8. In a sentence or two: what do Green's, Stokes', and the divergence theorem share, and how does Cauchy's integral formula fit?

All three say a boundary integral equals an interior integral of a derivative — the values on the edge determine what happens inside. Cauchy's integral formula is the same idea in Unit 1: ff on a contour fixes ff everywhere inside it. Boundary data determines the interior — in the plane, in space, and in the complex plane alike.

Three things to carry out of this chapter

  1. The divergence theorem trades a closed surface for the solid inside: SFn^dS=VdivFdV\iint_S \mathbf F\cdot\hat{\mathbf n}\,dS = \iiint_V \operatorname{div}\mathbf F\,dV, outward normal — flux out equals total sources within.
  2. Reach for it when the surface is closed and the divergence is simple; an open surface is integrated directly, or closed off with a cap.
  3. Green, Stokes, Gauss — and Cauchy's integral formula — are one idea: a boundary integral equals an interior integral of a derivative. The boundary remembers the inside.
The course, closed

Fifteen chapters — from where complex numbers live, through analytic functions, contour integration and residues, into double and triple integrals, the Jacobian, and the three great theorems of vector calculus — and underneath all of it, one idea: what happens on the boundary of a region determines what happens inside it. Conservation made that physical here in Chapter 15: nothing leaves a sealed region that its interior did not give up. You have the whole toolbox now, and — harder and more valuable — a feel for which tool a problem is asking for. That judgement is the thing exams really test, and the thing that lasts. Go well.

Same material, another voice

If a different explanation would help, this maps onto the chapter — free, from MIT OpenCourseWare: