30. Stokes' theorem
Green's theorem converted a circulation integral around a flat boundary into a double integral over the flat region it enclosed. Stokes' theorem performs the identical conversion for a curved surface hanging in three-dimensional space — its boundary curve doesn't need to lie flat at all, and the "local rotation" being summed is now §12.5's full three-dimensional curl.
The theorem
Let S be an oriented, piecewise-smooth surface with boundary curve C, oriented consistently with S (by the right-hand rule: if the fingers of your right hand curl in the direction C is traversed, your thumb points along S's chosen normal). Then \oint_C\vec F\cdot d\vec r=\iint_S(\text{curl}\,\vec F)\cdot d\vec S
Circulation around the boundary equals the flux of curl through the surface. Where Green's theorem summed the scalar curl Q_x-P_y over a flat interior, Stokes' theorem sums the full vector curl's flux over a curved interior — using exactly §12.7's flux construction.
Green's theorem as the flat special case
If S is a flat region D sitting in the xy-plane, its normal is the constant vector \vec k=\langle0,0,1\rangle, and for \vec F=\langle P,Q,0\rangle (a field confined to the plane, as in every earlier Green's theorem example), §12.5 showed \text{curl}\,\vec F=\langle0,0,Q_x-P_y\rangle. So:
(\text{curl}\,\vec F)\cdot d\vec S=(\text{curl}\,\vec F)\cdot\vec k\,dA=(Q_x-P_y)\,dA
\iint_S(\text{curl}\,\vec F)\cdot d\vec S=\iint_D(Q_x-P_y)\,dA
— exactly Green's theorem's right-hand side. Stokes' theorem is Green's theorem, generalized from a flat region to a curved surface, in the literal sense that setting the surface flat and the field planar recovers Green's original statement precisely.
Why the choice of surface never matters
A striking consequence: for a fixed boundary curve C, any surface S that has C as its boundary gives the same flux of curl — a hemisphere capping a circle, a flat disk filling the same circle, or a wildly bent surface with the identical rim, all produce the identical value of \iint_S(\text{curl}\,\vec F)\cdot d\vec S, because all three equal the same circulation integral \oint_C\vec F\cdot d\vec r, which depends only on the boundary curve, never on which surface was chosen to span it. This makes Stokes' theorem a genuine computational tool: given a choice, always pick whichever spanning surface makes the flux integral easiest.
Reconfirming §12.5's conservative-field connection
If \text{curl}\,\vec F=\vec0 everywhere on a simply connected domain, Stokes' theorem immediately gives $\oint_C\vec F\cdot d\vec r=\iint_S\vec 0\cdot d\vec S=0$ for every closed curve C (choosing any surface it bounds) — directly confirming §12.5's claim that irrotational fields have zero circulation around every loop, now derived as a genuine consequence of Stokes' theorem rather than stated as a parallel fact.
Doing it in Python
Verifying Stokes' theorem for the rotational field \vec F(x,y,z)=\langle-y,x,0\rangle, using the upper unit hemisphere as the spanning surface for the unit circle boundary:
import sympy as sp
x, y, z, phi, theta, t = sp.symbols('x y z phi theta t')
# curl of F, computed as in section 12.5
P, Q, R = -y, x, 0
curl_F = sp.Matrix([
sp.diff(R, y) - sp.diff(Q, z),
sp.diff(P, z) - sp.diff(R, x),
sp.diff(Q, x) - sp.diff(P, y)
])
print(f"curl F = {curl_F.T}")
# flux of curl F through the upper unit hemisphere
r = sp.Matrix([sp.sin(phi)*sp.cos(theta), sp.sin(phi)*sp.sin(theta), sp.cos(phi)])
r_phi, r_theta = r.diff(phi), r.diff(theta)
normal = r_phi.cross(r_theta)
flux = sp.integrate(sp.integrate(curl_F.dot(normal), (phi, 0, sp.pi/2)), (theta, 0, 2*sp.pi))
print(f"flux of curl F through the hemisphere = {sp.simplify(flux)}")
# circulation around the boundary (the unit circle), computed directly as in section 12.2/12.4
xc, yc = sp.cos(t), sp.sin(t)
r_prime = sp.Matrix([sp.diff(xc, t), sp.diff(yc, t)])
F_on_circle = sp.Matrix([P, Q]).subs({x: xc, y: yc})
circulation = sp.integrate(F_on_circle.dot(r_prime), (t, 0, 2*sp.pi))
print(f"circulation around the boundary circle = {circulation}")
print(f"match: {sp.simplify(flux) == circulation}")
Confirming surface-independence: the flux of the same curl through a flat disk (instead of the hemisphere) gives the identical answer:
import sympy as sp
r_, th = sp.symbols('r_ th', positive=True)
x, y = sp.symbols('x y')
curl_F_z = 2 # only the z-component is nonzero, from section 12.5's computation
flux_disk = sp.integrate(sp.integrate(curl_F_z * r_, (r_, 0, 1)), (th, 0, 2*sp.pi))
print(f"flux through the flat disk = {flux_disk}")
print("same boundary circle, same flux -- Stokes' theorem doesn't care which surface spans it")
Worked example
Verify Stokes' theorem for \vec F(x,y,z)=\langle-y,x,0\rangle, using the upper unit hemisphere S (boundary: the unit circle in the xy-plane).
Curl (already computed in §12.5): \text{curl}\,\vec F=\langle0,0,2\rangle.
Flux through the hemisphere: using §12.6/§12.7's spherical parametrization restricted to \varphi\in\left[0,\frac\pi2\right], the normal's z-component works out (after the same algebra as §12.7's worked example, with R=1) to \sin\varphi\cos\varphi=\frac12\sin(2\varphi):
\iint_S(\text{curl}\,\vec F)\cdot d\vec S=\int_0^{2\pi}\int_0^{\pi/2}2\cdot\sin\varphi\cos\varphi\,d\varphi\,d\theta=\int_0^{2\pi}\int_0^{\pi/2}\sin(2\varphi)\,d\varphi\,d\theta
=\int_0^{2\pi}\left[-\frac{\cos(2\varphi)}2\right]_0^{\pi/2}d\theta=\int_0^{2\pi}\left(\frac12+\frac12\right)d\theta=\int_0^{2\pi}1\,d\theta=\boxed{2\pi}
Circulation around the boundary: from §12.2's own worked computation of this exact field around the unit circle: \boxed{2\pi}.
Sanity check. Both sides equal 2\pi — direct confirmation. And this is the same 2\pi found via Green's theorem in §12.4, using a flat disk instead of a curved hemisphere as the spanning surface — precisely the surface-independence property highlighted above, now checked against two genuinely different surfaces sharing the same rim. ✓
Your turn
1. Using Stokes' theorem's surface-independence property, explain (without recomputing any integral) why the flux of \text{curl}\langle-y,x,0\rangle=\langle0,0,2\rangle through any surface spanning the unit circle must equal 2\pi.
2. Find \text{curl}\,\vec F for $\vec F(x,y,z)=\langle yz,xz,xy\rangle$ (from §12.5, this field is irrotational), and use Stokes' theorem to determine the circulation of \vec F around any closed curve.
3. True or false: Stokes' theorem requires the surface S to be flat.
Solutions
1. Stokes' theorem says \iint_S(\text{curl}\,\vec F)\cdot d\vec S depends only on S's boundary curve, never on the specific shape of S chosen to span it — a direct consequence of both surfaces' flux integrals equaling the same circulation integral $\oint_C\vec F\cdot d\vec r$ around the shared boundary C. Since the unit circle is the boundary in both this problem and the worked example (hemisphere) and §12.4 (flat disk), all three flux computations are forced to agree, regardless of how differently curved the three surfaces are.
2. From §12.5, \text{curl}\langle yz,xz,xy\rangle=\langle0,0,0\rangle=\vec0.
\oint_C\vec F\cdot d\vec r=\iint_S\vec0\cdot d\vec S=\boxed0
for any closed curve C (choosing any surface it bounds) — circulation is always zero for this field, directly confirming §12.3's "conservative fields have zero circulation" via Stokes' theorem rather than the Fundamental Theorem of Line Integrals.
3. False. Stokes' theorem is stated for a general (curved, piecewise-smooth) oriented surface — the entire value of the theorem is that it applies to hemispheres, saddle-shaped patches, or any other curved surface, not merely flat ones. Green's theorem is the special case where the surface happens to be flat; Stokes' theorem is the general statement that doesn't require flatness at all.
Check yourself in code
Verify Stokes' theorem for \vec F(x,y,z)=\langle-y,x,0\rangle using the upper unit hemisphere: compute the flux of curl \vec F through the hemisphere and the circulation around its boundary circle.
Print exactly this:
curl F = [0, 0, 2]
flux through hemisphere = 2*pi
circulation around boundary = 2*pi
import sympy as sp
x, y, z, phi, theta, t = sp.symbols('x y z phi theta t')
P, Q, R = -y, x, 0
curl_F = sp.Matrix([
sp.diff(R, y) - sp.diff(Q, z),
sp.diff(P, z) - sp.diff(R, x),
sp.diff(Q, x) - sp.diff(P, y)
])
print("curl F = ...")
r = sp.Matrix([sp.sin(phi)*sp.cos(theta), sp.sin(phi)*sp.sin(theta), sp.cos(phi)])
r_phi, r_theta = r.diff(phi), r.diff(theta)
normal = r_phi.cross(r_theta)
flux = sp.integrate(sp.integrate(curl_F.dot(normal), (phi, 0, sp.pi/2)), (theta, 0, 2*sp.pi))
print("flux through hemisphere = ...")
xc, yc = sp.cos(t), sp.sin(t)
r_prime = sp.Matrix([sp.diff(xc, t), sp.diff(yc, t)])
F_on_circle = sp.Matrix([P, Q]).subs({x: xc, y: yc})
circulation = sp.integrate(F_on_circle.dot(r_prime), (t, 0, 2*sp.pi))
print("circulation around boundary = ...")
import sympy as sp
x, y, z, phi, theta, t = sp.symbols('x y z phi theta t')
P, Q, R = -y, x, 0
curl_F = sp.Matrix([
sp.diff(R, y) - sp.diff(Q, z),
sp.diff(P, z) - sp.diff(R, x),
sp.diff(Q, x) - sp.diff(P, y)
])
print(f"curl F = {list(curl_F)}")
r = sp.Matrix([sp.sin(phi)*sp.cos(theta), sp.sin(phi)*sp.sin(theta), sp.cos(phi)])
r_phi, r_theta = r.diff(phi), r.diff(theta)
normal = r_phi.cross(r_theta)
flux = sp.integrate(sp.integrate(curl_F.dot(normal), (phi, 0, sp.pi/2)), (theta, 0, 2*sp.pi))
print(f"flux through hemisphere = {sp.simplify(flux)}")
xc, yc = sp.cos(t), sp.sin(t)
r_prime = sp.Matrix([sp.diff(xc, t), sp.diff(yc, t)])
F_on_circle = sp.Matrix([P, Q]).subs({x: xc, y: yc})
circulation = sp.integrate(F_on_circle.dot(r_prime), (t, 0, 2*sp.pi))
print(f"circulation around boundary = {circulation}")
Stokes' theorem, $\oint_C\vec F\cdot d\vec r=\iint_S(\text{curl}\,\vec F)\cdot d\vec S$, extends Green's theorem from a flat boundary and region to any curved surface and its boundary curve, recovering Green's original statement exactly when the surface is chosen flat. Its most striking consequence is surface-independence: the flux of curl through any surface spanning a fixed boundary curve gives the identical answer, since every such surface computes the same underlying circulation — turning a potentially hard flux computation into a choice of whichever spanning surface is most convenient.
Next: the divergence theorem — Stokes' theorem's sibling, relating flux through a closed surface to a triple integral of divergence throughout the solid it encloses.