Survey of Mathematics

6.6 Curl, divergence, Stokes' theorem and Gauss's theorem

Curl measures how much a field spins and divergence how much it spreads; Stokes' theorem says the circulation around the edge of a surface is the flux of the curl through it, the divergence theorem says the flux out of a closed surface is the integral of the divergence inside, and both are the fundamental theorem of calculus one dimension up.

Taught in 375/376Apostol, not taughtBeyond the courseApostol Vol. 2, 12.11 to 12.20 (12.11 Stokes, 12.12 curl and divergence, 12.14 further properties, 12.16 reconstruction from the curl, 12.19 divergence theorem, 12.20 applications)MATH 376 Week 7: lectures of 2, 4 and 6 March, worksheets 13, 14, 17, 27 and 28, homework 5 problems 4 and 5, homework 6, Midterm 2 problems 3 and 4, Final problems 2 and 3, practice Midterm 2 problems 3 and 4, practice Final problems 7(c) and 7(d)Smith's Prize examination, Cambridge, 1854Ostrogradsky, Demonstration d'un theoreme du calcul integral (1826)

In 6.1 the fundamental theorem of calculus became a statement about a curve: the integral of ∇f\nabla f along a path is the change of ff between its ends. Green’s theorem (6.4) was the next step: the circulation around a loop is the spin inside it. This chapter takes both steps into space. A loop that is the edge of a curved surface, and a closed surface that is the skin of a solid, each get a theorem. The first is Stokes’ theorem and the second is the divergence theorem, also called Gauss’s theorem. They are what Maxwell’s equations are written with (6.8), and they are the end of Unit 6 in MATH 376.

Before you start

6.4: Green’s theorem. 6.5: flux, and n dS=(ru×rv) du dvn\,dS = (r_u\times r_v)\,du\,dv with a sign check. 5.5: mixed partials of a C2C^2 function are equal. 6.2: the line integral of a gradient around a closed path is 00.

Quick checkGreen's theorem for a positively oriented Jordan curve CC bounding RR says ∮CP dx+Q dy\oint_C P\,dx + Q\,dy equals which integral over RR?
Quick checkIn a flux integral through a surface parametrized by r(u,v)r(u, v), which expression stands for n dSn\,dS when ru×rvr_u\times r_v points the way nn does?
Quick checkFor a C2C^2 function ff, what is ∂y(fz)−∂z(fy)\partial_y(f_z) - \partial_z(f_y)?

The picture: a wheel in the flow, and a skin round a solid

Start with the rotation field and press Play: the wheel turns at the rate the curl predicts. Switch to the shear field (y,0,0)(y, 0, 0). Every arrow points the same way and nothing circles the origin, but the wheel turns, because the flow is faster at the top of the wheel than at the bottom. Then choose the vortex: the flow circles the origin and the wheel does not turn. So curl does not mean ‘the field goes round something’. It means ‘a small wheel at this point would spin’. Last, choose the layers field and tilt the axis: the spin is the dot product of the curl with the axis.

The torus with F=(x,y,z)F = (x, y, z): the arrows leave the whole surface and the flux is 6π2Ra26\pi^2Ra^2, which is three times the volume of the solid. That is the divergence theorem for this field, because div⁡F=3\operatorname{div}F = 3.

The idea, in words

Look at a tiny cube in a flowing fluid. Count what leaves through the six faces minus what enters through the opposite faces. On the faces perpendicular to the xx axis the net outflow is (P(x+Δx)−P(x))Δy Δz≈Px Δx Δy Δz\big(P(x + \Delta x) - P(x)\big)\Delta y\,\Delta z\approx P_x\,\Delta x\,\Delta y\,\Delta z. Do the same for the other two directions and the net outflow per unit volume is Px+Qy+RzP_x + Q_y + R_z, the divergence. Now take a tiny circle in a plane and add up the part of the field along it. On a small square in the xyxy-plane the circulation is (Q(x+Δx)−Q(x))Δy−(P(y+Δy)−P(y))Δx≈(Qx−Py) Δx Δy\big(Q(x + \Delta x) - Q(x)\big)\Delta y - \big(P(y + \Delta y) - P(y)\big)\Delta x\approx(Q_x - P_y)\,\Delta x\,\Delta y, the curl in the zz direction. Big surfaces and big solids are built from tiny squares and cubes. On each piece the circulation (or the flux) equals the local density times the size. When you add the pieces, the edges (or faces) inside cancel in pairs, and only the outer boundary survives. That is the entire content of both theorems.

Why· Why the inner edges cancel

Two neighbouring squares share an edge. One walks it left to right, the other right to left, so the line integrals along that edge are negatives of each other. Two neighbouring cubes share a face. One has the outward normal pointing into the other, so the flux through the shared face counts ++ for one cube and −- for the other. Everything that is not on the outer boundary cancels. This is the same cancellation as in the telescoping sum (f(x1)−f(x0))+(f(x2)−f(x1))+⋯=f(xn)−f(x0)(f(x_1) - f(x_0)) + (f(x_2) - f(x_1)) + \dots = f(x_n) - f(x_0), which is why these theorems are the fundamental theorem of calculus in higher dimensions.

Where this came from· Stokes' theorem: a letter, an exam question, a footnote

In a letter of July 1850 William Thomson, later Lord Kelvin, told George Stokes about the relation between the line integral around a loop and the surface integral over a surface it bounds. Stokes put it as question 8 in the Smith’s Prize examination at Cambridge in February 1854, a competitive examination for the best mathematics students of the university. James Clerk Maxwell sat that examination and was placed joint first. When Maxwell printed the theorem in his Treatise on Electricity and Magnetism (1873) he added a footnote saying that Stokes had used it as that examination question, and that footnote is the usual explanation of why it carries Stokes’ name, although the idea came to Stokes from Thomson. Neither Thomson nor Stokes published a proof; the first published proof is attributed to Hermann Hankel in 1861, in a work on the general theory of fluid motion. What the theorem says is what 6.8 uses it for: the circulation of a field around a loop equals the flux of its curl through any surface the loop bounds.

Where this came from· The divergence theorem: Lagrange, Gauss, Ostrogradsky

Lagrange had a special case in 1762, in his work on fluid mechanics. Around 1813 Gauss met surface integrals while studying the attraction of an ellipsoid, and proved special cases of the theorem, adding more in 1833 and 1839. The first proof of the general theorem is usually credited to the Russian mathematician Mikhail Ostrogradsky, who presented it to the Paris Academy of Sciences in 1826 as part of his work on the flow of heat (it was printed a few years later). Green found the planar analogue in 1828. Today it is called the divergence theorem, or the Gauss theorem, or the Gauss and Ostrogradsky theorem, depending on the book. The shape of the problem is the one in the heat chapter 6.8: how much heat leaves a body is the total of the heat produced inside it.

Curl and divergence

Name the components of a vector field F=(P,Q,R)F = (P, Q, R), not Fx,Fy,FzF_x, F_y, F_z: the subscript xx looks like a partial derivative and invites errors. Write PyP_y for ∂P/∂y\partial P/\partial y and so on. The symbol ∇=(∂x,∂y,∂z)\nabla = (\partial_x, \partial_y, \partial_z) is a vector whose entries are derivative operators; it has no meaning alone, but it combines with FF the way a vector would.

Definition T

Curl

The curl of a differentiable vector field F=(P,Q,R)F = (P, Q, R) is the vector field

curl⁡F=∇×F=det⁡[e1e2e3∂x∂y∂zPQR]=(Ry−Qz,  Pz−Rx,  Qx−Py).\operatorname{curl}F = \nabla\times F = \det\begin{bmatrix}e_1 & e_2 & e_3\\ \partial_x & \partial_y & \partial_z\\ P & Q & R\end{bmatrix} = (R_y - Q_z,\ \ P_z - R_x,\ \ Q_x - P_y).

It is the cross product formula of 6.5 with ∂x,∂y,∂z\partial_x, \partial_y, \partial_z in the place of a1,a2,a3a_1, a_2, a_3 and P,Q,RP, Q, R in the place of b1,b2,b3b_1, b_2, b_3. So the middle component has the flipped sign: Pz−RxP_z - R_x, not Rx−PzR_x - P_z. The third component Qx−PyQ_x - P_y is the integrand of Green’s theorem.

In one lineFor F=(P,Q,R)F = (P, Q, R), curl⁡F=∇×F=(Ry−Qz, Pz−Rx, Qx−Py)\operatorname{curl}F = \nabla\times F = (R_y - Q_z,\ P_z - R_x,\ Q_x - P_y): a vector field that records how much, and about which axis, FF spins at each point.

Why it existsIt is the spin density of the field: the circulation per unit area around a tiny loop, so it is what Stokes' theorem integrates.

Definition T

Divergence

The divergence of F=(P,Q,R)F = (P, Q, R) is the scalar field div⁡F=∇⋅F=∂P∂x+∂Q∂y+∂R∂z\operatorname{div}F = \nabla\cdot F = \dfrac{\partial P}{\partial x} + \dfrac{\partial Q}{\partial y} + \dfrac{\partial R}{\partial z}. It is positive where the field spreads out (a source) and negative where it gathers (a sink).

In one lineFor F=(P,Q,R)F = (P, Q, R), div⁡F=∇⋅F=Px+Qy+Rz\operatorname{div}F = \nabla\cdot F = P_x + Q_y + R_z: a scalar field that records how much FF spreads out from each point.

Why it existsIt is the net outflow per unit volume, so it is what the divergence theorem integrates.

Definition T

Vorticity

For a velocity field of a fluid the curl is called the vorticity. A rigid rotation with angular velocity ω\omega has vorticity 2ω2\omega.

In one lineThe vorticity of a velocity field vv is curl⁡v\operatorname{curl}v.

Why it existsIt is the name fluid dynamics gives to the curl, and it is zero exactly when the flow has no local spin.

Definition T

Irrotational field

A field with curl⁡F=0\operatorname{curl}F = 0 everywhere is irrotational. By the identity below every gradient field is irrotational; on a simply connected domain such as all of R3\mathbb R^3 every irrotational field is a gradient (Apostol, label A), and then the fluid flow is called a potential flow.

In one lineA field with curl 00 everywhere on its domain. A flow with this property is called a potential flow.

Why it existsOn a simply connected domain these are exactly the gradient fields, so the name tells you a potential exists.

Definition T

Solenoidal field

A field with div⁡F=0\operatorname{div}F = 0 everywhere is solenoidal (or divergence-free). A fluid whose velocity field is solenoidal is incompressible, and the magnetic field BB is solenoidal (6.8).

In one lineA field with divergence 00 everywhere on its domain; a flow with this property is incompressible.

Why it existsIt means no net source or sink anywhere: whatever flows into a region flows out, the property of an incompressible fluid and of the magnetic field.

Definition A

Laplacian

The Laplacian of a C2C^2 scalar field ff is ∇2f=div⁡(∇f)=fxx+fyy+fzz\nabla^2f = \operatorname{div}(\nabla f) = f_{xx} + f_{yy} + f_{zz}. A function with ∇2f=0\nabla^2f = 0 is called harmonic.

In one lineFor a scalar field ff the Laplacian is ∇2f=div⁡∇f=fxx+fyy+fzz\nabla^2 f = \operatorname{div}\nabla f = f_{xx} + f_{yy} + f_{zz}.

Why it existsIt is the divergence of the gradient, and the operator in the heat equation and in Poisson's equation (6.8).

Worked example MATH 376 worksheet 13 problems 1, 2 and 7
Compute the divergence of F=(exsin⁡y, excos⁡y, z2)F = (e^x\sin y,\ e^x\cos y,\ z^2), and the curl of F=(x2,y2,z2)F = (x^2, y^2, z^2) and of F=(−y,x,z)F = (-y, x, z).

Solution.

  1. Name the components of the first field. P=exsin⁡yP = e^x\sin y, Q=excos⁡yQ = e^x\cos y, R=z2R = z^2. Names first, then derivatives; FxF_x would clash with a partial derivative.
  2. Differentiate. Px=exsin⁡yP_x = e^x\sin y, Qy=−exsin⁡yQ_y = -e^x\sin y, Rz=2zR_z = 2z. The derivative of cos⁡y\cos y in yy is −sin⁡y-\sin y.
  3. Add. div⁡F=exsin⁡y−exsin⁡y+2z=2z\operatorname{div}F = e^x\sin y - e^x\sin y + 2z = 2z.
  4. Curl of (x2,y2,z2)(x^2, y^2, z^2). Ry−Qz=0−0R_y - Q_z = 0 - 0, Pz−Rx=0−0P_z - R_x = 0 - 0, Qx−Py=0−0Q_x - P_y = 0 - 0. Each component depends on one variable only, so every cross derivative vanishes. So the curl is 00, and indeed F=∇x3+y3+z33F = \nabla\frac{x^3 + y^3 + z^3}3.
  5. Curl of (−y,x,z)(-y, x, z). Ry−Qz=0−0=0R_y - Q_z = 0 - 0 = 0, Pz−Rx=0−0=0P_z - R_x = 0 - 0 = 0, Qx−Py=1−(−1)=2Q_x - P_y = 1 - (-1) = 2. ∂xx=1\partial_xx = 1 and ∂y(−y)=−1\partial_y(-y) = -1.

Answer. div⁡F=2z\operatorname{div}F = 2z; the curl of (x2,y2,z2)(x^2,y^2,z^2) is 00; the curl of (−y,x,z)(-y, x, z) is (0,0,2)(0, 0, 2).

Worked example MATH 376 worksheet 28 problem 8; worksheet 14 problems 1 and 2
Find the curl and divergence of F=(yz,xz,xy)F = (yz, xz, xy), the vorticity of the velocity field v=(yz,xz,xy+z2)v = (yz, xz, xy + z^2), and the divergence of the heat flow q=−∇Tq = -\nabla T for T=x2+y2+z2T = x^2 + y^2 + z^2.

Solution.

  1. Curl of FF. With P=yzP = yz, Q=xzQ = xz, R=xyR = xy: Ry−Qz=x−x=0R_y - Q_z = x - x = 0, Pz−Rx=y−y=0P_z - R_x = y - y = 0, Qx−Py=z−z=0Q_x - P_y = z - z = 0. So curl⁡F=0\operatorname{curl}F = 0.
  2. Divergence of FF. Px+Qy+Rz=0+0+0=0P_x + Q_y + R_z = 0 + 0 + 0 = 0. yzyz has no xx, xzxz no yy, xyxy no zz. (This FF is ∇(xyz)\nabla(xyz), and xyzxyz is harmonic.)
  3. Vorticity of vv. The same three differences for R=xy+z2R = xy + z^2: Ry−Qz=x−x=0R_y - Q_z = x - x = 0, Pz−Rx=y−y=0P_z - R_x = y - y = 0, Qx−Py=z−z=0Q_x - P_y = z - z = 0. The vorticity is 00: a potential flow, with v=∇(xyz+z3/3)v = \nabla(xyz + z^3/3).
  4. Heat flow. ∇T=(2x,2y,2z)\nabla T = (2x, 2y, 2z), so q=(−2x,−2y,−2z)q = (-2x, -2y, -2z) and div⁡q=−2−2−2=−6\operatorname{div}q = -2 - 2 - 2 = -6. Negative divergence means the flow gathers: heat flows in toward each point, a sink.

Answer. curl 00 and div 00; vorticity 00; div⁡q=−6\operatorname{div}q = -6.

Your answerLet F=(x2y, yz2, xz)F = (x^2y,\ yz^2,\ xz). What is div⁡F\operatorname{div}F at the point (1,2,3)(1, 2, 3)?
Quick checkWhat is the second component of curl⁡(P,Q,R)\operatorname{curl}(P, Q, R)?

Identities

