Differentiation and integration of vector fields: divergence, curl, and the integral theorems relating them.
IntuitionFields that swirl and spread: intuition for divergence and curl
Picture the velocity of flowing water at every point in space: this is a vector fieldF(x,y,z), an arrow attached to each point that tells you the direction and speed of the flow there. Two simple questions about F turn out to control almost everything in electromagnetism and fluid dynamics: does the flow spread outward from a point like water gushing from a source, or does it swirl around an axis like a whirlpool? The first tendency is measured by the divergence∇⋅F, a scalar telling you the net rate at which flow is created (positive) or destroyed (negative) at each point; the second is measured by the curl∇×F, a vector pointing along the local axis of rotation, whose length is the rate of spin.
Interactive 3D plot of a saddle-shaped scalar potential surface, used to illustrate a gradient vector field with zero divergence and zero curl.
A saddle-shaped potential φ(x,y)=x2−y2: its gradient field F=∇φ=(2x,−2y) has divergence 0 and curl 0 everywhere, a special "harmonic" case where the flow neither spreads nor swirls, only redirects along the saddle's slopes.
UndergraduateFormal definitions: divergence, curl, and the boundary integral theorems
Definition: Divergence of a vector field
For a differentiable vector field F=(F1,F2,F3) on R3, the divergence ∇⋅F is the scalar function measuring the net outward flux per unit volume at each point: intuitively, divF(p)>0 means an infinitesimal ball around p is a net source of flow, while divF(p)<0 means it is a net sink.
∇⋅F=∂x∂F1+∂y∂F2+∂z∂F3
The curl ∇×F measures rotation instead: if you dip a tiny paddle wheel into the flow at a point and orient its axis along ∇×F(p), the wheel spins the fastest, with angular speed proportional to ∣∇×F(p)∣. A field with ∇×F=0 everywhere is called irrotational (or conservative, if also defined on a simply connected region), and it is exactly the fields that arise as a gradient F=∇φ of some scalar potential φ.
Let D⊂R2 be a region with positively oriented, piecewise-smooth boundary curve ∂D, and let P(x,y) and Q(x,y) have continuous partial derivatives on an open region containing D. Then ∮∂D(Pdx+Qdy)=∬D(∂x∂Q−∂y∂P)dA.
Why is it true?
The right side sums the local 'circulation density' ∂x∂Q−∂y∂P (the 2D curl) over every point of D; the interior circulations of adjacent tiny cells cancel along their shared edges, leaving only the circulation along the outer boundary ∂D.
Proof
First prove it for a rectangle R=[a,b]×[c,d] with D=R. By Fubini's theorem, ∬R∂x∂QdA=∫cd(Q(b,y)−Q(a,y))dy and ∬R∂y∂PdA=∫ab(P(x,d)−P(x,c))dx.
These are exactly the line integrals of Qdy along the right and left edges of R and of Pdx along the top and bottom edges, so ∬R(∂x∂Q−∂y∂P)dA=∮∂R(Pdx+Qdy), matching the theorem for a rectangle.
For a general region D, approximate it by a fine grid of small rectangles covering D. Apply the rectangle case to each small piece and sum over all pieces. Every interior edge shared by two adjacent pieces is traversed once in each direction by the two pieces' boundaries, so the two line integral contributions along that shared edge cancel exactly.
What remains after cancellation is precisely the line integral around the outer boundary ∂D, while the sum of the double integrals over the small rectangles converges to ∬D(∂x∂Q−∂y∂P)dA as the grid is refined, proving the identity for D.
Let V⊂R3 be a solid region with outward-oriented, piecewise-smooth boundary surface ∂V, and let F have continuous partial derivatives on an open region containing V. Then ∬∂VF⋅dS=∭V(∇⋅F)dV.
Why is it true?
Just as in Green's theorem, the volume integral of divergence sums up the local 'net outflow per unit volume' over every tiny box inside V; the outflow across faces shared by adjacent boxes cancels, leaving only the flux across the outer boundary ∂V.
Proof
First prove it for a rectangular box B=[a1,b1]×[a2,b2]×[a3,b3] with V=B, where F=(F1,F2,F3). By Fubini's theorem, ∭B∂x∂F1dV=∬(F1(b1,y,z)−F1(a1,y,z))dydz, and analogous identities hold for the y- and z-derivative terms.
Each right-hand side is exactly the outward flux of the corresponding component of F through a pair of opposite faces of B, with the outward normal pointing along the positive or negative coordinate direction on each face. Summing the three coordinate contributions gives ∭B(∇⋅F)dV=∬∂BF⋅dS.
For a general solid region V, approximate it by a fine grid of small rectangular boxes filling V. Apply the box case to each box and sum over all boxes. Every interior face shared by two adjacent boxes has outward normals pointing in opposite directions on the two sides, so the corresponding flux contributions across that shared face cancel exactly.
The remaining, uncancelled flux is precisely through the outer boundary surface ∂V, while the sum of volume integrals over the small boxes converges to ∭V(∇⋅F)dV as the grid is refined, establishing the identity for V.
UndergraduateReal-World Applications and Worked Examples
Divergence, curl, and the boundary integral theorems are the mathematical backbone of classical field theory: Maxwell's equations of electromagnetism are stated entirely in terms of ∇⋅E, ∇⋅B, ∇×E, and ∇×B; fluid dynamics uses the Divergence theorem to derive the continuity equation for mass conservation and identifies incompressible flow with ∇⋅F=0; and aerospace engineering applies Stokes' theorem to relate the circulation of airflow around an airfoil (lift) to the vorticity ∇×F inside the boundary layer.
Example: Verifying the Divergence theorem for a radial field on a sphere
Let F(x,y,z)=(x,y,z) and let S be the sphere x2+y2+z2=a2 of radius a, oriented outward, enclosing the ball V. Verify the Divergence theorem ∬SF⋅dS=∭V(∇⋅F)dV by computing both sides directly.
Solution
Compute the right-hand side first: ∇⋅F=∂x∂x+∂y∂y+∂z∂z=1+1+1=3, a constant. So ∭V(∇⋅F)dV=3⋅vol(V)=3⋅34πa3=4πa3.
Now compute the left-hand side directly. On the sphere S, the outward unit normal is n=a1(x,y,z), since the position vector itself points radially outward and has length a on S. So F⋅n=a1(x2+y2+z2)=aa2=a.
Since F⋅n=a is constant over S, the flux integral is simply this constant times the surface area: ∬SF⋅dS=a⋅area(S)=a⋅4πa2=4πa3, matching the volume integral exactly.
Example: Computing area with Green's theorem
Let C be the unit circle x2+y2=1 traversed counterclockwise. Use Green's theorem with P=−y, Q=x to verify the area formula area(D)=21∮C(xdy−ydx) for the unit disk D.
Solution
With P=−y and Q=x, Green's theorem gives ∮C(−ydx+xdy)=∬D(∂x∂x−∂y∂(−y))dA=∬D(1−(−1))dA=2∬DdA=2area(D).
Compute the line integral directly by parametrizing C as x=cosθ, y=sinθ for θ∈[0,2π], so dx=−sinθdθ and dy=cosθdθ: ∮C(−ydx+xdy)=∫02π(sin2θ+cos2θ)dθ=∫02π1dθ=2π.
Since area(D)=π for the unit disk, the double-integral side gives 2area(D)=2π, which matches the directly computed line integral 2π exactly, confirming Green's theorem and the area formula area(D)=21∮C(xdy−ydx).
Compute the divergence ∇⋅F of F(x,y,z)=(x2,y2,z2) at the point (1,1,1).
Compute the curl ∇×F of the rotational field F(x,y,z)=(y,−x,0).
At a point where ∇⋅F>0 for a fluid's velocity field F, what is happening physically?
Which theorem relates a surface integral of ∇×F over an open surface S to a line integral around its boundary curve ∂S?
References
Jerrold E. Marsden, Anthony J. Tromba (2012). Vector Calculus