Surface Integrals, Stokes & Divergence

Study Sheet

Surface Integrals, Stokes & Divergence

Flux through surfaces and the two capstone theorems

The Capstone Theorems

Tip
Flux: how much field crosses a surface
r = 3F = (0, 0, 5)
A constant upward field through a flat disk of radius 33: flux == normal component ×\times area =5⋅9π= 5\cdot9\pi.

The surface integral ∬SF⋅dS=∬SF⋅n dS\iint_S \mathbf F\cdot d\mathbf S = \iint_S \mathbf F\cdot\mathbf n\,dS measures net flow through SS: only the component of F\mathbf F along the unit normal n\mathbf n counts.

For a FLAT surface with constant field this collapses to (normal component) ×\times (area) — the flux of (0,0,5)(0,0,5) up through a radius-33 disk is 5⋅9π=45π5\cdot9\pi = 45\pi, no machinery required. For curved surfaces, parametrize and integrate; for CLOSED surfaces there is usually a shortcut, and it is the next box.

Tip
The divergence theorem and Stokes’ theorem

DIVERGENCE THEOREM: outward flux through a closed surface equals ∭∇⋅F dV\iiint \nabla\cdot\mathbf F\,dV over the enclosed solid — total outflow equals the sum of all the little sources inside.

STOKES: circulation ∮F⋅dr\oint\mathbf F\cdot d\mathbf r around a closed curve equals the flux of ∇×F\nabla\times\mathbf F through ANY surface spanning it — total rotation around the rim equals the sum of the little whirlpools on the membrane. Green's theorem is Stokes flattened into the plane; the fundamental theorem of calculus is the 1-dimensional case of everything. One slogan covers the whole family: the integral of a derivative over a region equals the original quantity summed over the boundary.

Side note
Why physicists write Maxwell’s equations twice

Each of Maxwell's equations has a differential form (about ∇⋅\nabla\cdot and ∇×\nabla\times at a point) and an integral form (about flux and circulation over regions) — and the divergence and Stokes theorems are precisely the dictionary between them. Gauss's law "flux of E\mathbf E = enclosed charge" IS the divergence theorem applied to ∇⋅E=ρ/ε0\nabla\cdot\mathbf E = \rho/\varepsilon_0. Learning these two theorems is learning to read electromagnetism.

Try it
Try it: flux through a sphere without parametrizing anything

Find the outward flux of F=(x,y,z)\mathbf F = (x, y, z) through the sphere of radius 22 centred at the origin.

Show the answer

The divergence is ∇⋅F=1+1+1=3\nabla\cdot\mathbf F = 1 + 1 + 1 = 3, so by the divergence theorem the flux is 33 times the volume: 3⋅43π⋅23=32π3\cdot\tfrac43\pi\cdot2^3 = 32\pi. Cross-check directly: on the sphere the outward unit normal is 12(x,y,z)\tfrac12(x, y, z), so F⋅n=12(x2+y2+z2)=2\mathbf F\cdot\mathbf n = \tfrac12(x^2 + y^2 + z^2) = 2 everywhere on it, and the flux is 22 times the area 4π⋅22=16π4\pi\cdot2^2 = 16\pi, which is 32π32\pi. When the divergence is constant, a flux problem is a volume problem.

Surface Integrals Through a Parametrization

Tip
The cross product measures the patch

If SS is parametrized by r(u,v)\mathbf r(u, v) over a region DD, then dS=∣ru×rv∣ du dvdS = |\mathbf r_u\times\mathbf r_v|\,du\,dv and

∬SF⋅dS=∬DF(r(u,v))⋅(ru×rv) du dv,\iint_S\mathbf F\cdot d\mathbf S = \iint_D\mathbf F(\mathbf r(u, v))\cdot(\mathbf r_u\times\mathbf r_v)\,du\,dv,

with ru×rv\mathbf r_u\times\mathbf r_v pointing the chosen way. For a graph z=g(x,y)z = g(x, y), rx×ry=(−gx,−gy,1)\mathbf r_x\times\mathbf r_y = (-g_x, -g_y, 1), which points up.