Theorem T MATH 376 lecture of 2 March, Lemma 5.13; homework 5 problem 5; Apostol 12.12 and 12.14

Identities for curl and divergence

Let F,GF, G be C1C^1 vector fields, ff a C1C^1 function, and a,ba, b numbers. Then div⁡(aF+bG)=adiv⁡F+bdiv⁡G\operatorname{div}(aF + bG) = a\operatorname{div}F + b\operatorname{div}G and the same for curl, and the product rules hold. If FF is C2C^2 then div⁡curl⁡F=0\operatorname{div}\operatorname{curl}F = 0, and if ff is C2C^2 then curl⁡∇f=0\operatorname{curl}\nabla f = 0.

In one lineCurl and divergence are linear; div⁡(curl⁡F)=0\operatorname{div}(\operatorname{curl}F) = 0 for C2C^2 fields; curl⁡(∇f)=0\operatorname{curl}(\nabla f) = 0 for C2C^2 functions; div⁡(fF)=fdiv⁡F+∇f⋅F\operatorname{div}(fF) = f\operatorname{div}F + \nabla f\cdot F and curl⁡(fF)=fcurl⁡F+∇f×F\operatorname{curl}(fF) = f\operatorname{curl}F + \nabla f\times F.

Why it is trueThe two zero identities explain why potentials have no spin and why a magnetic field has no source, and the product rules are used to compute with fields.

The hypothesis C2C^2 matters: the two zero identities use the equality of mixed partials (5.5), which needs continuous second partials. Without it the cancellation can fail at a point.

ProofMATH 376 homework 5 problem 5; lecture Lemma 5.13
The idea: Expand, group the terms by function, and see that every second derivative appears twice with opposite signs, as a pair of mixed partials.
curl⁡F=(Ry−Qz, Pz−Rx, Qx−Py)\operatorname{curl}F = (R_y - Q_z,\ P_z - R_x,\ Q_x - P_y).
Definition of the curl of F=(P,Q,R)F = (P, Q, R).
div⁡curl⁡F=∂x(Ry−Qz)+∂y(Pz−Rx)+∂z(Qx−Py)\operatorname{div}\operatorname{curl}F = \partial_x(R_y - Q_z) + \partial_y(P_z - R_x) + \partial_z(Q_x - P_y).
Definition of the divergence, applied to the three components of the curl.
=Ryx−Qzx+Pzy−Rxy+Qxz−Pyz= R_{yx} - Q_{zx} + P_{zy} - R_{xy} + Q_{xz} - P_{yz}.
Differentiate each term; RyxR_{yx} means ∂x(∂yR)\partial_x(\partial_yR).
=(Ryx−Rxy)+(Pzy−Pyz)+(Qxz−Qzx)= (R_{yx} - R_{xy}) + (P_{zy} - P_{yz}) + (Q_{xz} - Q_{zx}).
Regroup so that each bracket has the same function.
=0+0+0=0= 0 + 0 + 0 = 0.
Equality of mixed partials: each bracket is two mixed partials of one C2C^2 function.This is the step that uses C2C^2.
curl⁡∇f=(fzy−fyz, fxz−fzx, fyx−fxy)\operatorname{curl}\nabla f = (f_{zy} - f_{yz},\ f_{xz} - f_{zx},\ f_{yx} - f_{xy}).
For curl⁡∇f\operatorname{curl}\nabla f, take P=fxP = f_x, Q=fyQ = f_y, R=fzR = f_z in the curl formula.
=(0,0,0)= (0, 0, 0).
Equality of mixed partials again.The two zero identities are the same fact. In 6.7 they will both be 'd squared is zero'.
div⁡(fF)=f(Px+Qy+Rz)+(fxP+fyQ+fzR)=fdiv⁡F+∇f⋅F\operatorname{div}(fF) = f(P_x + Q_y + R_z) + (f_xP + f_yQ + f_zR) = f\operatorname{div}F + \nabla f\cdot F.
Product rule for the divergence: ∂x(fP)=fPx+fxP\partial_x(fP) = fP_x + f_xP, and similarly for yy and zz.
The bracket fyR−fzQf_yR - f_zQ is the first component of ∇f×F=(fyR−fzQ, fzP−fxR, fxQ−fyP)\nabla f\times F = (f_yR - f_zQ,\ f_zP - f_xR,\ f_xQ - f_yP), and the other two components are the same with the letters cycled. So curl⁡(fF)=fcurl⁡F+∇f×F\operatorname{curl}(fF) = f\operatorname{curl}F + \nabla f\times F. ■\blacksquare
The same product rule in the first component of curl⁡(fF)\operatorname{curl}(fF): ∂y(fR)−∂z(fQ)=f(Ry−Qz)+(fyR−fzQ)\partial_y(fR) - \partial_z(fQ) = f(R_y - Q_z) + (f_yR - f_zQ).Linearity of div and curl is the same kind of remark: each partial derivative of aP1+bP2aP_1 + bP_2 is aa times one plus bb times the other, so each component of div and curl is linear. Problem 'Prove that div and curl are linear' at the end writes it out.
Worked example new (identities, MATH 376 lecture Lemma 5.13)
Check the product rule div⁡(fF)=fdiv⁡F+∇f⋅F\operatorname{div}(fF) = f\operatorname{div}F + \nabla f\cdot F for f=xyzf = xyz and F=(x,yz,z2)F = (x, yz, z^2).

Solution.

  1. Left side. fF=(x2yz, xy2z2, xyz3)fF = (x^2yz,\ xy^2z^2,\ xyz^3), and ∂x(x2yz)=2xyz\partial_x(x^2yz) = 2xyz, ∂y(xy2z2)=2xyz2\partial_y(xy^2z^2) = 2xyz^2, ∂z(xyz3)=3xyz2\partial_z(xyz^3) = 3xyz^2. So div⁡(fF)=2xyz+5xyz2\operatorname{div}(fF) = 2xyz + 5xyz^2.
  2. Right side, first term. div⁡F=1+z+2z=1+3z\operatorname{div}F = 1 + z + 2z = 1 + 3z, so fdiv⁡F=xyz+3xyz2f\operatorname{div}F = xyz + 3xyz^2.
  3. Right side, second term. ∇f=(yz,xz,xy)\nabla f = (yz, xz, xy), so ∇f⋅F=xyz+xyz2+xyz2=xyz+2xyz2\nabla f\cdot F = xyz + xyz^2 + xyz^2 = xyz + 2xyz^2.
  4. Compare. xyz+3xyz2+xyz+2xyz2=2xyz+5xyz2xyz + 3xyz^2 + xyz + 2xyz^2 = 2xyz + 5xyz^2.

Answer. Both sides are 2xyz+5xyz22xyz + 5xyz^2.

Worked example MATH 376 homework 5 problem 4 (the cross product part) and new (vector potentials; compare Apostol 12.15 exercise 5 and 12.16)
Is there a field AA with curl⁡A=(x,y,−2z)\operatorname{curl}A = (x, y, -2z)? What about (x,y,z)(x, y, z)? Is there a vector vv with (1,2,1)×v=(3,1,5)(1, 2, 1)\times v = (3, 1, 5)?

Solution.

  1. Test the divergence. div⁡(x,y,−2z)=1+1−2=0\operatorname{div}(x, y, -2z) = 1 + 1 - 2 = 0, but div⁡(x,y,z)=3≠0\operatorname{div}(x, y, z) = 3\ne0. If G=curl⁡AG = \operatorname{curl}A then div⁡G=div⁡curl⁡A=0\operatorname{div}G = \operatorname{div}\operatorname{curl}A = 0. So (x,y,z)(x, y, z) is not a curl.
  2. Find AA for the first. Try A=(P,Q,0)A = (P, Q, 0). We need −Qz=x-Q_z = x, Pz=yP_z = y, Qx−Py=−2zQ_x - P_y = -2z. So Q=−xzQ = -xz, P=yzP = yz, and then Qx−Py=−z−z=−2zQ_x - P_y = -z - z = -2z. Choose the third component of AA to be 00 and integrate in zz.
  3. Check. A=(yz,−xz,0)A = (yz, -xz, 0) has Ry−Qz=0+x=xR_y - Q_z = 0 + x = x, Pz−Rx=y−0=yP_z - R_x = y - 0 = y, Qx−Py=−z−z=−2zQ_x - P_y = -z - z = -2z.
  4. The cross product question. (1,2,1)×v(1, 2, 1)\times v is orthogonal to (1,2,1)(1, 2, 1) for every vv, but (1,2,1)⋅(3,1,5)=3+2+5=10≠0(1,2,1)\cdot(3,1,5) = 3 + 2 + 5 = 10\ne0. So no such vv exists. The same shape as the field question: a curl has divergence zero, a cross product is orthogonal to its factors.

Answer. (x,y,−2z)(x, y, -2z) is the curl of (yz,−xz,0)(yz, -xz, 0); (x,y,z)(x, y, z) is not a curl; no such vv.

Beyond the course: for understanding· The converse: when is a field with curl zero a gradient?

The converses of the two zero identities are true on a nice domain (label A/B). On a star-shaped domain such as all of R3\mathbb R^3 or a ball: curl⁡F=0\operatorname{curl}F = 0 implies FF is a gradient, and div⁡G=0\operatorname{div}G = 0 implies GG is a curl. The domain matters. The field F=(−y,x,0)x2+y2F = \dfrac{(-y, x, 0)}{x^2 + y^2} on R3\mathbb R^3 minus the zz-axis has curl⁡F=0\operatorname{curl}F = 0, but its circulation around the unit circle in z=0z = 0 is ∫02π(sin⁡2t+cos⁡2t) dt=2π≠0\int_0^{2\pi}(\sin^2t + \cos^2t)\,dt = 2\pi\ne0, so it is not a gradient (this is homework 5 problem 4.1: the answer to ‘curl zero implies conservative?’ is false). The field G=(x,y,z)/ρ3G = (x, y, z)/\rho^3 on R3\mathbb R^3 minus the origin, with ρ=x2+y2+z2\rho = \sqrt{x^2 + y^2 + z^2}, has div⁡G=0\operatorname{div}G = 0, but its flux out of the unit sphere is 4π4\pi (shown below), whereas the flux of a curl through a closed surface is always 00 (also below). So GG is not a curl, although its divergence is zero. Holes in the domain are what stops the converses, and counting them is what 6.7 and a course in topology do.

Stokes’ theorem

We need to say which way round the edge of the surface goes, given which side of the surface is called positive.

Definition T

Induced orientation

Let SS be an oriented surface with boundary curve ∂S\partial S. The induced orientation of ∂S\partial S is the one for which, if you walk along ∂S\partial S with your head pointing along nn, the surface SS is on your left. Equivalently: right-hand fingers along ∂S\partial S, thumb along nn. For a flat region in the xyxy-plane with n=(0,0,1)n = (0, 0, 1) this is the counterclockwise direction seen from above, the positive orientation of Green’s theorem.

In one lineIf SS is an oriented surface with unit normal nn, its boundary curve ∂S\partial S is given the direction for which, walking along it with your head pointing in the direction of nn, the surface is on your left. This is the right-hand rule: curl the fingers of the right hand along ∂S\partial S and the thumb points along nn.

Why it existsThe line integral on the left of Stokes' theorem changes sign with the direction of travel and the surface integral on the right changes sign with nn; this rule makes the two signs agree.

Theorem T MATH 376 lecture of 2 March, Theorem 5.14; Apostol 12.11

Stokes' theorem

Let r:T→Sr: T\to S be a smooth one-to-one parametrization of a surface SS, where TT is bounded by a piecewise smooth Jordan curve Γ\Gamma. Let C=∂S=r(Γ)C = \partial S = r(\Gamma) be the boundary curve, oriented as the image of Γ\Gamma traversed counterclockwise, and nn the unit normal with which it is compatible (the induced orientation). Let FF be a vector field of class C1C^1 on an open set containing SS. Then

∮CF⋅dr=∬S(curl⁡F)⋅n dS=∬T(curl⁡F)(r(u,v))⋅(ru×rv) du dv.\oint_C F\cdot dr = \iint_S(\operatorname{curl}F)\cdot n\,dS = \iint_T(\operatorname{curl}F)(r(u, v))\cdot(r_u\times r_v)\,du\,dv.

The lecture states it with C2C^2; the textbook needs only C1C^1. The last equality holds when ru×rvr_u\times r_v points the way nn does, by the flux theorem.

In one lineIf SS is a piecewise smooth oriented surface whose boundary curve ∂S\partial S carries the induced orientation and FF is C1C^1 on an open set containing SS, then ∮∂SF⋅dr=∬S(curl⁡F)⋅n dS\oint_{\partial S}F\cdot dr = \iint_S(\operatorname{curl}F)\cdot n\,dS.

Why it is trueIt turns a line integral around a loop into a surface integral over any surface the loop bounds (or the reverse), whichever is easier, and it is Green's theorem for surfaces in space.

What fails without each hypothesis, one by one.

HypothesisWhy it is neededWhat goes wrong without it
SS is orientable with a continuous nnThe right side needs one unit normal at each pointThe Moebius strip has no such nn
∂S\partial S is a piecewise smooth, closed curveThe left side is a line integral over a closed curveAn open curve bounds no surface in this sense
∂S\partial S is oriented compatibly with nnIt fixes the sign of the left sideThe two sides differ by a minus sign
FF is C1C^1 at every point of SS, the inside includedThe proof differentiates FF across the whole surfaceThe example below

For the last row, take F=(−y,x,0)x2+y2F = \dfrac{(-y, x, 0)}{x^2 + y^2}, which is not defined on the zz-axis, and curl⁡F=0\operatorname{curl}F = 0 where it is defined. Its circulation around the unit circle in z=0z = 0 is 2π2\pi. The upper unit hemisphere has this circle as its boundary, and ∬curl⁡F⋅n dS=0\iint\operatorname{curl}F\cdot n\,dS = 0. The two sides disagree, because the hemisphere meets the zz-axis at (0,0,1)(0, 0, 1) where FF is not defined. This is the same failure as for Green’s theorem on the punctured plane in 6.4.

Why it is true: the proof for a graph