Why the cross product: a small du×dvdu\times dv patch of the parameter region is carried to a small parallelogram on the surface spanned by ru du\mathbf r_u\,du and rv dv\mathbf r_v\,dv. Its area is ∣ru×rv∣ du dv|\mathbf r_u\times\mathbf r_v|\,du\,dv, and its normal points along ru×rv\mathbf r_u\times\mathbf r_v. So F⋅(ru×rv) du dv\mathbf F\cdot(\mathbf r_u\times\mathbf r_v)\,du\,dv is exactly (normal component of F\mathbf F) ×\times (area of the patch), the flux through it.

Example
Example: the area of a cone

Find the area of the cone z=x2+y2z = \sqrt{x^2 + y^2} for z≤2z \le 2. Parametrize by height and angle: r(u,θ)=(ucos⁡θ,usin⁡θ,u)\mathbf r(u, \theta) = (u\cos\theta, u\sin\theta, u) with 0≤u≤20 \le u \le 2. Then ru=(cos⁡θ,sin⁡θ,1)\mathbf r_u = (\cos\theta, \sin\theta, 1), rθ=(−usin⁡θ,ucos⁡θ,0)\mathbf r_\theta = (-u\sin\theta, u\cos\theta, 0) and ru×rθ=(−ucos⁡θ,−usin⁡θ,u)\mathbf r_u\times\mathbf r_\theta = (-u\cos\theta, -u\sin\theta, u), of length u2u\sqrt2.

So the area is ∫02π ⁣∫022 u du dθ=2⋅2⋅2π=42 π\int_0^{2\pi}\!\int_0^2\sqrt2\,u\,du\,d\theta = \sqrt2\cdot2\cdot2\pi = 4\sqrt2\,\pi. Check with the slant-height formula πrℓ\pi r\ell: the base radius is r=2r = 2 and the slant height is ℓ=22\ell = 2\sqrt2, so πrℓ=42 π\pi r\ell = 4\sqrt2\,\pi.

Example
Example: flux through a dome
2
The dome z=4−x2−y2z = 4 - x^2 - y^2 with unit normals along (2x,2y,1)(2x, 2y, 1): vertical at the top, leaning outward lower down.

Find the upward flux of F=(0,0,z)\mathbf F = (0, 0, z) through the dome z=4−x2−y2z = 4 - x^2 - y^2, z≥0z \ge 0. For the graph g=4−x2−y2g = 4 - x^2 - y^2 the upward normal is (−gx,−gy,1)=(2x,2y,1)(-g_x, -g_y, 1) = (2x, 2y, 1), and F⋅(2x,2y,1)=z=4−x2−y2\mathbf F\cdot(2x, 2y, 1) = z = 4 - x^2 - y^2.

Over the shadow disk r≤2r \le 2, in polar coordinates: ∫02π ⁣∫02(4−r2) r dr dθ=8π\int_0^{2\pi}\!\int_0^2 (4 - r^2)\,r\,dr\,d\theta = 8\pi. Cross-check with the divergence theorem: ∇⋅F=1\nabla\cdot\mathbf F = 1, so the outward flux through the closed surface (dome plus base disk) is the volume under the dome, 8π8\pi, found in the triple-integrals topic. On the base z=0z = 0 the field is zero, so all 8π8\pi passes through the dome.

Side note
Where it goes wrong

Leaving out ∣ru×rv∣|\mathbf r_u\times\mathbf r_v|. For the cone, ∫02π ⁣∫02du dθ=4π\int_0^{2\pi}\!\int_0^2 du\,d\theta = 4\pi is the area of the flat parameter rectangle, not of the surface; the factor 2\sqrt2 is how much the slant of the cone stretches it. The other slip is a backwards normal: ry×rx=(−2x,−2y,−1)\mathbf r_y\times\mathbf r_x = (-2x, -2y, -1) points down into the dome and gives −8π-8\pi. Always check the direction of the normal at one easy point, such as the top.

Try it
Try it: flux out of a cylinder wall

Find the outward flux of F=(x,y,0)\mathbf F = (x, y, 0) through the side of the cylinder x2+y2=4x^2 + y^2 = 4, 0≤z≤30 \le z \le 3.

Show the answer

On the side, the outward unit normal is n=12(x,y,0)\mathbf n = \tfrac12(x, y, 0), so F⋅n=12(x2+y2)=2\mathbf F\cdot\mathbf n = \tfrac12(x^2 + y^2) = 2 at every point. The side has area 2π⋅2⋅3=12π2\pi\cdot2\cdot3 = 12\pi, so the flux is 2⋅12π=24π2\cdot12\pi = 24\pi. Check with the divergence theorem: ∇⋅F=2\nabla\cdot\mathbf F = 2, so the whole closed cylinder has outward flux 2⋅(π⋅4⋅3)=24π2\cdot(\pi\cdot4\cdot3) = 24\pi; the top and bottom carry none, because F\mathbf F has no zz-component. All 24π24\pi goes through the side.

Using the Divergence and Stokes Theorems

Tip
Pick the side that is easier

Divergence theorem: ∯SF⋅dS=∭E∇⋅F dV\displaystyle\oiint_S\mathbf F\cdot d\mathbf S = \iiint_E\nabla\cdot\mathbf F\,dV for the outward normal on the closed boundary SS of EE. Stokes' theorem: ∮CF⋅dr=∬S(∇×F)⋅dS\displaystyle\oint_C\mathbf F\cdot d\mathbf r = \iint_S(\nabla\times\mathbf F)\cdot d\mathbf S for any surface SS whose boundary is CC, oriented by the right-hand rule (thumb along the normal, fingers along CC). The first needs a closed surface; the second needs a surface bounded by CC.

Why any surface will do in Stokes' theorem: two surfaces with the same boundary curve together enclose a solid, and the outward flux of a curl through that closed surface is ∭∇⋅(∇×F) dV=0\iiint\nabla\cdot(\nabla\times\mathbf F)\,dV = 0, because the divergence of a curl is always zero. So the two fluxes agree (with orientations matched to CC), and you are free to choose the simplest cap — usually a flat disk.

Example
Example: a cubic field out of the unit ball

Find the outward flux of F=(x3,y3,z3)\mathbf F = (x^3, y^3, z^3) through the unit sphere. Parametrizing the sphere would be painful; the divergence is ∇⋅F=3(x2+y2+z2)=3ρ2\nabla\cdot\mathbf F = 3(x^2 + y^2 + z^2) = 3\rho^2.

So the flux is ∭3ρ2 dV=3∫02π ⁣∫0π ⁣∫01ρ2⋅ρ2sin⁡ϕ dρ dϕ dθ=3⋅15⋅4π=12π5\iiint 3\rho^2\,dV = 3\int_0^{2\pi}\!\int_0^\pi\!\int_0^1\rho^2\cdot\rho^2\sin\phi\,d\rho\,d\phi\,d\theta = 3\cdot\tfrac15\cdot4\pi = \tfrac{12\pi}{5}. The divergence depends only on ρ\rho, which is what made spherical coordinates the right choice for the volume integral.

Example
Example: swapping a hemisphere for a disk
kC
The hemisphere and the flat disk (dashed rim) share the boundary circle CC, so the curl has the same flux through both.

Compute ∬S(∇×F)⋅dS\iint_S(\nabla\times\mathbf F)\cdot d\mathbf S for F=(z−y,x,xyz)\mathbf F = (z - y, x, xyz) over the upper hemisphere x2+y2+z2=4x^2 + y^2 + z^2 = 4, z≥0z \ge 0, with upward normal. The curl is ∇×F=(xz, 1−yz, 2)\nabla\times\mathbf F = (xz,\ 1 - yz,\ 2), and the boundary of the hemisphere is the circle x2+y2=4x^2 + y^2 = 4 in the plane z=0z = 0 — also the boundary of the flat disk.