ProofMATH 376 lecture of 2 March (the affine case and a tiling argument); the same idea is Apostol 12.11
The idea: Write the line integral over the boundary of the surface as a line integral in the xy-plane, using that z depends on x and y along the curve. Apply Green's theorem there. Differentiate with the chain rule, and watch the terms with second derivatives of g cancel. What is left is the dot product of the curl with the normal (-g_x, -g_y, 1).
The boundary CC of SS is the image of ∂D\partial D under (x,y)↦(x,y,g(x,y))(x, y)\mapsto(x, y, g(x, y)), with ∂D\partial D run counterclockwise.
Setup: SS is the graph z=g(x,y)z = g(x, y) over a region DD bounded by a piecewise smooth Jordan curve, with gg of class C2C^2 and the upward normal; F=(P,Q,R)F = (P, Q, R) is C1C^1, and P,Q,RP, Q, R below are evaluated at (x,y,g(x,y))(x, y, g(x, y)).Orientation check, which is where signs go wrong. The upward normal and the right-hand rule make CC run counterclockwise as seen from above. The map (x,y)↦(x,y,g)(x, y)\mapsto(x, y, g) does not change the xx and yy coordinates, so ∂D\partial D must be run counterclockwise too, which is the positive orientation Green's theorem needs.
∬S(curl⁡F)⋅n dS=∬D[−(Ry−Qz)gx−(Pz−Rx)gy+(Qx−Py)]dx dy\displaystyle\iint_S(\operatorname{curl}F)\cdot n\,dS = \iint_D\Big[-(R_y - Q_z)g_x - (P_z - R_x)g_y + (Q_x - P_y)\Big]dx\,dy.
Flux formula of 6.5: n dS=(−gx,−gy,1) dx dyn\,dS = (-g_x, -g_y, 1)\,dx\,dy for the upward normal of a graph.
∮CF⋅dr=∮∂D(P+Rgx) dx+(Q+Rgy) dy\displaystyle\oint_CF\cdot dr = \oint_{\partial D}(P + Rg_x)\,dx + (Q + Rg_y)\,dy.
Along CC we have z=g(x,y)z = g(x, y), hence dz=gx dx+gy dydz = g_x\,dx + g_y\,dy (chain rule), so P dx+Q dy+R dzP\,dx + Q\,dy + R\,dz becomes a form in dxdx and dydy alone.
=∬D[∂x(Q+Rgy)−∂y(P+Rgx)] dx dy\displaystyle= \iint_D\big[\partial_x(Q + Rg_y) - \partial_y(P + Rg_x)\big]\,dx\,dy.
Green's theorem (6.4) on DD, applied to the C1C^1 pair p=P+Rgxp = P + Rg_x and q=Q+Rgyq = Q + Rg_y (this is where g∈C2g\in C^2 is used).
∂x(Q+Rgy)=Qx+Qzgx+(Rx+Rzgx)gy+Rgyx\partial_x(Q + Rg_y) = Q_x + Q_zg_x + (R_x + R_zg_x)g_y + Rg_{yx} and ∂y(P+Rgx)=Py+Pzgy+(Ry+Rzgy)gx+Rgxy\partial_y(P + Rg_x) = P_y + P_zg_y + (R_y + R_zg_y)g_x + Rg_{xy}.
Chain rule for functions of (x,y,g(x,y))(x, y, g(x, y)): for instance ∂x[Q(x,y,g)]=Qx+Qzgx\partial_x[Q(x, y, g)] = Q_x + Q_zg_x.
The difference is (Qx−Py)+(Qz−Ry)gx+(Rx−Pz)gy(Q_x - P_y) + (Q_z - R_y)g_x + (R_x - P_z)g_y.
Subtract. The terms RgyxRg_{yx} and RgxyRg_{xy} cancel because mixed partials of gg are equal, and the terms RzgxgyR_zg_xg_y cancel.This cancellation is the same cancellation as in 'curl of a gradient is zero'.
=−(Ry−Qz)gx−(Pz−Rx)gy+(Qx−Py)= -(R_y - Q_z)g_x - (P_z - R_x)g_y + (Q_x - P_y), so the two sides are equal. ■\blacksquare
Compare with the second line: the integrands are the same.
Proof workshopRebuild the proof of Stokes' theorem for a graphMATH 376 lecture of 2 March; Apostol 12.11