On the disk, z=0z = 0 and the upward normal is k\mathbf k, so (∇×F)⋅k=2(\nabla\times\mathbf F)\cdot\mathbf k = 2 and the flux is 2⋅4π=8π2\cdot4\pi = 8\pi. The hemisphere carries the same 8π8\pi. Directly around the circle, r=(2cos⁡t,2sin⁡t,0)\mathbf r = (2\cos t, 2\sin t, 0), F=(−2sin⁡t,2cos⁡t,0)\mathbf F = (-2\sin t, 2\cos t, 0) and F⋅r′=4sin⁡2t+4cos⁡2t=4\mathbf F\cdot\mathbf r' = 4\sin^2t + 4\cos^2t = 4, so the circulation is 8π8\pi, as Stokes' theorem requires.

Example
Example: a point source

Let F=r∣r∣3\mathbf F = \dfrac{\mathbf r}{|\mathbf r|^3}, the field of a point charge at the origin. Away from the origin ∇⋅F=0\nabla\cdot\mathbf F = 0, yet on the sphere of radius aa, F⋅n=1a2\mathbf F\cdot\mathbf n = \tfrac{1}{a^2} and the area is 4πa24\pi a^2, so the outward flux is 4π4\pi — not 00.

There is no contradiction: the divergence theorem does not apply to the ball, because F\mathbf F is undefined at its centre. Applied to the region between two spheres around the origin, where F\mathbf F is smooth, it says the outward flux through the outer sphere minus that through the inner one is 00. So every sphere around the origin carries the same flux 4π4\pi — Gauss's law for a point charge.

Side note
Where it goes wrong

Applying the divergence theorem to a surface that is not closed. For F=(0,0,1)\mathbf F = (0, 0, 1) through the upper unit hemisphere, ∇⋅F=0\nabla\cdot\mathbf F = 0 tempts the answer 00. But the upward flux is π\pi: the field is vertical, so the flux equals the area of the hemisphere's shadow, the unit disk. The theorem applies to the closed surface hemisphere plus base; the base, whose outward normal points down, carries −π-\pi, and π+(−π)=0\pi + (-\pi) = 0.

Try it
Try it: flux out of a cube

Find the outward flux of F=(xy,yz,zx)\mathbf F = (xy, yz, zx) through the surface of the cube [0,2]3[0, 2]^3.

Show the answer

The divergence is ∂x(xy)+∂y(yz)+∂z(zx)=y+z+x\partial_x(xy) + \partial_y(yz) + \partial_z(zx) = y + z + x. By symmetry the three terms contribute equally, and ∭x dV=(∫02x dx)⋅2⋅2=2⋅4=8\iiint x\,dV = \left(\int_0^2 x\,dx\right)\cdot2\cdot2 = 2\cdot4 = 8. So the flux is 3⋅8=243\cdot8 = 24 — one volume integral instead of six face integrals.

Proofs & Why It Matters

Tip
Proof sketch: the divergence theorem on a box

On a box, split the flux into three pairs of opposite faces. For the zz-pair: ∬[R(x,y,ztop)−R(x,y,zbot)]dA=∬ ⁣ ⁣∫∂zR dz dA\iint\left[R(x, y, z_{\text{top}}) - R(x, y, z_{\text{bot}})\right]dA = \iint\!\!\int \partial_z R\,dz\,dA by the one-variable fundamental theorem — the flux difference across the pair equals the integral of ∂R/∂z\partial R/\partial z through the inside. Adding the three pairs assembles ∭(∂xP+∂yQ+∂zR) dV\iiint(\partial_xP + \partial_yQ + \partial_zR)\,dV. A general solid is tiled by small boxes: fluxes across interior walls cancel in pairs (shared walls, opposite normals), leaving the outer boundary. ■\blacksquare SIGNIFICANCE: "interior contributions cancel, only the boundary survives" is the single deepest pattern in integration — it is why conservation laws exist in physics.

Side note
The grand unification

Line up the family: FTC (∫abf′=f(b)−f(a)\int_a^b f' = f(b) - f(a)), FTL for gradients, Green, Stokes, divergence. Each says: derivative integrated over the inside == function summed over the boundary. In advanced mathematics all five become ONE statement about differential forms (∫Ωdω=∫∂Ωω\int_\Omega d\omega = \int_{\partial\Omega}\omega, the generalized Stokes theorem) — this course has been climbing the rungs of a single ladder the whole time.

Reminder — The Fundamental Theorem of Calculus:  ∫abf(x) dx=F(b)−F(a)where F′=f\int_a^b f(x)\,dx = F(b)-F(a) \quad\text{where } F'=f

Going Deeper: Worked Problems

Example
Worked: flux through a closed box with the divergence theorem

Find the outward flux of F=(x2,y,z)\mathbf F = (x^2, y, z) through the surface of the box [0,2]×[0,1]×[0,3][0,2]\times[0,1]\times[0,3].

Step 1 — divergence: ∇⋅F=2x+1+1=2x+2\nabla\cdot\mathbf F = 2x + 1 + 1 = 2x + 2.

Step 2 — integrate over the box: ∫03 ⁣∫01 ⁣∫02(2x+2) dx dy dz\displaystyle\int_0^3\!\int_0^1\!\int_0^2 (2x + 2)\,dx\,dy\,dz. The inner integral is [x2+2x]02=8\left[x^2 + 2x\right]_0^2 = 8.

Step 3 — the outer two multiply by the remaining side lengths: 8⋅1⋅3=248\cdot1\cdot3 = 24.

Step 4 — direct check of one face pair: on x=2x = 2 the flux is ∬4 dA=4⋅3=12\iint 4\,dA = 4\cdot3 = 12 outward, on x=0x = 0 it is 00; the yy-faces contribute 1⋅(2⋅3)=61\cdot(2\cdot3) = 6 net and the zz-faces 3⋅2−0=63\cdot2 - 0 = 6: total 12+6+6=2412 + 6 + 6 = 24 ✓. Six face integrals or one volume integral — the theorem lets you choose.

Example
Worked: Stokes' theorem picking the easy surface

Compute ∮CF⋅dr\displaystyle\oint_C \mathbf F\cdot d\mathbf r for F=(−y,x,z2)\mathbf F = (-y, x, z^2) around the circle x2+y2=4x^2 + y^2 = 4 in the plane z=1z = 1, counterclockwise from above.

Step 1 — curl: ∇×F=(∂y(z2)−∂z(x),  ∂z(−y)−∂x(z2),  ∂x(x)−∂y(−y))=(0,0,2)\nabla\times\mathbf F = \left(\partial_y(z^2) - \partial_z(x),\; \partial_z(-y) - \partial_x(z^2),\; \partial_x(x) - \partial_y(-y)\right) = (0, 0, 2).

Step 2 — cap the circle with the flat disk z=1z = 1, upward normal (0,0,1)(0,0,1): the flux of the curl is ∬2 dA=2⋅π⋅4=8π\iint 2\,dA = 2\cdot\pi\cdot4 = 8\pi.

Step 3 — by Stokes, the circulation is 8π8\pi.

Step 4 — verify directly: parametrize r=(2cos⁡t,2sin⁡t,1)\mathbf r = (2\cos t, 2\sin t, 1); then F⋅r′=(−2sin⁡t)(−2sin⁡t)+(2cos⁡t)(2cos⁡t)+1⋅0=4\mathbf F\cdot\mathbf r' = (-2\sin t)(-2\sin t) + (2\cos t)(2\cos t) + 1\cdot0 = 4, and ∫02π4 dt=8π\int_0^{2\pi}4\,dt = 8\pi ✓. The z2z^2 component never mattered — its curl contribution was zero, and Stokes said so before any parametrizing.