Tap the lines in the order a proof would write them. Each line can only use what is already above it.

    Why· The picture behind the proof, and the general surface

    Project the surface straight down onto the xyxy-plane. The boundary curve of SS projects to the boundary of DD, and Green’s theorem lives on DD. The surface’s slope enters through gxg_x and gyg_y: they are exactly the components of the normal that tilt the flat spin Qx−PyQ_x - P_y into the spin about the tilted normal. A general surface is cut into pieces, each a graph over some plane. On each piece the theorem holds by the argument above, and the inner edges cancel in pairs because neighbouring pieces traverse them in opposite directions (the ‘why the inner edges cancel’ box). The lecture’s own proof does the same with tiny affine pieces: for a field that is a linear function and a surface that is a linear graph both sides are constants times the area, and then the general case is a limit of sums.

    Worked example MATH 376 lecture of 2 March, Example 5.14 (the affine case of the lecture's proof)
    Check Stokes' theorem for the field F=(a1x+a2y+a3z, 0, 0)F = (a_1x + a_2y + a_3z,\ 0,\ 0) on the linear graph S={(u,v,b1u+b2v):(u,v)∈T}S = \{(u, v, b_1u + b_2v) : (u, v)\in T\}, where TT is a rectangle.

    Solution.

    1. Curl. P=a1x+a2y+a3zP = a_1x + a_2y + a_3z, Q=R=0Q = R = 0, so curl⁡F=(Ry−Qz, Pz−Rx, Qx−Py)=(0, a3, −a2)\operatorname{curl}F = (R_y - Q_z,\ P_z - R_x,\ Q_x - P_y) = (0,\ a_3,\ -a_2). Only the derivatives of PP in zz and yy survive.
    2. Surface side. The graph normal is N=(−b1,−b2,1)N = (-b_1, -b_2, 1), pointing up, so (curl⁡F)⋅N=−a3b2−a2(\operatorname{curl}F)\cdot N = -a_3b_2 - a_2, a constant. The surface integral is −(a2+a3b2)area⁡(T)-(a_2 + a_3b_2)\operatorname{area}(T).
    3. Line side, set up. Only P dxP\,dx is non-zero, and on SS we have x=ux = u, y=vy = v, z=b1u+b2vz = b_1u + b_2v, so P=(a1+a3b1)u+(a2+a3b2)vP = (a_1 + a_3b_1)u + (a_2 + a_3b_2)v. The boundary of SS is the image of the boundary of TT run counterclockwise, and dx=dudx = du along it.
    4. Line side, evaluate. ∮∂Tu du=0\oint_{\partial T}u\,du = 0 because u duu\,du is the exact differential of u2/2u^2/2. And ∮∂Tv du=−area⁡(T)\oint_{\partial T}v\,du = -\operatorname{area}(T) by Green’s theorem with P=vP = v, Q=0Q = 0, where Qu−Pv=−1Q_u - P_v = -1. So the line integral is −(a2+a3b2)area⁡(T)-(a_2 + a_3b_2)\operatorname{area}(T).

    Answer. Both sides equal −(a2+a3b2)area⁡(T)-(a_2 + a_3b_2)\operatorname{area}(T). The lecture’s proof does this computation for affine fields on linear pieces, which is all you need on a tiny patch where FF and the surface look affine, then adds the patches: the inner edges cancel in pairs and the outer edge is left.

    How to use Stokes’ theorem

    The exam standard for ‘use Stokes to compute’ is to name every object. Quoting the theorem and writing the determinant for the curl is only the first two lines.

    Why· Full-credit template for 'use Stokes' theorem to compute'
    1. Name the surface SS: give an equation and the parameter region. Choose the simplest surface with boundary CC (usually the flat disc or polygon).
    2. Name the normal nn: give its components.
    3. Name the boundary and its direction: check the right-hand rule. Walking along CC with your head along nn, SS must be on your left.
    4. Name the field F=(P,Q,R)F = (P, Q, R) with the component formulas.
    5. State the hypotheses and check them: SS orientable and piecewise smooth, CC its boundary, FF of class C1C^1 on an open set containing all of SS, not only CC.
    6. Compute the curl of the full field, component by component, writing each partial derivative.
    7. Dot curl⁡F\operatorname{curl}F with nn.
    8. Integrate over SS with the right dSdS or n dSn\,dS, showing antiderivatives.
    9. Conclude in a sentence.
    Worked example MATH 376 Midterm 2 problem 3, 5 points; see [A.3](/vol2/a3-midterm-2/)
    Use Stokes' theorem to compute ∮CF⋅dα\oint_CF\cdot d\alpha for F(x,y,z)=(y,−x,z2)F(x, y, z) = (y, -x, z^2) and CC the circle x2+y2=4x^2 + y^2 = 4 in the plane z=0z = 0, counterclockwise when viewed from above.

    Solution.

    1. Surface. S={(x,y,0):x2+y2≤4}S = \{(x, y, 0): x^2 + y^2\le4\}, the flat disc of radius 22. It is the simplest surface with boundary CC.
    2. Normal. n=(0,0,1)n = (0, 0, 1). Counterclockwise from above and the right-hand rule: thumb up.
    3. Boundary. ∂S=C\partial S = C, counterclockwise from above, matching the problem.
    4. Field. P=yP = y, Q=−xQ = -x, R=z2R = z^2; all are polynomials, so FF is C1C^1 on R3\mathbb R^3 and Stokes’ hypotheses hold on any surface.
    5. Curl. Ry−Qz=∂y(z2)−∂z(−x)=0R_y - Q_z = \partial_y(z^2) - \partial_z(-x) = 0; Pz−Rx=∂z(y)−∂x(z2)=0P_z - R_x = \partial_z(y) - \partial_x(z^2) = 0; Qx−Py=−1−1=−2Q_x - P_y = -1 - 1 = -2. So curl⁡F=(0,0,−2)\operatorname{curl}F = (0, 0, -2).
    6. Dot. (curl⁡F)⋅n=−2(\operatorname{curl}F)\cdot n = -2.
    7. Integrate. ∮CF⋅dα=∬S(−2) dS=−2area⁡(S)=−2⋅4π=−8π\oint_CF\cdot d\alpha = \iint_S(-2)\,dS = -2\operatorname{area}(S) = -2\cdot4\pi = -8\pi.
    8. Check by the line integral. α(t)=(2cos⁡t,2sin⁡t,0)\alpha(t) = (2\cos t, 2\sin t, 0), α′=(−2sin⁡t,2cos⁡t,0)\alpha' = (-2\sin t, 2\cos t, 0), F(α)=(2sin⁡t,−2cos⁡t,0)F(\alpha) = (2\sin t, -2\cos t, 0), F⋅α′=−4sin⁡2t−4cos⁡2t=−4F\cdot\alpha' = -4\sin^2t - 4\cos^2t = -4, and ∫02π(−4) dt=−8π\int_0^{2\pi}(-4)\,dt = -8\pi. Both ways agree.

    Answer. −8π-8\pi.

    Worked example MATH 376 practice Midterm 2 problem 3; see [A.5](/vol2/a5-practice-exams/). Worksheet 14 problem 5 is the same with vertices $(3, 0, 0)$, $(0, 3, 0)$, $(0, 0, 3)$ and gives $\frac{27}2$; homework 6 problem 1 is the field $(yz, xz, xy)$ and gives $0$.
    Use Stokes' theorem for ∮C(z,x,y)⋅dα\oint_C(z, x, y)\cdot d\alpha, where CC is the boundary of the triangle with vertices (1,0,0)(1, 0, 0), (0,1,0)(0, 1, 0), (0,0,1)(0, 0, 1), oriented counterclockwise as viewed from the direction of (1,1,1)(1, 1, 1).

    Solution.

    1. Surface. SS is the triangle in the plane x+y+z=1x + y + z = 1, a graph z=1−x−yz = 1 - x - y over D={x,y≥0, x+y≤1}D = \{x, y\ge0,\ x + y\le1\}. Each vertex satisfies x+y+z=1x + y + z = 1.
    2. Normal. N=(−gx,−gy,1)=(1,1,1)N = (-g_x, -g_y, 1) = (1, 1, 1), pointing toward the viewer at (1,1,1)(1, 1, 1). Right-hand rule: counterclockwise as seen from (1,1,1)(1, 1, 1) matches a normal that points toward that viewer.
    3. Curl. P=zP = z, Q=xQ = x, R=yR = y: Ry−Qz=1R_y - Q_z = 1, Pz−Rx=1P_z - R_x = 1, Qx−Py=1Q_x - P_y = 1, so curl⁡F=(1,1,1)\operatorname{curl}F = (1, 1, 1).
    4. Dot and integrate. n dS=N dAn\,dS = N\,dA, so (curl⁡F)⋅N=3(\operatorname{curl}F)\cdot N = 3 and ∬D3 dA=3⋅12=32\iint_D3\,dA = 3\cdot\frac12 = \frac32.
    5. Check along the three edges. (1,0,0)→(0,1,0)(1,0,0)\to(0,1,0): α=(1−t,t,0)\alpha = (1 - t, t, 0), F=(0,1−t,t)F = (0, 1 - t, t), F⋅α′=1−tF\cdot\alpha' = 1 - t, integral 12\frac12. The other two edges give 12\frac12 each by symmetry. The sum is 32\frac32.

    Answer. 32\dfrac32. With vertices (3,0,0)(3, 0, 0), (0,3,0)(0, 3, 0), (0,0,3)(0, 0, 3) the base DD has area 92\frac92, so the answer is 3⋅92=2723\cdot\frac92 = \frac{27}2. With F=(yz,xz,xy)F = (yz, xz, xy) the curl is 00 (every component is z−zz - z or similar), so the circulation is 00.

    Worked example MATH 376 worksheet 13 problem 8 and worksheet 27 problem 10
    Use Stokes' theorem for ∮CF⋅dα\oint_C F\cdot d\alpha with F=(−y,x,z)F = (-y, x, z) and CC the unit circle x2+y2=1x^2 + y^2 = 1 at height z=0z = 0 and at height z=3z = 3, counterclockwise from above.

    Solution.

    1. Curl. curl⁡F=(0,0,2)\operatorname{curl}F = (0, 0, 2) from the example above. It does not depend on zz.
    2. Surface. The flat unit disc in the plane of the circle, with n=(0,0,1)n = (0, 0, 1).
    3. Dot and integrate. (curl⁡F)⋅n=2(\operatorname{curl}F)\cdot n = 2, and ∬S2 dS=2π\iint_S2\,dS = 2\pi.
    4. Check. α=(cos⁡t,sin⁡t,3)\alpha = (\cos t, \sin t, 3), α′=(−sin⁡t,cos⁡t,0)\alpha' = (-\sin t, \cos t, 0), F⋅α′=sin⁡2t+cos⁡2t=1F\cdot\alpha' = \sin^2t + \cos^2t = 1, integral 2π2\pi.

    Answer. 2π2\pi at both heights. The third component of FF is orthogonal to α′\alpha' on a horizontal circle, so it does not matter.

    Worked example new (choosing the surface; two surfaces with the same boundary)
    Let F=(y,z,x)F = (y, z, x) and CC the unit circle in the plane z=0z = 0, counterclockwise from above. Compute ∮CF⋅dr\oint_CF\cdot dr using (a) the flat disc and (b) the paraboloid z=1−x2−y2z = 1 - x^2 - y^2, z≥0z\ge0, as the surface.

    Solution.

    1. Curl. P=yP = y, Q=zQ = z, R=xR = x: Ry−Qz=0−1R_y - Q_z = 0 - 1, Pz−Rx=0−1P_z - R_x = 0 - 1, Qx−Py=0−1Q_x - P_y = 0 - 1. So curl⁡F=(−1,−1,−1)\operatorname{curl}F = (-1, -1, -1).
    2. (a) The disc. n=(0,0,1)n = (0, 0, 1), (curl⁡F)⋅n=−1(\operatorname{curl}F)\cdot n = -1, and the integral is −π-\pi.
    3. (b) The paraboloid. It is the graph of g=1−x2−y2g = 1 - x^2 - y^2 over the unit disc with the upward normal N=(2x,2y,1)N = (2x, 2y, 1), and its boundary is the same circle. Same boundary, compatible orientation: upward normal, counterclockwise from above.
    4. (b) Dot. (curl⁡F)⋅N=−2x−2y−1(\operatorname{curl}F)\cdot N = -2x - 2y - 1.
    5. (b) Integrate. ∬D(−2x−2y−1) dA=−π\iint_D(-2x - 2y - 1)\,dA = -\pi. By symmetry ∬x dA=∬y dA=0\iint x\,dA = \iint y\,dA = 0 over the disc, and ∬1 dA=π\iint1\,dA = \pi.
    6. Direct check. On CC, z=0z = 0, so F⋅α′=y x′F\cdot\alpha' = y\,x' and ∮y dx=∫02πsin⁡t(−sin⁡t) dt=−π\oint y\,dx = \int_0^{2\pi}\sin t(-\sin t)\,dt = -\pi.

    Answer. −π-\pi by all three. Two surfaces with the same boundary give the same flux of the curl, which is why you may replace a curved surface by a flat one.

    Worked example MATH 376 lecture of 2 March (Stokes for the hemisphere)
    Let F=(−y,x,0)F = (-y, x, 0). Compute the circulation around the unit circle in the plane z=0z = 0, and the flux of curl⁡F\operatorname{curl}F through the upper unit hemisphere with outward normal.

    Solution.

    1. Circulation. α=(cos⁡t,sin⁡t,0)\alpha = (\cos t, \sin t, 0), F⋅α′=sin⁡2t+cos⁡2t=1F\cdot\alpha' = \sin^2t + \cos^2t = 1, so ∮=2π\oint = 2\pi.
    2. Curl. curl⁡F=(0,0,2)\operatorname{curl}F = (0, 0, 2).
    3. Hemisphere. The outward N=sin⁡φ (sin⁡φcos⁡θ, sin⁡φsin⁡θ, cos⁡φ)N = \sin\varphi\,(\sin\varphi\cos\theta,\ \sin\varphi\sin\theta,\ \cos\varphi) from 6.5, with 0≤φ≤π/20\le\varphi\le\pi/2. So (curl⁡F)⋅N=2sin⁡φcos⁡φ(\operatorname{curl}F)\cdot N = 2\sin\varphi\cos\varphi.
    4. Integrate. ∫02π ⁣∫0π/22sin⁡φcos⁡φ dφ dθ=2π⋅1=2π\int_0^{2\pi}\!\int_0^{\pi/2}2\sin\varphi\cos\varphi\,d\varphi\,d\theta = 2\pi\cdot1 = 2\pi.

    Answer. 2π2\pi both ways. The boundary of the upper hemisphere with outward normal is the equator traversed counterclockwise from above, as the right-hand rule says.

    Worked example MATH 376 worksheet 14 problem 6
    Ampere's law: a long straight wire has cross-section the disc of radius 22 and current density J=(0,0,20r)J = (0, 0, 20r), where rr is the distance from the axis. Find the circulation of BB around the edge of the cross-section, given ∇×B=μ0J\nabla\times B = \mu_0J.

    Solution.

    1. Surface. SS is the cross-sectional disc of radius 22, with n=(0,0,1)n = (0, 0, 1) along the current; its boundary CC is the edge, with the induced direction.
    2. Stokes, then Ampere. ∮CB⋅dr=∬S(∇×B)⋅n dS=μ0∬SJ⋅n dS\oint_CB\cdot dr = \iint_S(\nabla\times B)\cdot n\,dS = \mu_0\iint_SJ\cdot n\,dS.
    3. Dot. J⋅n=20rJ\cdot n = 20r.
    4. Integrate in polar coordinates. ∫02π ⁣∫02μ0⋅20r⋅r dr dθ=2πμ0⋅20⋅83=320πμ03\int_0^{2\pi}\!\int_0^2\mu_0\cdot20r\cdot r\,dr\,d\theta = 2\pi\mu_0\cdot20\cdot\frac83 = \dfrac{320\pi\mu_0}3. The extra rr is the Jacobian dS=r dr dθdS = r\,dr\,d\theta of polar coordinates.

    Answer. 320πμ03\dfrac{320\pi\mu_0}3. The circulation of the magnetic field around the wire equals μ0\mu_0 times the current through it.

    Your answerUse Stokes' theorem to find the circulation of F=(−y,x,z3)F = (-y, x, z^3) counterclockwise around the ellipse x24+y2=1\frac{x^2}4 + y^2 = 1 in the plane z=0z = 0.
    Quick checkWhich orientation of the boundary circle of the upper hemisphere (outward normal) makes Stokes' theorem true?

    The mistake of taking the curl of a restricted field

    Worked example MATH 376 Final problem 3, 5 points; see [A.4](/vol2/a4-final/) and [A.1](/vol2/a1-what-you-lost-points-on/)
    Find ∮CF⋅dα\oint_CF\cdot d\alpha for F=(yzcos⁡(xyz), xzcos⁡(xyz), xycos⁡(xyz))F = (yz\cos(xyz),\ xz\cos(xyz),\ xy\cos(xyz)) and CC the unit circle in z=0z = 0, counterclockwise.

    Solution.

    1. Method 1: a gradient. ∇sin⁡(xyz)=(yzcos⁡(xyz), xzcos⁡(xyz), xycos⁡(xyz))=F\nabla\sin(xyz) = (yz\cos(xyz),\ xz\cos(xyz),\ xy\cos(xyz)) = F. So FF is a gradient field on R3\mathbb R^3 and the integral around the closed curve CC is 00 (6.2).
    2. Method 2: Stokes with the full curl. Write w=xyzw = xyz. Then Ry=xcos⁡w−x2yzsin⁡wR_y = x\cos w - x^2yz\sin w and Qz=xcos⁡w−x2yzsin⁡wQ_z = x\cos w - x^2yz\sin w, so the first component is 00. In the same way Pz−Rx=0P_z - R_x = 0 and Qx−Py=0Q_x - P_y = 0. So curl⁡F=0\operatorname{curl}F = 0 and the flux through the unit disc is 00.
    3. Method 3: directly. On CC we have z=0z = 0 and α′=(α1′,α2′,0)\alpha' = (\alpha_1', \alpha_2', 0). Substituting after the dot product is safe: F⋅α′=0⋅α1′+0⋅α2′+xy⋅0=0F\cdot\alpha' = 0\cdot\alpha_1' + 0\cdot\alpha_2' + xy\cdot0 = 0.

    Answer. 00 by any of the three.

    Watch out· Restrict AFTER you differentiate

    On the 376 final, a student answered 00, which was correct, but the method was not: they wrote F(x,y,0)=(0,0,xy)F(x, y, 0) = (0, 0, xy) and took the curl of that, getting (x,−y,0)(x, -y, 0). The curl contains derivatives in the zz direction (QzQ_z and PzP_z), and a zz-derivative needs the values of the field at nearby heights. Setting z=0z = 0 first throws them away. The true curl is 00 everywhere, while the restricted curl at (1,1,0)(1, 1, 0) is (1,−1,0)(1, -1, 0). Their answer survived only because the disc in z=0z = 0 has n=(0,0,1)n = (0, 0, 1), which uses only Qx−PyQ_x - P_y, and xx- and yy-derivatives are tangent to the plane and survive the restriction. It fails as soon as the normal has an xx or yy component: for F=(0,z,0)F = (0, z, 0) the true curl is (−1,0,0)(-1, 0, 0), and the flux through the unit disc in the plane x=0x = 0 with n=(1,0,0)n = (1, 0, 0) is −π-\pi, while restricting to z=0z = 0 would give F=0F = 0 and flux 00. Restrict to a curve or surface only after all derivatives are taken; restricting inside a line integral is safe because no derivative is taken there.

    Deducing one theorem from another

    Worked example MATH 376 Midterm 2 problem 4(b), 3 points (scored 0.5); see [A.3](/vol2/a3-midterm-2/) and [A.1](/vol2/a1-what-you-lost-points-on/)
    Deduce Green's theorem from Stokes' theorem.

    Solution.

    1. Hypotheses of Green. D⊂R2D\subset\mathbb R^2 is bounded by a positively oriented piecewise smooth Jordan curve CC, parametrized by α(t)=(x(t),y(t))\alpha(t) = (x(t), y(t)), and (P,Q)(P, Q) is C1C^1 on an open set containing DD. What we are given.
    2. Surface. S=D×{0}S = D\times\{0\}, the copy of DD in the plane z=0z = 0, flat and so piecewise smooth, with boundary C×{0}C\times\{0\}.
    3. Normal. n=(0,0,1)n = (0, 0, 1). Counterclockwise from above and the right-hand rule: the orientations are compatible.
    4. Field. F(x,y,z)=(P(x,y), Q(x,y), 0)F(x, y, z) = (P(x, y),\ Q(x, y),\ 0). Lift the planar field into space with a zero third component. It is C1C^1 on an open set containing SS.
    5. The line integral. On C×{0}C\times\{0\}, dα=(dx,dy,0)d\alpha = (dx, dy, 0), so F⋅dα=P dx+Q dyF\cdot d\alpha = P\,dx + Q\,dy and ∮C×{0}F⋅dα=∮CP dx+Q dy\oint_{C\times\{0\}}F\cdot d\alpha = \oint_CP\,dx + Q\,dy. The third component drops out.
    6. The curl. R=0R = 0 and P,QP, Q do not depend on zz, so Ry−Qz=0R_y - Q_z = 0 and Pz−Rx=0P_z - R_x = 0. Hence curl⁡F=(0,0,Qx−Py)\operatorname{curl}F = (0, 0, Q_x - P_y) and (curl⁡F)⋅n=Qx−Py(\operatorname{curl}F)\cdot n = Q_x - P_y.
    7. The surface element. SS is parametrized by r(x,y)=(x,y,0)r(x, y) = (x, y, 0) with rx×ry=(0,0,1)r_x\times r_y = (0, 0, 1) of length 11, so dS=dx dydS = dx\,dy.
    8. Apply Stokes. ∮CP dx+Q dy=∬S(curl⁡F)⋅n dS=∬D(Qx−Py) dx dy\oint_CP\,dx + Q\,dy = \iint_S(\operatorname{curl}F)\cdot n\,dS = \iint_D(Q_x - P_y)\,dx\,dy. All hypotheses were checked above. This is Green’s theorem.

    Answer. Stokes’ theorem on the flat surface D×{0}D\times\{0\} with n=(0,0,1)n = (0, 0, 1) for the field (P,Q,0)(P, Q, 0) is Green’s theorem. ‘Deduce’ means specialize: say what SS, nn and FF are, and compute the curl.

    Watch out· Midterm 2 problem 4(b) lost 2.5 of 3 points: quoting is not deducing

    On the 376 midterm, a student wrote ∮CF⋅dα=∬Scurl⁡F⋅dS\oint_CF\cdot d\alpha = \iint_S\operatorname{curl}F\cdot dS and the determinant for the curl, and then stopped. That is the statement of the theorem, not an argument: the rubric item applied was ‘stated Green’s theorem or Stokes’ theorem, otherwise no helpful steps’. The question said to deduce one theorem from another, and the work is in the specializing: which surface, which normal and why that orientation, which field in which dimension, what the curl of that field is, and what dSdS is. Also, they used Fx,Fy,FzF_x, F_y, F_z for components; writing P,Q,RP, Q, R (or F1,F2,F3F_1, F_2, F_3) avoids confusion with partial derivatives.

    Worked example MATH 376 practice Midterm 2 problem 4(b); see [A.5](/vol2/a5-practice-exams/)
    Let a,b∈R2a, b\in\mathbb R^2 and PP the parallelogram {sa+tb:s,t∈[0,1]}\{sa + tb : s, t\in[0, 1]\}. Deduce from Stokes' theorem that its signed area is det⁡(a,b)\det(a, b).

    Solution.

    1. Setup. Write a=(a1,a2)a = (a_1, a_2), b=(b1,b2)b = (b_1, b_2), D=a1b2−a2b1D = a_1b_2 - a_2b_1. Embed PP in the plane z=0z = 0 with n=(0,0,1)n = (0, 0, 1).
    2. Choose a field with curl (0,0,1)(0, 0, 1). F=(−y2,x2,0)F = (-\frac y2, \frac x2, 0) has curl⁡F=(0,0,12−(−12))=(0,0,1)\operatorname{curl}F = (0, 0, \frac12 - (-\frac12)) = (0, 0, 1). Then (curl⁡F)⋅n=1(\operatorname{curl}F)\cdot n = 1 and the flux is the area.
    3. Stokes. area⁡(P)=∬P1 dS=∮∂PF⋅dr\operatorname{area}(P) = \iint_P1\,dS = \oint_{\partial P}F\cdot dr, with ∂P\partial P traversed 0→a→a+b→b→00\to a\to a + b\to b\to0, which is counterclockwise when D>0D>0.
    4. Side 1 (r=tar = ta): F⋅r′=−ta22a1+ta12a2=0F\cdot r' = -\frac{ta_2}2a_1 + \frac{ta_1}2a_2 = 0. Side 4 (r=(1−t)br = (1 - t)b, r′=−br' = -b) is 00 in the same way, because FF is perpendicular to the position vector.
    5. Side 2 (r=a+tbr = a + tb, r′=br' = b): F⋅r′=−(a2+tb2)b1+(a1+tb1)b22=a1b2−a2b12=D2F\cdot r' = \frac{-(a_2 + tb_2)b_1 + (a_1 + tb_1)b_2}2 = \frac{a_1b_2 - a_2b_1}2 = \frac D2. The terms with tt cancel. Side 3 (r=(1−t)a+br = (1 - t)a + b, r′=−ar' = -a) also gives D2\frac D2.
    6. Add. 0+D2+D2+0=D0 + \frac D2 + \frac D2 + 0 = D.

    Answer. The signed area is det⁡(a,b)\det(a, b): positive if the traversal is counterclockwise, negative if clockwise, and 00 if aa and bb are parallel.

    What curl means, now proved

    Proposition B Apostol 12.12 (curl and rotation); the paddle-wheel picture

    Curl is circulation per unit area

    Let FF be C1C^1 near pp and nn a unit vector. Let DεD_\varepsilon be the flat disc of radius ε\varepsilon with centre pp perpendicular to nn, and Cε=∂DεC_\varepsilon = \partial D_\varepsilon with the induced orientation. Then lim⁡ε→01πε2∮CεF⋅dr=(curl⁡F)(p)⋅n\displaystyle\lim_{\varepsilon\to0}\frac1{\pi\varepsilon^2}\oint_{C_\varepsilon}F\cdot dr = (\operatorname{curl}F)(p)\cdot n.

    In one lineFor a C1C^1 field FF, a point pp and a unit vector nn, the circulation of FF around the circle of radius ε\varepsilon about pp in the plane perpendicular to nn (counterclockwise from the tip of nn), divided by its area πε2\pi\varepsilon^2, tends to (curl⁡F)(p)⋅n(\operatorname{curl}F)(p)\cdot n as ε→0\varepsilon\to0.

    Why it is trueIt is the definition-free meaning of curl, and the reason the paddle wheel turns at half of the curl along its axis.

    ProofApostol 12.12
    The idea: Stokes turns the circulation into a flux of the curl, and a continuous function over a small disc is close to its value at the centre.
    ∮CεF⋅dr=∬Dε(curl⁡F)⋅n dS\oint_{C_\varepsilon}F\cdot dr = \iint_{D_\varepsilon}(\operatorname{curl}F)\cdot n\,dS.
    Stokes' theorem on the flat oriented disc DεD_\varepsilon with normal nn.
    Then ∣∬Dε[(curl⁡F)⋅n−(curl⁡F)(p)⋅n]dS∣≤η πε2\Big\lvert\iint_{D_\varepsilon}\big[(\operatorname{curl}F)\cdot n - (\operatorname{curl}F)(p)\cdot n\big]dS\Big\rvert\le\eta\,\pi\varepsilon^2.
    The curl is continuous because FF is C1C^1: given η>0\eta>0 there is ε0\varepsilon_0 with ∣(curl⁡F)(q)⋅n−(curl⁡F)(p)⋅n∣<η\lvert(\operatorname{curl}F)(q)\cdot n - (\operatorname{curl}F)(p)\cdot n\rvert<\eta for q∈Dεq\in D_\varepsilon, ε<ε0\varepsilon<\varepsilon_0.
    So ∣1πε2∮CεF⋅dr−(curl⁡F)(p)⋅n∣≤η\Big\lvert\dfrac1{\pi\varepsilon^2}\oint_{C_\varepsilon}F\cdot dr - (\operatorname{curl}F)(p)\cdot n\Big\rvert\le\eta for all small ε\varepsilon. ■\blacksquare
    The integral of the constant (curl⁡F)(p)⋅n(\operatorname{curl}F)(p)\cdot n over the disc is that constant times the area πε2\pi\varepsilon^2.

    This is why the wheel in the picture at the top spins at half of curl⁡F⋅n\operatorname{curl}F\cdot n (the rim moves at the average of the field on the rim, so the angular speed is the circulation divided by the rim length 2πε2\pi\varepsilon and by the radius ε\varepsilon, giving circulation per area over 22), and why the curl is largest along the axis in which the circulation density is largest. The curl vector points along the axis of fastest rotation, and its length is that rotation rate (twice the angular speed).

    The divergence theorem

    Definition T

    Solid region

    A solid region E⊂R3E\subset\mathbb R^3 is a bounded set with non-empty interior whose boundary ∂E\partial E is a piecewise smooth surface. A ball, a cube, the region under a paraboloid and a torus (the doughnut, not only the skin) are solid regions.

    In one lineA bounded region EE of space with non-empty interior whose boundary ∂E\partial E is a piecewise smooth surface.

    Why it existsIt is the shape the divergence theorem integrates over: a body with a skin.

    Definition T

    Closed surface

    A surface is closed if it has no boundary curve: it encloses a solid. A sphere, a torus and the surface of a cube are closed; a hemisphere, a bowl and a cube with its top removed are not. (In 4.1 ‘closed set’ means that the set contains its boundary points, which is a different use of the word.)

    In one lineA surface without a boundary curve of its own, such as the boundary of a solid region: a sphere, the surface of a cube or a torus. An open surface such as a bowl or a cube without a lid has a boundary curve.

    Why it existsStokes' theorem is about surfaces with an edge and the divergence theorem about surfaces without one, and mixing them up is a common error (practice Final 7(d)).

    Theorem T MATH 376 lecture of 4 March, Theorem 5.16; Midterm 2 problem 4(a); Apostol 12.19

    The divergence theorem

    Let E⊂R3E\subset\mathbb R^3 be a solid region whose boundary S=∂ES = \partial E is a closed, orientable, piecewise smooth surface, and let nn be the outward unit normal. Let FF be C1C^1 on an open set containing EE. Then ∬SF⋅n dS=∭Ediv⁡F dV\iint_SF\cdot n\,dS = \iiint_E\operatorname{div}F\,dV. (The lecture states it with C2C^2.)

    In one lineIf EE is a solid region with boundary a closed piecewise smooth surface S=∂ES = \partial E with outward unit normal nn, and FF is C1C^1 on an open set containing EE, then ∬SF⋅n dS=∭Ediv⁡F dV\iint_SF\cdot n\,dS = \iiint_E\operatorname{div}F\,dV.

    Why it is trueIt trades a flux through a closed surface for a volume integral of the divergence (or the reverse), and it says that what a field produces inside a body is what leaves through its skin.

    Midterm 2 problem 4(a) asked only for this statement, and the marks were for the hypotheses: a solid region, a closed piecewise smooth boundary, the outward normal, and a C1C^1 field on a neighbourhood of all of EE. What fails without each one:

    HypothesisWhat goes wrong without it
    SS is closed and bounds a solidAn open surface (a cube without a lid) has no solid inside it. Take F=(0,0,1)F = (0, 0, 1) and the upper unit hemisphere: div⁡F=0\operatorname{div}F = 0, but the flux is π\pi. Close it first.
    outward normalWith the inward normal, the left side changes sign.
    FF is C1C^1 on all of EE, the inside includedF=r/ρ3F = r/\rho^3 has divergence 00 away from the origin and flux 4π4\pi out of the unit sphere, because it is not defined at the origin.

    Why it is true: the proof for a standard region

    ProofApostol 12.19; MATH 376 lecture of 4 March (the affine case on a box)
    The idea: Do the third component of the field alone, in the z direction: the fundamental theorem of calculus in z turns the volume integral into a difference of values of R on the top and bottom, and that difference is exactly the flux of (0, 0, R) through the top and bottom. The first two components are the same with the axes renamed.
    A standard region is of this form in all three directions, and a box is the simplest case (g1g_1 and g2g_2 constant).
    Setup: E={(x,y,z):(x,y)∈D, g1(x,y)≤z≤g2(x,y)}E = \{(x, y, z): (x, y)\in D,\ g_1(x, y)\le z\le g_2(x, y)\} for a region DD and continuous, piecewise C1C^1 functions g1≤g2g_1\le g_2, and the field (0,0,R)(0, 0, R) with RR of class C1C^1.
    ∭ERz dV=∬D(∫g1g2Rz dz)dA=∬D[R(x,y,g2)−R(x,y,g1)]dA\displaystyle\iiint_ER_z\,dV = \iint_D\Big(\int_{g_1}^{g_2}R_z\,dz\Big)dA = \iint_D\big[R(x, y, g_2) - R(x, y, g_1)\big]dA.
    Fubini (6.3) with zz innermost, then the fundamental theorem of calculus in zz.
    The flux of (0,0,R)(0, 0, R) through the top is ∬DR(x,y,g2) dA\iint_DR(x, y, g_2)\,dA.
    The top is the graph of g2g_2 with the upward (outward) normal, n dS=(−g2x,−g2y,1) dAn\,dS = (-g_{2x}, -g_{2y}, 1)\,dA (6.5); the dot product with (0,0,R)(0, 0, R) keeps only the 11.
    The flux through the bottom is −∬DR(x,y,g1) dA-\iint_DR(x, y, g_1)\,dA.
    The bottom is the graph of g1g_1 and outward means downward, so n dS=−(−g1x,−g1y,1) dAn\,dS = -(-g_{1x}, -g_{1y}, 1)\,dA.
    The flux through the side wall is 00.
    The side wall is vertical, so its outward normal is horizontal and (0,0,R)⋅n=0(0, 0, R)\cdot n = 0.
    So ∬S(0,0,R)⋅n dS=∭ERz dV\iint_S(0, 0, R)\cdot n\,dS = \iiint_ER_z\,dV.
    Add the three fluxes and compare with the second line.If the region is not of this form, cut it into pieces that are; the shared faces carry opposite normals and cancel.
    ∬SF⋅n dS=∭E(Px+Qy+Rz) dV\iint_SF\cdot n\,dS = \iiint_E(P_x + Q_y + R_z)\,dV. ■\blacksquare
    Repeat with xx innermost for the field (P,0,0)(P, 0, 0) and with yy innermost for (0,Q,0)(0, Q, 0), which a standard region allows, and add the three results.
    Proof workshopGive the reason for each line: the divergence theorem for the z componentApostol 12.19

    Each line of the proof is shown in order. Choose the reason that justifies it, then press Check.

    1. ∭ERz dV=∬D(∫g1(x,y)g2(x,y)Rz dz)dA\displaystyle\iiint_ER_z\,dV = \iint_D\Big(\int_{g_1(x,y)}^{g_2(x,y)}R_z\,dz\Big)dA.
    2. =∬D[R(x,y,g2)−R(x,y,g1)]dA= \iint_D\big[R(x, y, g_2) - R(x, y, g_1)\big]dA.
    3. The flux of (0,0,R)(0, 0, R) through the top surface z=g2z = g_2 is ∬DR(x,y,g2) dA\iint_DR(x, y, g_2)\,dA.
    4. The flux through the bottom surface z=g1z = g_1 is −∬DR(x,y,g1) dA-\iint_DR(x, y, g_1)\,dA.
    5. The flux through the vertical side wall is 00.
    6. So ∬S(0,0,R)⋅n dS=∭ERz dV\iint_S(0, 0, R)\cdot n\,dS = \iiint_ER_z\,dV.
    Worked example MATH 376 lecture of 4 March, Example 5.15
    Check the divergence theorem on the box V=[a1,b1]×[a2,b2]×[a3,b3]V = [a_1, b_1]\times[a_2, b_2]\times[a_3, b_3] for F=(αx+βy+γz, 0, 0)F = (\alpha x + \beta y + \gamma z,\ 0,\ 0).

    Solution.

    1. Volume side. div⁡F=α\operatorname{div}F = \alpha, a constant, so ∭Vα dV=αVol⁡(V)\iiint_V\alpha\,dV = \alpha\operatorname{Vol}(V).
    2. Four faces contribute nothing. The faces with normals ±e2\pm e_2 and ±e3\pm e_3 have F⋅n=0F\cdot n = 0, because FF points along e1e_1, which is orthogonal to those normals.
    3. The two remaining faces. The face x=b1x = b_1 has n=e1n = e_1 and the face x=a1x = a_1 has n=−e1n = -e_1. Parametrize both by (y,z)(y, z) in the rectangle W=[a2,b2]×[a3,b3]W = [a_2, b_2]\times[a_3, b_3]. The flux is ∬W(αb1+βy+γz) dy dz−∬W(αa1+βy+γz) dy dz\iint_W(\alpha b_1 + \beta y + \gamma z)\,dy\,dz - \iint_W(\alpha a_1 + \beta y + \gamma z)\,dy\,dz.
    4. Cancel. The terms βy+γz\beta y + \gamma z are identical in the two integrals and cancel, leaving α(b1−a1)area⁡(W)=αVol⁡(V)\alpha(b_1 - a_1)\operatorname{area}(W) = \alpha\operatorname{Vol}(V). Width in xx times the area of the face is the volume of the box.

    Answer. Both sides are αVol⁡(V)\alpha\operatorname{Vol}(V). This is the box case of the proof above with the faces written out: the top and bottom of the proof are the faces x=b1x = b_1 and x=a1x = a_1 here, and the shared faces of neighbouring small boxes cancel in the general case.

    Why· The picture: the torus and the divergence

    In the picture at the top of the chapter the torus has flux 6π2Ra26\pi^2Ra^2 for F=(x,y,z)F = (x, y, z). Divergence 33 times volume 2π2Ra22\pi^2Ra^2. For the field (y,−x,z)(y, -x, z) the torus flux is 2π2Ra22\pi^2Ra^2, because its divergence is 0+0+1=10 + 0 + 1 = 1. For (0,0,1)(0, 0, 1) it is 00: the field enters through the bottom of the torus and leaves through the top in equal measure. Try all four fields on the torus in the picture and compare with div⁡F×volume\operatorname{div}F\times\text{volume}.

    Worked example MATH 376 Midterm 2 problem 4(a), 2 points; see [A.3](/vol2/a3-midterm-2/)
    State the divergence theorem, with all hypotheses.

    Solution.

    1. Region. Let E⊂R3E\subset\mathbb R^3 be a solid region whose boundary S=∂ES = \partial E is a piecewise smooth closed surface. Hypothesis on the region: ‘solid’ means bounded with an interior, ‘closed’ means no edge.
    2. Orientation. Let nn be the outward-pointing unit normal field on SS.
    3. Field. Let FF be a C1C^1 vector field on an open set containing EE. It must be defined and continuously differentiable on all of EE, boundary included.
    4. Conclusion. Then ∬SF⋅n dS=∭Ediv⁡F dV\iint_SF\cdot n\,dS = \iiint_E\operatorname{div}F\,dV, where div⁡F=∂xF1+∂yF2+∂zF3\operatorname{div}F = \partial_xF_1 + \partial_yF_2 + \partial_zF_3.

    Answer. The four lines in order: region, orientation, field, conclusion. The same pattern for Stokes’ theorem (practice Midterm 2 problem 4(a)): oriented surface, boundary orientation by the right-hand rule, C1C^1 field, conclusion.

    Worked example MATH 376 Final problem 2, 5 points (scored 4); see [A.4](/vol2/a4-final/)
    Compute the flux of F=(x3+sin⁡(yz), y3+exz, z3+cos⁡(xy))F = \big(\frac x3 + \sin(yz),\ \frac y3 + e^{xz},\ \frac z3 + \cos(xy)\big) through the surface max⁡(∣x∣,∣y∣,∣z∣)=1\max(\lvert x\rvert, \lvert y\rvert, \lvert z\rvert) = 1 with the outward normal.

    Solution.

    1. Read the surface. max⁡(∣x∣,∣y∣,∣z∣)=1\max(\lvert x\rvert, \lvert y\rvert, \lvert z\rvert) = 1 means ∣x∣,∣y∣,∣z∣≤1\lvert x\rvert, \lvert y\rvert, \lvert z\rvert\le1 with at least one equal to 11. The maximum is 11 exactly when no coordinate exceeds 11 in absolute value and one reaches it.
    2. Identify it. It is the surface of the solid cube E=[−1,1]3E = [-1, 1]^3, side 22, six faces. Sketch it before computing.
    3. Divergence. ∂x(x3+sin⁡(yz))=13\partial_x(\frac x3 + \sin(yz)) = \frac13, ∂y(y3+exz)=13\partial_y(\frac y3 + e^{xz}) = \frac13, ∂z(z3+cos⁡(xy))=13\partial_z(\frac z3 + \cos(xy)) = \frac13. So div⁡F=1\operatorname{div}F = 1. sin⁡(yz)\sin(yz) has no xx, exze^{xz} has no yy, cos⁡(xy)\cos(xy) has no zz.
    4. Hypotheses. EE is a solid, S=∂ES = \partial E is closed and piecewise smooth (six squares), nn is outward, and FF is C1C^1 on R3\mathbb R^3.
    5. Apply. ∬SF⋅n dS=∭E1 dV=Vol⁡(E)=2⋅2⋅2=8\iint_SF\cdot n\,dS = \iiint_E1\,dV = \operatorname{Vol}(E) = 2\cdot2\cdot2 = 8.
    6. Cross-check by faces. On x=1x = 1 with n=(1,0,0)n = (1, 0, 0), F⋅n=13+sin⁡(yz)F\cdot n = \frac13 + \sin(yz). On x=−1x = -1 with n=(−1,0,0)n = (-1, 0, 0), F⋅n=13−sin⁡(yz)F\cdot n = \frac13 - \sin(yz). The sin⁡(yz)\sin(yz) terms cancel when the two faces are added, leaving 2⋅13⋅4=832\cdot\frac13\cdot4 = \frac83. The other two pairs of faces also give 83\frac83, with exze^{xz} and cos⁡(xy)\cos(xy) cancelling. Total 88.

    Answer. 88. For max⁡(∣x∣,∣y∣,∣z∣)=2\max(\lvert x\rvert, \lvert y\rvert, \lvert z\rvert) = 2 the answer is 43=644^3 = 64. The trap about this problem is in the Traps section below.

    Worked example MATH 376 worksheet 17 problem 4 and worksheet 27 problem 11
    Find the flux of F=(2x+y, 3y+z, 4z+x)F = (2x + y,\ 3y + z,\ 4z + x) out of a closed surface enclosing a solid of volume 1010, and the flux of F=(x,y,z)F = (x, y, z) out of the ball of radius RR both ways.

    Solution.

    1. First field. div⁡F=2+3+4=9\operatorname{div}F = 2 + 3 + 4 = 9, constant. ∂x(2x+y)=2\partial_x(2x + y) = 2, ∂y(3y+z)=3\partial_y(3y + z) = 3, ∂z(4z+x)=4\partial_z(4z + x) = 4.
    2. Apply. The flux is 9⋅10=909\cdot10 = 90.
    3. Ball, by the theorem. div⁡(x,y,z)=3\operatorname{div}(x, y, z) = 3, so the flux is 3⋅43πR3=4πR33\cdot\frac43\pi R^3 = 4\pi R^3.
    4. Ball, directly. On the sphere n=(x,y,z)/Rn = (x, y, z)/R, so F⋅n=RF\cdot n = R, constant, and the flux is R⋅4πR2=4πR3R\cdot4\pi R^2 = 4\pi R^3. Constant F⋅nF\cdot n times the area.

    Answer. 9090 and 4πR34\pi R^3. If the divergence is a constant cc, the flux out of any closed surface is cc times the enclosed volume.

    Worked example MATH 376 homework 6 problems 2 and 3
    Use the divergence theorem to find the flux of F=(x3,y3,z3)F = (x^3, y^3, z^3) out of the sphere x2+y2+z2=a2x^2 + y^2 + z^2 = a^2, and of F=(x,y,z)F = (x, y, z) out of the boundary of V={0≤z≤4−x2−y2}V = \{0\le z\le4 - x^2 - y^2\}.

    Solution.

    1. First field, divergence. div⁡F=3x2+3y2+3z2=3ρ2\operatorname{div}F = 3x^2 + 3y^2 + 3z^2 = 3\rho^2 with ρ2=x2+y2+z2\rho^2 = x^2 + y^2 + z^2.
    2. Spherical coordinates. dV=ρ2sin⁡φ dρ dφ dθdV = \rho^2\sin\varphi\,d\rho\,d\varphi\,d\theta over the ball: ∫02π ⁣dθ∫0πsin⁡φ dφ∫0a3ρ2⋅ρ2 dρ\int_0^{2\pi}\!d\theta\int_0^\pi\sin\varphi\,d\varphi\int_0^a3\rho^2\cdot\rho^2\,d\rho. The integrand is a product of a function of ρ\rho, a function of φ\varphi and a constant in θ\theta, with constant limits, so it splits.
    3. Evaluate. 2π⋅2⋅3a55=12πa552\pi\cdot2\cdot\frac{3a^5}5 = \frac{12\pi a^5}5.
    4. Second field. div⁡F=3\operatorname{div}F = 3, and VV is bounded above by the paraboloid and below by the disc x2+y2≤4x^2 + y^2\le4 in z=0z = 0, so ∂V\partial V is closed. In cylindrical coordinates dV=r dz dr dθdV = r\,dz\,dr\,d\theta: 3∫02π ⁣∫02 ⁣∫04−r2r dz dr dθ=3⋅2π∫02(4r−r3) dr=3⋅2π⋅4=24π3\int_0^{2\pi}\!\int_0^2\!\int_0^{4 - r^2}r\,dz\,dr\,d\theta = 3\cdot2\pi\int_0^2(4r - r^3)\,dr = 3\cdot2\pi\cdot4 = 24\pi.

    Answer. 12πa55\dfrac{12\pi a^5}5 and 24π24\pi (three times the volume 8π8\pi).

    Your answerUse the divergence theorem to find the outward flux of F=(xy, yz, zx)F = (xy,\ yz,\ zx) through the surface of the cube [0,2]3[0, 2]^3.
    Your answerFind the outward flux of F=(x,2y,3z)F = (x, 2y, 3z) through the sphere of radius 33 centred at the origin.

    When the surface is not closed

    If SS is not closed, add flat pieces S′S' so that S∪S′S\cup S' bounds a solid, apply the theorem, and subtract the flux through S′S': flux through SS = flux through S∪S′S\cup S' minus flux through S′S' (with the outward normal on all of S∪S′S\cup S').

    Worked example MATH 376 worksheet 14 problem 7
    Find the flux of v=(x2,y2,z2)v = (x^2, y^2, z^2) out of the open box 0≤x,y,z≤10\le x, y, z\le1 with no lid (the lid is the face z=1z = 1).

    Solution.

    1. Close it. The full cube [0,1]3[0, 1]^3 has a closed boundary. div⁡v=2x+2y+2z\operatorname{div}v = 2x + 2y + 2z, and ∭[0,1]3(2x+2y+2z) dV=3⋅2⋅12=3\iiint_{[0,1]^3}(2x + 2y + 2z)\,dV = 3\cdot2\cdot\frac12 = 3. Each term integrates to 2⋅12⋅1⋅1=12\cdot\frac12\cdot1\cdot1 = 1.
    2. The lid. On z=1z = 1 the outward normal is (0,0,1)(0, 0, 1) and v⋅n=z2=1v\cdot n = z^2 = 1, so the flux through the lid is 1⋅area=11\cdot\text{area} = 1.
    3. Subtract. The flux through the open box is 3−1=23 - 1 = 2.

    Answer. 22. Gauss does not apply to the open box directly. This is the closing technique.

    Worked example new (compare 6.5, where the same flux is computed directly)
    Find the upward flux of F=(x,y,z)F = (x, y, z) through the cap z=4−x2−y2z = 4 - x^2 - y^2, z≥0z\ge0, by closing it with a disc.

    Solution.

    1. Close. The cap and the disc x2+y2≤4x^2 + y^2\le4 in the plane z=0z = 0 bound the solid VV under the paraboloid, with outward normal up on the cap and down on the disc.
    2. Volume integral. div⁡F=3\operatorname{div}F = 3 and Vol⁡(V)=∫02π ⁣∫02(4−r2)r dr dθ=2π⋅4=8π\operatorname{Vol}(V) = \int_0^{2\pi}\!\int_0^2(4 - r^2)r\,dr\,d\theta = 2\pi\cdot4 = 8\pi. So the flux out of the closed surface is 24π24\pi.
    3. Disc. On the bottom disc n=(0,0,−1)n = (0, 0, -1) and F⋅n=−z=0F\cdot n = -z = 0. z=0z = 0 there. So the disc contributes 00.
    4. Subtract. The cap’s flux is 24π−0=24π24\pi - 0 = 24\pi.

    Answer. 24π24\pi. In 6.5 the direct computation with N=(2s2cos⁡θ,2s2sin⁡θ,s)N = (2s^2\cos\theta, 2s^2\sin\theta, s) gives 2π∫02(s3+4s) ds=2π(4+8)=24π2\pi\int_0^2(s^3 + 4s)\,ds = 2\pi(4 + 8) = 24\pi, the same.

    Worked example MATH 376 worksheet 14 problem 8
    A sphere of radius 22 and the field v=r/∥r∥v = r/\lVert r\rVert (so v=nv = n on the sphere). Find the outward flux and the average divergence inside.

    Solution.

    1. Flux. On the sphere v⋅n=n⋅n=1v\cdot n = n\cdot n = 1, so the flux is the area 4π⋅22=16π4\pi\cdot2^2 = 16\pi.
    2. Average divergence. The volume of the ball is 43π⋅8=32π3\frac43\pi\cdot8 = \frac{32\pi}3. If the divergence theorem applied, the average divergence would be 16π32π/3=32\frac{16\pi}{32\pi/3} = \frac32.
    3. Check the singularity. div⁡(r/ρ)=2/ρ\operatorname{div}(r/\rho) = 2/\rho, which is not defined at the origin but is integrable: ∫022ρ 4πρ2 dρ=8π⋅42=16π\int_0^2\frac2\rho\,4\pi\rho^2\,d\rho = 8\pi\cdot\frac{4}{2} = 16\pi. The field is not C1C^1 at the origin, so the theorem as stated does not apply; the direct volume integral over the shells is what supports the value.

    Answer. Flux 16π16\pi and average divergence 32\frac32.

    Singular fields and the excised ball

    Worked example MATH 376 lecture of 4 March (the counterexample); new (the excision)
    Let G=(x,y,z)/ρ3G = (x, y, z)/\rho^3 with ρ=x2+y2+z2\rho = \sqrt{x^2 + y^2 + z^2}. Show div⁡G=0\operatorname{div}G = 0 away from the origin, and find the outward flux of GG through the unit sphere and through the surface of the cube [−1,1]3[-1, 1]^3.

    Solution.

    1. Divergence. ∂x(xρ−3)=ρ−3−3x2ρ−5\partial_x(x\rho^{-3}) = \rho^{-3} - 3x^2\rho^{-5}, and the same for yy and zz. Adding: 3ρ−3−3ρ2ρ−5=03\rho^{-3} - 3\rho^2\rho^{-5} = 0.
    2. Unit sphere. There n=(x,y,z)n = (x, y, z) and G⋅n=ρ2/ρ3=1G\cdot n = \rho^2/\rho^3 = 1, so the flux is 4π4\pi. The divergence theorem would predict 00, and it does not apply since GG is undefined at the origin, inside the ball.
    3. The cube. Let BεB_\varepsilon be the ball of radius ε<1\varepsilon<1 about the origin and EE the region between the sphere of radius ε\varepsilon and the cube. On EE the field is C1C^1 with div⁡G=0\operatorname{div}G = 0, so the flux out of ∂E\partial E is 00. The theorem applies to the region with the hole.
    4. Split the boundary. ∂E\partial E is the cube (outward normal) and the small sphere (with normal pointing into the hole, the outward normal of EE). So (flux out of the cube) −- (flux out of the small sphere) =0= 0.
    5. Small sphere. The flux out of the sphere of radius ε\varepsilon is 1ε2⋅4πε2=4π\frac1{\varepsilon^2}\cdot4\pi\varepsilon^2 = 4\pi.

    Answer. The flux through the cube is 4π4\pi, and the same for every closed surface that encloses the origin. Moving the origin outside the surface makes the flux 00. This is Gauss’s law for a point charge in 6.8.

    Worked example new (symmetry; the torus of 6.5)
    Find the outward flux of F=(x+yz, y+zx, z+xy)F = (x + yz,\ y + zx,\ z + xy) through the surface of the cube [−1,1]3[-1, 1]^3, and the flux of F=(x,y,z)F = (x, y, z) out of the torus with radii R>aR > a.

    Solution.

    1. Divergence. ∂x(x+yz)=1\partial_x(x + yz) = 1, ∂y(y+zx)=1\partial_y(y + zx) = 1, ∂z(z+xy)=1\partial_z(z + xy) = 1. So div⁡F=3\operatorname{div}F = 3, and the flux is 3⋅8=243\cdot8 = 24. The terms yzyz, zxzx, xyxy do not contain the variable being differentiated, so they drop out; face by face they cancel in pairs, as in the exam problem.
    2. Torus. The solid torus has volume 2π2Ra22\pi^2Ra^2 (cross-section area πa2\pi a^2 times the length 2πR2\pi R of the core circle, by Pappus; or ∫ ⁣ ⁣∫ ⁣ ⁣∫r dr dz dθ\int\!\!\int\!\!\int r\,dr\,dz\,d\theta) and div⁡F=3\operatorname{div}F = 3, so the flux is 6π2Ra26\pi^2Ra^2.
    3. Compare with 6.5. The direct computation in 6.5 with ru×rvr_u\times r_v gave ∬F⋅N=6π2Ra2\iint F\cdot N = 6\pi^2Ra^2. The two methods agree.

    Answer. 2424 and 6π2Ra26\pi^2Ra^2.

    Worked example MATH 376 lecture of 6 March, Example 5.19
    Use the divergence theorem to show that the volume of the ball of radius RR is 43πR3\frac43\pi R^3.

    Solution.

    1. Choose a field with divergence 11. F=13(x,y,z)F = \frac13(x, y, z), so div⁡F=13+13+13=1\operatorname{div}F = \frac13 + \frac13 + \frac13 = 1 and ∭E1 dV=Vol⁡(E)\iiint_E1\,dV = \operatorname{Vol}(E). Any field with divergence 11 would do; this one is symmetric.
    2. Flux through the sphere. On the sphere of radius RR, n=(x,y,z)/Rn = (x, y, z)/R so F⋅n=13RF\cdot n = \frac13R, constant. The area is 4πR24\pi R^2.
    3. Apply. Vol⁡(E)=13R⋅4πR2=43πR3\operatorname{Vol}(E) = \frac13R\cdot4\pi R^2 = \frac43\pi R^3. The area formula of 6.5 is used, so this is a check of that formula against the volume formula.

    Answer. 43πR3\frac43\pi R^3. The same idea gives the volume of any solid as 13∬r⋅n dS\frac13\iint r\cdot n\,dS.

    What divergence means, now proved

    Proposition B Apostol 12.20

    Divergence is flux per unit volume

    Let FF be C1C^1 near pp, BεB_\varepsilon the ball of radius ε\varepsilon about pp, Sε=∂BεS_\varepsilon = \partial B_\varepsilon with the outward normal. Then lim⁡ε→01Vol⁡(Bε)∬SεF⋅n dS=(div⁡F)(p)\displaystyle\lim_{\varepsilon\to0}\frac1{\operatorname{Vol}(B_\varepsilon)}\iint_{S_\varepsilon}F\cdot n\,dS = (\operatorname{div}F)(p).

    In one lineFor a C1C^1 field FF and a point pp, the outward flux of FF through the sphere SεS_\varepsilon of radius ε\varepsilon about pp, divided by the volume of the ball, tends to (div⁡F)(p)(\operatorname{div}F)(p) as ε→0\varepsilon\to0.

    Why it is trueIt is the definition-free meaning of divergence: net outflow per unit volume, the picture of the 'idea in words' made exact.

    The proof is the same as for the curl: the divergence theorem turns the flux into ∭Bεdiv⁡F dV\iiint_{B_\varepsilon}\operatorname{div}F\,dV, and since div⁡F\operatorname{div}F is continuous it differs from (div⁡F)(p)(\operatorname{div}F)(p) by less than any given η\eta on small balls, so the average over BεB_\varepsilon is within η\eta of (div⁡F)(p)(\operatorname{div}F)(p).

    Corollary A Apostol 12.15 exercises 12 and 14 (the tangent and normal forms of Green's theorem)

    Green's theorem in normal form

    With r(t)=(x(t),y(t))r(t) = (x(t), y(t)) counterclockwise, the outward unit normal is n=(y′,−x′)/∥r′∥n = (y', -x')/\lVert r'\rVert and ds=∥r′∥ dtds = \lVert r'\rVert\,dt. So ∮CF⋅n ds=∮C(P y′−Q x′) dt=∮C(−Q) dx+P dy\oint_CF\cdot n\,ds = \oint_C(P\,y' - Q\,x')\,dt = \oint_C(-Q)\,dx + P\,dy, and Green’s theorem for the pair (−Q,P)(-Q, P) gives ∬D(Px−(−Q)y) dA=∬D(Px+Qy) dA\iint_D(P_x - (-Q)_y)\,dA = \iint_D(P_x + Q_y)\,dA. For F=(x,y)F = (x, y) and the circle of radius RR: F⋅n=RF\cdot n = R, so the left side is R⋅2πR=2πR2R\cdot2\pi R = 2\pi R^2, and the right side is 2⋅πR22\cdot\pi R^2.

    In one lineFor a positively oriented Jordan curve CC bounding DD and a C1C^1 planar field F=(P,Q)F = (P, Q), ∮CF⋅n ds=∬D(Px+Qy) dA\oint_CF\cdot n\,ds = \iint_D(P_x + Q_y)\,dA, where nn is the outward unit normal and dsds is arc length.

    Why it is trueIt is the divergence theorem in two dimensions, and it shows that Green's theorem has two forms: one with curl and one with divergence.

    Quick checkA solid region has a closed boundary and the divergence of FF is −3-3 everywhere inside. Which is possible for the outward flux?
    Quick checkStokes' theorem relates the flux of a vector field through a closed surface to the divergence of the field in the volume enclosed. True or false?
    Quick checkWhich condition is the one that fails for F=r/ρ3F = r/\rho^3 on the unit ball when the divergence theorem is applied?
    Quick checkYou must compute the flux of a field with constant divergence 55 out of a cube of side 22 with a face missing. What do you do first?

    Which theorem, which side

    TheoremLeft sideRight sideOrientation rule
    Fundamental theorem for gradients (6.2)∫Cdφ\int_Cd\varphi along a pathφ(B)−φ(A)\varphi(B) - \varphi(A)direction A→BA\to B
    Green (plane)∮CP dx+Q dy\oint_CP\,dx + Q\,dy∬D(Qx−Py) dA\iint_D(Q_x - P_y)\,dACC counterclockwise
    Stokes (space)∮∂SF⋅dr\oint_{\partial S}F\cdot dr∬S(curl⁡F)⋅n dS\iint_S(\operatorname{curl}F)\cdot n\,dSright-hand rule between ∂S\partial S and nn
    Divergence (space)∬∂EF⋅n dS\iint_{\partial E}F\cdot n\,dS∭Ediv⁡F dV\iiint_E\operatorname{div}F\,dVnn outward

    Stokes with a flat SS in z=0z = 0 and n=(0,0,1)n = (0, 0, 1) is Green. Choosing the easy side:

    You are asked forAskThen
    a line integral around a closed curve in spaceDoes CC bound an easy surface (a disc, a polygon)? Is curl⁡F\operatorname{curl}F simpler than FF?Stokes with the simplest surface. If curl⁡F=0\operatorname{curl}F = 0 on a simply connected domain, the answer is 00.
    the flux of FF through a closed surfaceIs div⁡F\operatorname{div}F constant or simple? Is the solid easy to integrate over?Divergence theorem. If div⁡F=0\operatorname{div}F = 0 and FF is C1C^1 inside, the answer is 00.
    the flux of FF through an open surfaceCan I close it with flat pieces?Close, apply the theorem, subtract. Or compute directly with ru×rvr_u\times r_v (6.5).
    the flux of a curl through a surfaceIs it a curl? Where does the surface end?Stokes: it equals the circulation round the edge, and the answer depends only on the edge. The flux of a curl through a closed surface is 00.
    a field with a singular pointIs the singular point inside or outside?Outside: use the theorems. Inside: cut out a small ball (or disc) around it and use the theorem on the rest.
    symmetric regions and odd integrandsDoes the integrand change sign under x↦−xx\mapsto-x?The integral over a symmetric region is 00.
    Quick checkThe flux of curl⁡A\operatorname{curl}A through the surface of any solid is

    Where it is used

    Used inside maths· Inside maths: harmonic functions and the fundamental theorem of calculus

    If ∇2f=0\nabla^2f = 0 (a harmonic function) on a solid EE, then the flux of ∇f\nabla f out of ∂E\partial E is ∭Ediv⁡∇f dV=∭E∇2f dV=0\iiint_E\operatorname{div}\nabla f\,dV = \iiint_E\nabla^2f\,dV = 0. This is the first step in the proof that a harmonic function has no interior maximum and satisfies the mean value property: its average over a sphere equals its value at the centre. In one variable the divergence theorem on an interval [a,b][a, b] with ‘outward normal’ +1+1 at bb and −1-1 at aa reads f(b)−f(a)=∫abf′(x) dxf(b) - f(a) = \int_a^bf'(x)\,dx, the fundamental theorem. In two variables it is Green’s theorem in normal form. All of them say the integral of a derivative over a region is the integral of the function over its boundary, which is the single sentence of 6.7.

    Used in the real world· Used in the real world: the circulation of a hurricane

    Meteorologists model a hurricane’s winds by a Rankine vortex: inside the eyewall radius RR the air rotates rigidly with angular velocity Ω\Omega, and outside it the speed falls like 1/r1/r. Take R=30R = 30 km and the strongest wind 5050 m/s at the eyewall. Then Ω=50/30 000=1.67×10−3\Omega = 50/30\,000 = 1.67\times10^{-3} s−1^{-1}, so the vorticity inside the eyewall is 2Ω=3.3×10−32\Omega = 3.3\times10^{-3} s−1^{-1} (twice the angular velocity, from the example). Outside, v=ΩR2/rv = \Omega R^2/r and the curl is 00 (the field is the vortex of the picture). Stokes’ theorem gives the circulation around any loop enclosing the eyewall as ∮v⋅dr=vorticity×area=2Ω⋅πR2=2πRvmax⁡=2π⋅30 000⋅50=9.4×106\oint v\cdot dr = \text{vorticity}\times\text{area} = 2\Omega\cdot\pi R^2 = 2\pi Rv_{\max} = 2\pi\cdot30\,000\cdot50 = 9.4\times10^6 m2^2/s, and it is the same for every larger loop, because the extra area carries no vorticity. A forecaster who measures the winds around a loop of 100 km radius and finds the circulation 9.4×1069.4\times10^6 m2^2/s has measured the total spin of the core without going into it.

    The divergence theorem is the audit of conservation. If the velocity of an incompressible liquid in a pipe network is vv, then div⁡v=0\operatorname{div}v = 0, so the flux out of any closed surface is 00: what enters a junction leaves it. A leak detector that adds the measured flows ∬v⋅n dS\iint v\cdot n\,dS over the faces of a control volume and finds 0.0250.025 m3^3/s of net outflow from a cube of side 0.50.5 m, volume 0.1250.125 m3^3, has measured an average divergence of 0.20.2 s−1^{-1}: some of the liquid is appearing there, by a leak from outside or a source, at 0.20.2 per second per unit volume.

    Your answerA Rankine vortex has eyewall radius 3030 km and maximum wind 5050 m/s at the eyewall. What is the circulation (in m2^2/s) of the wind around a circle of radius 100100 km about the centre? Give the exact value in terms of π\pi.
    Python labThe divergence theorem on a lopsided surface, and when it fails
    import numpy as np
    
    a, b, c = 1.0, 1.3, 0.8                      # ellipsoid x^2/a^2 + y^2/b^2 + z^2/c^2 = 1
    def F(x, y, z):    return (x * y + z**2, y * z + x**2, z * x + y**2 + 0.5 * z**3)
    def divF(x, y, z): return y + z + x + 1.5 * z**2       # by hand: y + z + (x + 1.5 z^2)
    
    n = 400
    ph = (np.arange(n) + 0.5) * np.pi / n;  th = (np.arange(2 * n) + 0.5) * np.pi / n
    PH, TH = np.meshgrid(ph, th, indexing="ij"); w = (np.pi / n) ** 2
    x, y, z = a * np.sin(PH) * np.cos(TH), b * np.sin(PH) * np.sin(TH), c * np.cos(PH)
    N = (b * c * np.sin(PH)**2 * np.cos(TH), a * c * np.sin(PH)**2 * np.sin(TH), a * b * np.sin(PH) * np.cos(PH))  # r_phi x r_theta, outward
    flux = sum(f * m for f, m in zip(F(x, y, z), N)).sum() * w
    
    m = 200                                      # inside: x = a t sin(ph) cos(th) ..., Jacobian a b c t^2 sin(ph)
    t = (np.arange(m) + 0.5) / m
    T, P2, T2 = np.meshgrid(t, ph[::2], th[::2], indexing="ij")
    X, Y, Z = a * T * np.sin(P2) * np.cos(T2), b * T * np.sin(P2) * np.sin(T2), c * T * np.cos(P2)
    vol = (divF(X, Y, Z) * a * b * c * T**2 * np.sin(P2)).sum() * (1 / m) * (2 * np.pi / n) ** 2
    print("flux out of the ellipsoid :", round(flux, 5))
    print("integral of div F inside  :", round(vol, 5))
    
    def point_source(x0):                        # F = (r - x0)/|r - x0|^3, flux through the unit sphere (n = position)
        X0, Y0, Z0 = x0; k = 400
        p = (np.arange(k) + 0.5) * np.pi / k; q = (np.arange(2 * k) + 0.5) * np.pi / k
        A, B = np.meshgrid(p, q, indexing="ij")
        nx, ny, nz = np.sin(A) * np.cos(B), np.sin(A) * np.sin(B), np.cos(A)
        dx, dy, dz = nx - X0, ny - Y0, nz - Z0; d3 = (dx**2 + dy**2 + dz**2) ** 1.5
        return ((dx * nx + dy * ny + dz * nz) / d3 * np.sin(A)).sum() * (np.pi / k) ** 2
    for x0 in [(0, 0, 0), (0.5, 0.2, 0), (2, 0, 0)]:
        print("source at", x0, ":", round(point_source(x0), 4))
    print("4 pi =", round(4 * np.pi, 4))

    Try this. Run it. The flux of the field out of the ellipsoid (computed from a grid of 320000 small patches) and the integral of the divergence over its inside (computed with 200 by 200 by 400 small boxes) agree to about four digits, 0.8364. Neither is a number you could guess, and they match, so the divergence theorem is doing real work here. The second part uses the field of a point source, F = (x, y, z) divided by its distance cubed, with the source at x0 and the unit sphere around the origin: a source at the centre gives 4*pi = 12.566. Move the source to (0.5, 0.2, 0), still inside, and the flux is the same 12.566. Move it outside, to (2, 0, 0), and the flux is 0. The divergence is 0 everywhere except at the source, so the flux only counts the sources inside. Try the source at (0.99, 0, 0), barely inside, and at (1.01, 0, 0), barely outside, and see how sharply the flux changes. Change a, b, c, or the field F and its divergence (compute the divergence by hand first).

    Traps

    Watch out· Name the theorem you are using, and the right one

    Stokes’ theorem is about a surface with an edge: circulation round the edge equals flux of the curl. The divergence theorem is about a closed surface: flux through the skin equals the integral of the divergence inside. A statement such as ‘Stokes’ theorem relates the flux through a closed surface to the divergence in the volume enclosed’ (practice Final problem 7(d)) describes the divergence theorem and is false for Stokes. Write which theorem and why its hypotheses hold before you use it.

    Watch out· Read the set literally and sketch it

    On the 376 final, a student read the set max⁡(∣x∣,∣y∣,∣z∣)=1\max(\lvert x\rvert, \lvert y\rvert, \lvert z\rvert) = 1 of problem 2 as a unit cube in the first octant, because the absolute values were dropped, and their answer was 11 instead of 88 (4 of 5 points). The set is the surface of the cube [−1,1]3[-1, 1]^3, of side 22. Their own computation was consistent for the cube they drew, so the slip was in reading the problem, and the regrade request was declined for that reason. Sketch the set before choosing a method, and say in words what it is. On that problem the structure of the field was also a hint: the terms x/3x/3, y/3y/3, z/3z/3 give divergence 11 and the other terms drop out, which points straight at the divergence theorem.

    Watch out· Hypotheses are part of the answer

    Stokes needs FF to be C1C^1 on an open set containing the whole surface SS, the inside included, not only the curve. The divergence theorem needs FF to be C1C^1 on all of the solid. A field with a singularity inside (the angle field for Stokes, r/ρ3r/\rho^3 for Gauss) can have curl or divergence 00 and still have a non-zero circulation or flux. The marks in a ‘state the theorem’ question are for the hypotheses: solid region, closed piecewise smooth boundary, outward normal, C1C^1 on a neighbourhood.

    Watch out· Check orientation: the right-hand rule, and outward

    The boundary direction in Stokes and the normal must be linked by the right-hand rule, and the divergence theorem needs the outward normal. If you reverse one and not the other the answer has the wrong sign. For ‘counterclockwise from above’ use the upward normal; for ‘counterclockwise as viewed from the direction of (1,1,1)(1, 1, 1)’ use the normal pointing toward that viewer. Reversing both the surface orientation and the curve keeps the equation true.

    Watch out· Compute the whole curl, with the flipped middle sign

    The middle component of the curl is Pz−RxP_z - R_x. A wrong sign there is invisible when the normal is (0,0,1)(0, 0, 1), because only the third component is used, and it ruins a problem with a tilted normal. Write all three differences with their partial derivatives, and test the formula on a field you know (F=(z,0,0)F = (z, 0, 0) should have curl (0,1,0)(0, 1, 0)).

    Problems

    checknew (MATH 376 worksheet 13 style)

    Compute the curl and the divergence of F=(x2y, y2z, z2x)F = (x^2y,\ y^2z,\ z^2x).

    Solution

    P=x2yP = x^2y, Q=y2zQ = y^2z, R=z2xR = z^2x. Curl: Ry−Qz=0−y2=−y2R_y - Q_z = 0 - y^2 = -y^2; Pz−Rx=0−z2=−z2P_z - R_x = 0 - z^2 = -z^2; Qx−Py=0−x2=−x2Q_x - P_y = 0 - x^2 = -x^2. So curl⁡F=(−y2,−z2,−x2)\operatorname{curl}F = (-y^2, -z^2, -x^2). Divergence: Px+Qy+Rz=2xy+2yz+2zxP_x + Q_y + R_z = 2xy + 2yz + 2zx.

    checknew (identities)

    For f=x2+y2+z2f = x^2 + y^2 + z^2 compute curl⁡(∇f)\operatorname{curl}(\nabla f) and div⁡(∇f)\operatorname{div}(\nabla f).

    Solution

    ∇f=(2x,2y,2z)\nabla f = (2x, 2y, 2z). The curl is (0−0, 0−0, 0−0)=0(0 - 0,\ 0 - 0,\ 0 - 0) = 0, as it must be for any gradient. The divergence is 2+2+2=6=∇2f2 + 2 + 2 = 6 = \nabla^2f.

    checkMATH 376 practice Final problem 7(c)

    True or false: if f,gf, g are C2C^2 vector fields on R3\mathbb R^3, then div⁡(f+g)=div⁡f+div⁡g\operatorname{div}(f + g) = \operatorname{div}f + \operatorname{div}g.

    Solution

    True. Write f=(f1,f2,f3)f = (f_1, f_2, f_3), g=(g1,g2,g3)g = (g_1, g_2, g_3). div⁡(f+g)=∂x(f1+g1)+∂y(f2+g2)+∂z(f3+g3)\operatorname{div}(f + g) = \partial_x(f_1 + g_1) + \partial_y(f_2 + g_2) + \partial_z(f_3 + g_3), and a partial derivative of a sum is the sum of the partial derivatives, so this is div⁡f+div⁡g\operatorname{div}f + \operatorname{div}g.

    checkMATH 376 homework 6 problem 4 (statement 1)

    True or false: reversing the orientation of SS in Stokes’ theorem keeps the equation true.

    Solution

    True. Reversing the orientation replaces nn by −n-n, so the surface integral changes sign. The right-hand rule then requires the opposite direction on ∂S\partial S, so the line integral also changes sign. Both sides flip.

    checkMATH 376 homework 6 problem 4 (statements 3 and 4)

    True or false: (a) if F=∇fF = \nabla f then ∮CF⋅dα=0\oint_CF\cdot d\alpha = 0 for every closed curve CC. (b) The divergence theorem says that for a closed piecewise smooth surface SS bounding a solid EE, with outward normal nn and FF of class C1C^1 on a neighbourhood of EE, ∬SF⋅n dS=∭Ediv⁡F dV\iint_SF\cdot n\,dS = \iiint_E\operatorname{div}F\,dV.

    Solution

    (a) True. By the fundamental theorem for line integrals (6.2) ∮C∇f⋅dα=f(end)−f(start)=0\oint_C\nabla f\cdot d\alpha = f(\text{end}) - f(\text{start}) = 0 on a closed curve. It also follows from Stokes, since curl⁡∇f=0\operatorname{curl}\nabla f = 0 whenever CC bounds a surface. (b) True, this is the theorem as stated above, with all four hypotheses (the exact wording in the original homework is not in the sources, so compare it with your copy).

    useMATH 376 homework 6 problem 4 (statements 2 and 5)

    True or false: (a) the integral ∬S(curl⁡F)⋅n dS\iint_S(\operatorname{curl}F)\cdot n\,dS depends only on the area of SS. (b) The flux of FF through SS depends only on the area of SS.

    Solution

    Both false. (a) Take F=(0,x,0)F = (0, x, 0), so curl⁡F=(0,0,1)\operatorname{curl}F = (0, 0, 1). The flat unit disc in the xyxy-plane with n=(0,0,1)n = (0, 0, 1) gives (curl⁡F)⋅n=1(\operatorname{curl}F)\cdot n = 1 and the integral π\pi. The flat unit disc in the yzyz-plane with n=(1,0,0)n = (1, 0, 0) has the same area and (curl⁡F)⋅n=0(\operatorname{curl}F)\cdot n = 0, so the integral 00. (b) Take F=(0,0,1)F = (0, 0, 1). A disc of area AA in the xyxy-plane with n=(0,0,1)n = (0, 0, 1) has flux AA, and the same disc in the yzyz-plane with n=(1,0,0)n = (1, 0, 0) has flux 00. Direction matters.

    useMATH 376 worksheet 14 problem 5 style

    Use Stokes’ theorem to compute the work of F=(x2,2x,z)F = (x^2, 2x, z) around the boundary CC of the square [0,1]2[0, 1]^2 in the plane z=0z = 0, counterclockwise from above. Check by a line integral.

    Solution

    P=x2P = x^2, Q=2xQ = 2x, R=zR = z. curl⁡F=(0−0, 0−0, 2−0)=(0,0,2)\operatorname{curl}F = (0 - 0,\ 0 - 0,\ 2 - 0) = (0, 0, 2). With SS the flat square, n=(0,0,1)n = (0, 0, 1): the circulation is 2⋅area⁡=22\cdot\operatorname{area} = 2. Check: bottom (y=0y = 0, r=(t,0)r = (t, 0)) F⋅r′=t2F\cdot r' = t^2, integral 13\frac13; right (r=(1,t)r = (1, t)) F=(1,2,0)F = (1, 2, 0), r′=(0,1,0)r' = (0, 1, 0), integral 22; top (r=(1−t,1)r = (1 - t, 1), r′=(−1,0,0)r' = (-1, 0, 0)) F⋅r′=−(1−t)2F\cdot r' = -(1 - t)^2, integral −13-\frac13; left (r=(0,1−t)r = (0, 1 - t)) F=(0,0,0)F = (0, 0, 0), integral 00. Total 13+2−13+0=2\frac13 + 2 - \frac13 + 0 = 2.

    usenew (divergence theorem with a paraboloid, compare homework 6 problem 3)

    Find the outward flux of F=(x3,y3,z3)F = (x^3, y^3, z^3) through the surface of the solid cylinder x2+y2≤1x^2 + y^2\le1, 0≤z≤20\le z\le2 (both discs included).

    Solution

    div⁡F=3x2+3y2+3z2\operatorname{div}F = 3x^2 + 3y^2 + 3z^2. In cylindrical coordinates ∭(3r2+3z2) r dz dr dθ=2π∫01 ⁣∫02(3r3+3z2r) dz dr=2π∫01(6r3+8r) dr=2π(64+4)=11π\iiint(3r^2 + 3z^2)\,r\,dz\,dr\,d\theta = 2\pi\int_0^1\!\int_0^2(3r^3 + 3z^2r)\,dz\,dr = 2\pi\int_0^1(6r^3 + 8r)\,dr = 2\pi\big(\frac64 + 4\big) = 11\pi.

    usenew (closing a surface)

    Find the upward flux of F=(x,y,1)F = (x, y, 1) through the upper unit hemisphere x2+y2+z2=1x^2 + y^2 + z^2 = 1, z≥0z\ge0, by closing it with the unit disc in z=0z = 0.

    Solution

    div⁡F=2\operatorname{div}F = 2, the solid half-ball has volume 2π3\frac{2\pi}3, so the flux out of the closed surface is 4π3\frac{4\pi}3. The bottom disc has n=(0,0,−1)n = (0, 0, -1) and F⋅n=−1F\cdot n = -1, so its flux is −π-\pi. The hemisphere’s flux is 4π3−(−π)=7π3\frac{4\pi}3 - (-\pi) = \frac{7\pi}3.

    usenew (a field and its curl: Stokes on a curved surface)

    Let F=(z,x,y)F = (z, x, y) and let SS be the part of the paraboloid z=4−x2−y2z = 4 - x^2 - y^2 with z≥0z\ge0, upward normal. Find the flux of curl⁡F\operatorname{curl}F through SS by Stokes, and check it directly.

    Solution

    curl⁡F=(1,1,1)\operatorname{curl}F = (1, 1, 1). The boundary is the circle x2+y2=4x^2 + y^2 = 4, z=0z = 0, counterclockwise from above. Use the flat disc: n=(0,0,1)n = (0, 0, 1), (curl⁡F)⋅n=1(\operatorname{curl}F)\cdot n = 1, so the flux is 4π4\pi. Directly on the paraboloid: N=(2x,2y,1)N = (2x, 2y, 1), (curl⁡F)⋅N=2x+2y+1(\operatorname{curl}F)\cdot N = 2x + 2y + 1, and the integral over x2+y2≤4x^2 + y^2\le4 is 0+0+4π=4π0 + 0 + 4\pi = 4\pi. Along the circle: α=(2cos⁡t,2sin⁡t,0)\alpha = (2\cos t, 2\sin t, 0), F=(0,2cos⁡t,2sin⁡t)F = (0, 2\cos t, 2\sin t), α′=(−2sin⁡t,2cos⁡t,0)\alpha' = (-2\sin t, 2\cos t, 0), F⋅α′=4cos⁡2tF\cdot\alpha' = 4\cos^2t, integral 4π4\pi.

    proveMATH 376 homework 5 problem 5

    Prove that div⁡\operatorname{div} and curl⁡\operatorname{curl} are linear, and that div⁡curl⁡F=0\operatorname{div}\operatorname{curl}F = 0 for C2C^2 fields FF.

    Solution

    Let F=(P1,Q1,R1)F = (P_1, Q_1, R_1), G=(P2,Q2,R2)G = (P_2, Q_2, R_2) and a,ba, b real. div⁡(aF+bG)=∂x(aP1+bP2)+∂y(aQ1+bQ2)+∂z(aR1+bR2)\operatorname{div}(aF + bG) = \partial_x(aP_1 + bP_2) + \partial_y(aQ_1 + bQ_2) + \partial_z(aR_1 + bR_2), and each partial derivative is linear, so this equals adiv⁡F+bdiv⁡Ga\operatorname{div}F + b\operatorname{div}G. The first component of curl⁡(aF+bG)\operatorname{curl}(aF + bG) is ∂y(aR1+bR2)−∂z(aQ1+bQ2)=a(R1,y−Q1,z)+b(R2,y−Q2,z)\partial_y(aR_1 + bR_2) - \partial_z(aQ_1 + bQ_2) = a(R_{1,y} - Q_{1,z}) + b(R_{2,y} - Q_{2,z}), and the other two components are the same with the letters cycled. For the last claim see the proof in the section on identities: expand and apply the equality of mixed partials (this uses C2C^2).

    provenew (circulation is path independent: Stokes shows the surface does not matter)

    Let S1S_1 and S2S_2 be two oriented surfaces with the same boundary curve CC, with orientations inducing the same direction on CC. Show that ∬S1(curl⁡F)⋅n dS=∬S2(curl⁡F)⋅n dS\iint_{S_1}(\operatorname{curl}F)\cdot n\,dS = \iint_{S_2}(\operatorname{curl}F)\cdot n\,dS for C1C^1 fields FF defined on both. Deduce that the flux of a curl through a closed surface is 00.

    Solution

    By Stokes, both integrals equal ∮CF⋅dr\oint_CF\cdot dr. For a closed surface SS, cut it along a closed curve CC into two surfaces S1S_1 and S2S_2 whose outward orientations induce opposite directions on CC. The flux through SS is the flux through S1S_1 plus that through S2S_2, which equals the circulation along CC in one direction plus the circulation in the other, so 00. (Or: it is ∭div⁡curl⁡F dV=0\iiint\operatorname{div}\operatorname{curl}F\,dV = 0 by the divergence theorem.)

    provenew (flux of a gradient)

    If ∇2f=0\nabla^2f = 0 on a solid EE with closed boundary SS (and ff is C2C^2), show that ∬S∇f⋅n dS=0\iint_S\nabla f\cdot n\,dS = 0. Is the converse true?

    Solution

    By the divergence theorem the flux is ∭Ediv⁡∇f dV=∭E∇2f dV=0\iiint_E\operatorname{div}\nabla f\,dV = \iiint_E\nabla^2f\,dV = 0. The converse is false for a single solid: the flux can be 00 while ∇2f\nabla^2f is positive in one part of EE and negative in another (the integral of ∇2f\nabla^2f over EE is 00 while ∇2f\nabla^2f is not).

    provenew (area from Green in normal form)

    Use Green’s theorem in normal form with F=(x,y)F = (x, y) to show that the area of a region DD bounded by a positively oriented curve CC is 12∮CF⋅n ds\frac12\oint_CF\cdot n\,ds. Check for the ellipse x=acos⁡tx = a\cos t, y=bsin⁡ty = b\sin t.

    Solution

    With F=(x,y)F = (x, y), Px+Qy=2P_x + Q_y = 2, so ∮CF⋅n ds=2area⁡(D)\oint_CF\cdot n\,ds = 2\operatorname{area}(D). For the ellipse, n ds=(y′,−x′) dt=(bcos⁡t,asin⁡t) dtn\,ds = (y', -x')\,dt = (b\cos t, a\sin t)\,dt and F⋅n ds=(abcos⁡2t+absin⁡2t) dt=ab dtF\cdot n\,ds = (ab\cos^2t + ab\sin^2t)\,dt = ab\,dt, so 12∮=12ab⋅2π=πab\frac12\oint = \frac12ab\cdot2\pi = \pi ab.

    stretchnew (Gauss's law for several sources, compare 6.8)

    Let G1=(r−p1)/∣r−p1∣3G_1 = (r - p_1)/\lvert r - p_1\rvert^3 and G2=(r−p2)/∣r−p2∣3G_2 = (r - p_2)/\lvert r - p_2\rvert^3 be two point sources at p1p_1 and p2p_2, and SS a closed surface through neither. Show that the outward flux of G1+2G2G_1 + 2G_2 through SS is 4π4\pi times (the number of sources inside weighted by 11 and 22).

    Solution

    Each GiG_i has divergence 00 away from pip_i and is C1C^1 there. For a source outside SS the divergence theorem applies on the solid inside and the flux is 00. For a source inside, remove a small ball around it; the theorem on the rest gives that the flux through SS equals the flux through the small sphere, which is 4π4\pi as computed in the text. Flux is linear in the field, so the flux of G1+2G2G_1 + 2G_2 is 4π(ϵ1+2ϵ2)4\pi(\epsilon_1 + 2\epsilon_2) where ϵi=1\epsilon_i = 1 if pip_i is inside and 00 if outside.

    stretchnew (vorticity, compare worksheet 14 problem 1)

    A velocity field is v=(−ωy, ωx, 0)v = (-\omega y,\ \omega x,\ 0) with ω\omega a constant. Find the circulation of vv around the circle of radius ρ\rho in the xyxy-plane, directly and by Stokes, and compare with the vorticity.

    Solution

    Directly: r=(ρcos⁡t,ρsin⁡t,0)r = (\rho\cos t, \rho\sin t, 0), v⋅r′=ωρ2v\cdot r' = \omega\rho^2, circulation 2πωρ22\pi\omega\rho^2. By Stokes: curl⁡v=(0,0,2ω)\operatorname{curl}v = (0, 0, 2\omega), flux through the disc 2ω⋅πρ22\omega\cdot\pi\rho^2. The vorticity 2ω2\omega is twice the angular velocity, and circulation divided by area is 2ω2\omega.

    Summary

    • Curl =(Ry−Qz, Pz−Rx, Qx−Py)= (R_y - Q_z,\ P_z - R_x,\ Q_x - P_y), the determinant with ∇\nabla in the second row, with the flipped middle sign. It is circulation per unit area about the axis, and a paddle wheel spins at half of curl⁡F⋅n\operatorname{curl}F\cdot n. Divergence =Px+Qy+Rz= P_x + Q_y + R_z is flux per unit volume.
    • curl⁡∇f=0\operatorname{curl}\nabla f = 0 and div⁡curl⁡F=0\operatorname{div}\operatorname{curl}F = 0 for C2C^2 data, both because mixed partials are equal. The converses hold on simply connected or star-shaped domains and fail on domains with holes: the angle field and r/ρ3r/\rho^3.
    • Stokes: ∮∂SF⋅dr=∬Scurl⁡F⋅n dS\oint_{\partial S}F\cdot dr = \iint_S\operatorname{curl}F\cdot n\,dS, with ∂S\partial S and nn linked by the right-hand rule and FF of class C1C^1 on all of SS. Proof for a graph: Green plus the chain rule, with the second derivatives of gg cancelling.
    • To use Stokes, name the surface, the normal, the boundary orientation, the field, check the hypotheses, compute the full curl, dot, integrate. Never take the curl of a field restricted to the curve or the surface. ‘Deduce’ means specialize.
    • Divergence theorem: ∬∂EF⋅n dS=∭Ediv⁡F dV\iint_{\partial E}F\cdot n\,dS = \iiint_E\operatorname{div}F\,dV, closed surface, outward normal, FF of class C1C^1 on all of EE. Proof: Fubini and the fundamental theorem of calculus in each direction. Read the set literally (a max-norm sphere is a cube).
    • Close an open surface with flat pieces and subtract their flux. Cut a small ball around a singular point. If the divergence is a constant cc, the flux is cc times the volume.
    • Green, Stokes and Gauss are one idea, the fundamental theorem of calculus one dimension higher: the integral of a derivative over a region is the integral of the function over its boundary, because inner boundaries cancel. 6.7 states it for all dimensions.

    Watch and read

    The same ideas explained by someone else. Use these when an explanation here does not land.

    Where this sits

    Comes from
    5.5 Higher partial derivatives and the equality of mixed partials
    6.2 Gradient fields and potentials
    6.4 Green's theorem and change of variables
    6.5 Surfaces, area and flux
    Leads to
    6.7 Differential forms and the one big theorem
    6.8 Maxwell's equations, conservation laws and heat
    Same idea elsewhere
    MATH 376: Week 7, Apostol 12.11 to 12.20: the end of the multivariable half of the course and Midterm 2 problems 3 and 4. Everything is worked below: computing curl and divergence (worksheet 13 problems 1, 2 and 7, worksheet 14 problems 1 and 2, worksheet 28 problem 8), the identities div curl = 0 and curl grad = 0 (homework 5 problem 5), Stokes with a disc, a triangle, a circle and a curved surface (Midterm 2 problem 3, practice Midterm 2 problem 3, worksheet 13 problem 8, worksheet 14 problem 5, worksheet 27 problem 10, homework 6 problem 1), Ampere's law (worksheet 14 problem 6), the mistake of taking the curl of a restricted field (Final problem 3), the deduction of Green's theorem from Stokes' theorem (Midterm 2 problem 4(b)) and the area of a parallelogram from Stokes (practice Midterm 2 problem 4(b)), the divergence theorem for a cube, a ball, a paraboloid solid, and an open box (Final problem 2, Midterm 2 problem 4(a), worksheet 14 problems 7 and 8, worksheets 17 and 27, homework 6 problems 2 and 3), and the true or false questions (homework 5 problem 4, homework 6 problem 4, practice Final problems 7(c) and 7(d)).
    MATH 521 and 561: Both theorems are the same statement, the generalized Stokes theorem of 6.7: the integral of d omega over a region is the integral of omega over its boundary. 561 proves it on manifolds with boundary.
    MATH 322 and PHYS 322: Gauss's law, Faraday's law and Ampere's law are these two theorems applied to the electric and magnetic fields, and Maxwell's equations in 6.8 are their local forms.
    Fluid mechanics and weather: Vorticity is the curl of the velocity field, and the circulation around a hurricane's eye is computed with Stokes' theorem. Incompressible flow is divergence zero, and the divergence theorem is the statement that what flows into a region flows out.