Ran Wei/ Calculus/Module 20
中文
Calculus · Part V · Several variables

Module 20Vector calculus

Do calculus with vector fields, the arrows of wind, flowing water, gravity and electricity. You will integrate fields along curves and over surfaces, measure how a flow turns and spreads with curl and divergence, and meet Green’s theorem, Stokes’ theorem and the divergence theorem, which turn out to be the Fundamental Theorem of Calculus in new forms.

⏱ 270 minYou need: Modules 1 to 19, especially the Fundamental Theorem of Calculus (Module 10), vectors, the dot and cross products and vector functions (Module 16), partial derivatives and the gradient (Module 17) and double and triple integrals (Module 19)

In this module you will

  • Draw and read vector fields in the plane and in space, and recognise gradient fields
  • Compute line integrals of functions and of vector fields, and explain how they depend on the curve and its direction
  • Test whether a field is conservative, find a potential, and evaluate line integrals with the fundamental theorem for line integrals
  • State Green’s theorem with its hypotheses, prove it for simple regions, and use it for circulation, flux and area
  • Compute curl, divergence, surface areas, surface integrals and flux, and explain what curl and divergence measure
  • State Stokes’ theorem and the divergence theorem, check them on examples, and explain the one pattern behind all the fundamental theorems
1

Vector fields

A weather map shows the wind as arrows: at each place an arrow points the way the wind blows, and its length shows how fast. The velocity of the water in a river, the pull of the Earth’s gravity and the electric field around a charged particle are of the same kind: each attaches a vector, a direction and a size, to every point of a region.

This last module integrates such fields along curves (the work done by a force along a path) and over surfaces (the rate at which a fluid flows through a net), and differentiates them, to measure how much a flow turns and how much it spreads out. Its main theorems, Green’s theorem, Stokes’ theorem and the divergence theorem, are the Fundamental Theorem of Calculus of Module 10 in new forms (Section 20.8).

Definition 20.1Vector field

Let DD be a set of points in the plane. A vector field on DD is a function F\vb{F} that assigns to each point (x,y)(x, y) of DD a vector

F(x,y)=⟨P(x,y),Q(x,y)⟩=P i+Q j.\begin{aligned} \vb{F}(x, y) &= \big\langle P(x, y), Q(x, y)\big\rangle \\ &= P\,\vb{i} + Q\,\vb{j}. \end{aligned}

A vector field on a set EE of points in space assigns to each point (x,y,z)(x, y, z) of EE a vector F(x,y,z)=⟨P,Q,R⟩.\vb{F}(x, y, z) = \langle P, Q, R\rangle\mathclose{\text{.}} The functions P,P\mathclose{\text{,}} QQ and R,R\mathclose{\text{,}} whose values are numbers, are the components of F.\vb{F}\mathclose{\text{.}}

F(x,y)\vb{F}(x, y) reads “F of x, y”. A function whose values are numbers, such as the temperature of a metal plate, is called a scalar field when it must be kept apart from vector fields. To draw a vector field, draw the arrow F(x,y)\vb{F}(x, y) with its tail at (x,y),(x, y)\mathclose{\text{,}} for the points of a grid, all shortened by the same factor so that they do not overlap.

Example 20.1Rotation and source✓ Checked

Describe the vector fields F(x,y)=⟨−y,x⟩\vb{F}(x, y) = \langle -y, x\rangle and G(x,y)=⟨x,y⟩.\vb{G}(x, y) = \langle x, y\rangle\mathclose{\text{.}}

Start with numbers:

Point F=⟨−y,x⟩\vb{F} = \langle -y, x\rangle G=⟨x,y⟩\vb{G} = \langle x, y\rangle
(1,0)(1, 0) ⟨0,1⟩\langle 0, 1\rangle ⟨1,0⟩\langle 1, 0\rangle
(0,1)(0, 1) ⟨−1,0⟩\langle -1, 0\rangle ⟨0,1⟩\langle 0, 1\rangle
(−1,0)(-1, 0) ⟨0,−1⟩\langle 0, -1\rangle ⟨−1,0⟩\langle -1, 0\rangle
(0,−1)(0, -1) ⟨1,0⟩\langle 1, 0\rangle ⟨0,−1⟩\langle 0, -1\rangle
(2,2)(2, 2) ⟨−2,2⟩\langle -2, 2\rangle ⟨2,2⟩\langle 2, 2\rangle

At (1,0),(1, 0)\mathclose{\text{,}} F\vb{F} points straight up; a quarter turn further round, at (0,1),(0, 1)\mathclose{\text{,}} it points left. In general F(x,y)⋅⟨x,y⟩=−yx+xy=0,\vb{F}(x, y)\cdot\langle x, y\rangle = -yx + xy = 0\mathclose{\text{,}} so away from the origin F\vb{F} is perpendicular to the position vector ⟨x,y⟩:\langle x, y\rangle\mathclose{\text{:}} it is tangent to the circle through (x,y)(x, y) centred at the origin, and points anticlockwise round it. Its length, y2+x2,\sqrt{y^2 + x^2}\mathclose{\text{,}} is the distance from the origin. So F\vb{F} is the velocity field of a wheel turning anticlockwise at one radian per second (Figure 20.1, left).

G\vb{G} points straight away from the origin, again with length equal to the distance from the origin. A flow with velocity G\vb{G} spreads out everywhere, since points further from the origin move outwards faster. This is an example of a source field. Its opposite, −G=⟨−x,−y⟩,-\vb{G} = \langle -x, -y\rangle\mathclose{\text{,}} gathers inwards and is an example of a sink field. Both fields are zero at the origin.

By Newton’s law of gravitation, a point mass M>0M > 0 at the origin pulls a mass m>0m > 0 at position r=⟨x,y,z⟩≠0\vb{r} = \langle x, y, z\rangle \ne \vb{0} with the force

F(x,y,z)=−GMm∥r∥3 r,\vb{F}(x, y, z) = -\frac{GMm}{\norm{\vb{r}}^3}\,\vb{r},

where GG is the gravitational constant. The force points towards the origin (the minus sign), and its length is GMm/∥r∥2:GMm/\norm{\vb{r}}^2\mathclose{\text{:}} twice as far away, a quarter of the pull. Such an inverse square field (Figure 20.1, middle) also gives the electric field of a charged particle, by Coulomb’s law.

Module 17 met vector fields without the name: the gradient ∇f=⟨fx,fy⟩\nabla f = \langle f_x, f_y\rangle of a differentiable function f(x,y)f(x, y) is a vector field, the gradient field of f.f\mathclose{\text{.}} Where ∇f\nabla f is nonzero, it points in the direction in which ff increases fastest, and its length is that rate of increase. At a zero gradient all directional derivatives are zero. Along any differentiable level curve, the gradient is perpendicular to its tangent vector by the chain rule.

Example 20.2A gradient field✓ Checked

Find the gradient field of f(x,y)=x2+2y2,f(x, y) = x^2 + 2y^2\mathclose{\text{,}} and check at the point (2,1)(2, 1) that it is perpendicular to the level curve of ff through that point.

∇f(x,y)=⟨2x,4y⟩,\nabla f(x, y) = \langle 2x, 4y\rangle\mathclose{\text{,}} so ∇f(2,1)=⟨4,4⟩.\nabla f(2, 1) = \langle 4, 4\rangle\mathclose{\text{.}} The level curve through (2,1)(2, 1) is the ellipse x2+2y2=6.x^2 + 2y^2 = 6\mathclose{\text{.}} Implicit differentiation (Section 6.4) gives 2x+4y y′=0,2x + 4y\,y' = 0\mathclose{\text{,}} so its slope is y′=−x/(2y),y' = -x/(2y)\mathclose{\text{,}} which is −1-1 at (2,1):(2, 1)\mathclose{\text{:}} the tangent line there has direction ⟨1,−1⟩.\langle 1, -1\rangle\mathclose{\text{.}} Then ⟨4,4⟩⋅⟨1,−1⟩=0.\langle 4, 4\rangle\cdot\langle 1, -1\rangle = 0\mathclose{\text{.}} For c>0,c > 0\mathclose{\text{,}} the arrows cross the ellipses x2+2y2=cx^2 + 2y^2 = c at right angles and point outwards, to larger values of ff (Figure 20.1, right).

Three vector fields. Left: the rotation field langle -y, xrangle of Example 20.1, tangent to circles about the origin and longer further out; the dashed circle is a flow line. Middle: an inverse square field pointing towards the origin, like gravity, with all arrows drawn the same length to show only their directions. The open circle marks where the field is undefined. Right: the gradient field of f(x, y) = x^2 + 2y^2 (Example 20.2), crossing the level curves of f (orange ellipses) at right angles.
Figure 20.1

Three vector fields. Left: the rotation field ⟨−y,x⟩\langle -y, x\rangle of Example 20.1, tangent to circles about the origin and longer further out; the dashed circle is a flow line. Middle: an inverse square field pointing towards the origin, like gravity, with all arrows drawn the same length to show only their directions. The open circle marks where the field is undefined. Right: the gradient field of f(x,y)=x2+2y2f(x, y) = x^2 + 2y^2 (Example 20.2), crossing the level curves of ff (orange ellipses) at right angles.

In a steady flow with velocity field F,\vb{F}\mathclose{\text{,}} a particle follows a flow line (or streamline): a curve r(t)\vb{r}(t) whose velocity is the field at its position, r′(t)=F(r(t)).\vb{r}'(t) = \vb{F}\big(\vb{r}(t)\big)\mathclose{\text{.}} For the rotation field the origin is stationary and the other flow lines are circles. For a>0,a > 0\mathclose{\text{,}} r(t)=⟨acos⁡t,asin⁡t⟩\vb{r}(t) = \langle a\cos t, a\sin t\rangle has r′(t)=⟨−asin⁡t,acos⁡t⟩,\vb{r}'(t) = \langle -a\sin t, a\cos t\rangle\mathclose{\text{,}} which is F\vb{F} at r(t).\vb{r}(t)\mathclose{\text{.}} Finding flow lines means solving differential equations, as with the direction fields of Section 13.3.

Watch out

A picture samples the field at grid points. Compare lengths only when the arrows share one scale, and take exact values from the formula. And keep vectors and numbers apart: F(2,2)=⟨−2,2⟩\vb{F}(2, 2) = \langle -2, 2\rangle is a vector, while its length ∥F(2,2)∥=22\norm{\vb{F}(2, 2)} = 2\sqrt2 and the dot product F(2,2)⋅G(2,2)=0\vb{F}(2, 2)\cdot\vb{G}(2, 2) = 0 are numbers.

2

Line integrals

A thin wire is bent into the upper half of the circle x2+y2=1,x^2 + y^2 = 1\mathclose{\text{,}} with lengths in metres, and its density at the point (x,y)(x, y) is ρ(x,y)=1+y\rho(x, y) = 1 + y kilograms per metre: it is heavier towards the top. What is its mass? Cut the wire into nn arcs of length π/n.\pi/n\mathclose{\text{.}} On a short arc the density hardly changes, so the arc’s mass is about the density at its midpoint times its length. The midpoint of the iith arc is at the angle θi=(i−12)π/n,\theta_i = (i - \tfrac12)\pi/n\mathclose{\text{,}} at height sin⁡θi,\sin\theta_i\mathclose{\text{,}} so the mass is about

nn∑i=1n(1+sin⁡θi)πn\sum_{i=1}^{n}\big(1 + \sin\theta_i\big)\dfrac{\pi}{n}
445.1939375.193937
16165.1448095.144809
64645.1417935.141793
2562565.1416055.141605

The sums settle down near 5.1416. Their limit is a new kind of integral, an integral along a curve.

A smooth path CC is traced by a function r(t),\vb{r}(t)\mathclose{\text{,}} a≤t≤b,a \le t \le b\mathclose{\text{,}} with a<ba < b and a continuous derivative that is nonzero for a<t<b.a < t < b\mathclose{\text{.}} The velocity may vanish at an endpoint. A piecewise smooth path is made of finitely many such pieces joined end to end. The path records the direction and order of travel, so it can cross itself or retrace a segment. An integral counts each passage. A stationary piece contributes zero. In a short time Δt\Delta t the point r(t)\vb{r}(t) moves about speed times time, ∥r′(t)∥ Δt,\norm{\vb{r}'(t)}\,\Delta t\mathclose{\text{,}} which gives the arc length L=∫ab∥r′(t)∥ dtL = \int_a^b \norm{\vb{r}'(t)}\,dt of Module 16.

Definition 20.2Line integral of a function

Let CC be a smooth curve traced by r(t),\vb{r}(t)\mathclose{\text{,}} a≤t≤b,a \le t \le b\mathclose{\text{,}} and let ff be a function that is continuous on C.C\mathclose{\text{.}} The line integral of ff along CC is

∫Cf ds=∫abf(r(t)) ∥r′(t)∥ dt.\int_C f\,ds = \int_a^b f\big(\vb{r}(t)\big)\,\norm{\vb{r}'(t)}\,dt.

For a piecewise smooth curve, add the line integrals along its smooth pieces.

∫Cf ds\int_C f\,ds reads “the integral of f along C, d s”; ds=∥r′(t)∥ dtds = \norm{\vb{r}'(t)}\,dt stands for the length of a short piece of the curve, and sums of ff times such lengths, like those in the table, are Riemann sums (Module 9) of the integral on the right. With f=1f = 1 the line integral is the length of C;C\mathclose{\text{;}} with a density, the mass of a wire along C;C\mathclose{\text{;}} and dividing by the length of C,C\mathclose{\text{,}} when it is positive, gives the average of ff along C.C\mathclose{\text{.}}

Example 20.3The mass of a wire✓ Checked

Find the mass of the wire above, and the height of its centre of mass.

Trace the semicircle by r(t)=⟨cos⁡t,sin⁡t⟩,\vb{r}(t) = \langle\cos t, \sin t\rangle\mathclose{\text{,}} 0≤t≤π.0 \le t \le \pi\mathclose{\text{.}} Then r′(t)=⟨−sin⁡t,cos⁡t⟩\vb{r}'(t) = \langle -\sin t, \cos t\rangle and ∥r′(t)∥=sin⁡2t+cos⁡2t=1:\norm{\vb{r}'(t)} = \sqrt{\sin^2 t + \cos^2 t} = 1\mathclose{\text{:}} the parameter tt is the arc length. On the wire ρ=1+y=1+sin⁡t,\rho = 1 + y = 1 + \sin t\mathclose{\text{,}} so

M=∫C(1+y) ds=∫0π(1+sin⁡t) dt=[t−cos⁡t]0π=π+2≈5.142 kg,\begin{aligned} M &= \int_C (1 + y)\,ds = \int_0^\pi (1 + \sin t)\,dt \\ &= \big[t - \cos t\big]_0^\pi = \pi + 2 \approx 5.142 \text{ kg}, \end{aligned}

the number that the sums approached. By symmetry the centre of mass lies on the yy-axis. Its height is the first moment in yy divided by the mass, as for a rod in Section 12.7, with y ρ dsy\,\rho\,ds in place of x ρ(x) dx.x\,\rho(x)\,dx\mathclose{\text{.}} With ∫0πsin⁡2t dt=π/2\int_0^\pi \sin^2 t\,dt = \pi/2 (Exercise 10.12),

yˉ=1M∫Cy(1+y) ds=1M∫0π(sin⁡t+sin⁡2t) dt=2+π/2π+2≈0.694 m.\begin{aligned} \bar y &= \frac{1}{M}\int_C y(1 + y)\,ds \\ &= \frac{1}{M}\int_0^\pi \big(\sin t + \sin^2 t\big)\,dt \\ &= \frac{2 + \pi/2}{\pi + 2} \approx 0.694 \text{ m}. \end{aligned}

A uniform semicircular wire has its centre of mass at the height 1π∫0πsin⁡t dt=2/π≈0.637\tfrac{1}{\pi}\int_0^\pi \sin t\,dt = 2/\pi \approx 0.637 m; the heavier top lifts it.

The parameter does not matter. Trace the same wire twice as fast, with r(u)=⟨cos⁡2u,sin⁡2u⟩,\vb{r}(u) = \langle\cos 2u, \sin 2u\rangle\mathclose{\text{,}} 0≤u≤π/2:0 \le u \le \pi/2\mathclose{\text{:}} now the speed is ∥r′(u)∥=2,\norm{\vb{r}'(u)} = 2\mathclose{\text{,}} and ∫0π/2(1+sin⁡2u)⋅2 du=π+2\int_0^{\pi/2} (1 + \sin 2u)\cdot 2\,du = \pi + 2 again. Theorem 20.1 below explains why.

Work

A constant force F\vb{F} that moves an object along a straight displacement D\vb{D} does the work W=F⋅DW = \vb{F}\cdot\vb{D} (Module 16), and Section 12.6 integrated a force that varies along a straight line. Now let the force vary from point to point and the path curve. From tt to t+Δt,t + \Delta t\mathclose{\text{,}} an object moving along r(t)\vb{r}(t) is displaced by about r′(t) Δt,\vb{r}'(t)\,\Delta t\mathclose{\text{,}} so the force does work of about F(r(t))⋅r′(t) Δt.\vb{F}\big(\vb{r}(t)\big)\cdot\vb{r}'(t)\,\Delta t\mathclose{\text{.}} Adding these, and letting Δt→0,\Delta t \to 0\mathclose{\text{,}} gives an integral.

Definition 20.3Line integral of a vector field

Let CC be a smooth curve traced by r(t),\vb{r}(t)\mathclose{\text{,}} a≤t≤b,a \le t \le b\mathclose{\text{,}} and let F\vb{F} be a vector field that is continuous on C.C\mathclose{\text{.}} The line integral of F\vb{F} along CC is

∫CF⋅dr=∫abF(r(t))⋅r′(t) dt.\int_C \vb{F}\cdot d\vb{r} = \int_a^b \vb{F}\big(\vb{r}(t)\big)\cdot\vb{r}'(t)\,dt.

For a piecewise smooth path, add the integrals over its smooth pieces. If F\vb{F} is a force, this is the work it does on an object that moves along C.C\mathclose{\text{.}}

Read it as “the integral along C of F dot d r”. Two other ways of writing it are common. With the unit tangent vector T=r′/∥r′∥\vb{T} = \vb{r}'/\norm{\vb{r}'} of Module 16, F⋅r′ dt=(F⋅T) ∥r′∥ dt=(F⋅T) ds,\vb{F}\cdot\vb{r}'\,dt = (\vb{F}\cdot\vb{T})\,\norm{\vb{r}'}\,dt = (\vb{F}\cdot\vb{T})\,ds\mathclose{\text{,}} so

∫CF⋅dr=∫CF⋅T ds,\int_C \vb{F}\cdot d\vb{r} = \int_C \vb{F}\cdot\vb{T}\,ds,

the line integral of the tangential component of F:\vb{F}\mathclose{\text{:}} only the part of the force along the path does work. And in components, with F=⟨P,Q⟩\vb{F} = \langle P, Q\rangle and r(t)=⟨x(t),y(t)⟩,\vb{r}(t) = \langle x(t), y(t)\rangle\mathclose{\text{,}} the integrand is P x′(t) dt+Q y′(t) dt.P\,x'(t)\,dt + Q\,y'(t)\,dt\mathclose{\text{.}} Writing dx=x′(t) dtdx = x'(t)\,dt and dy=y′(t) dt,dy = y'(t)\,dt\mathclose{\text{,}}

∫CF⋅dr=∫CP dx+Q dy,\int_C \vb{F}\cdot d\vb{r} = \int_C P\,dx + Q\,dy,

with + R dz+\,R\,dz in space.

Example 20.4Work along three paths✓ Checked

Find the work done by the force F(x,y)=⟨−y,x⟩\vb{F}(x, y) = \langle -y, x\rangle on an object that moves from (0,0)(0, 0) to (1,1)(1, 1) (a) along the line y=x,y = x\mathclose{\text{,}} (b) along the parabola y=x2,y = x^2\mathclose{\text{,}} (c) along the xx-axis to (1,0)(1, 0) and then straight up to (1,1).(1, 1)\mathclose{\text{.}}

(a) Take r(t)=⟨t,t⟩,\vb{r}(t) = \langle t, t\rangle\mathclose{\text{,}} 0≤t≤1.0 \le t \le 1\mathclose{\text{.}} Then F(r(t))=⟨−t,t⟩\vb{F}\big(\vb{r}(t)\big) = \langle -t, t\rangle and r′(t)=⟨1,1⟩,\vb{r}'(t) = \langle 1, 1\rangle\mathclose{\text{,}} so F⋅r′=−t+t=0\vb{F}\cdot\vb{r}' = -t + t = 0 and W=0.W = 0\mathclose{\text{.}} The line is a radius of the circles that F\vb{F} follows, so the force is perpendicular to the motion all the way.

(b) Take r(t)=⟨t,t2⟩.\vb{r}(t) = \langle t, t^2\rangle\mathclose{\text{.}} Then F(r(t))=⟨−t2,t⟩\vb{F}\big(\vb{r}(t)\big) = \langle -t^2, t\rangle and r′(t)=⟨1,2t⟩,\vb{r}'(t) = \langle 1, 2t\rangle\mathclose{\text{,}} so

W=∫01(−t2+2t2) dt=∫01t2 dt=13.\begin{aligned} W &= \int_0^1 \big(-t^2 + 2t^2\big)\,dt \\ &= \int_0^1 t^2\,dt = \frac13. \end{aligned}

(c) Two smooth pieces. Along the xx-axis, r(t)=⟨t,0⟩:\vb{r}(t) = \langle t, 0\rangle\mathclose{\text{:}} the force ⟨0,t⟩\langle 0, t\rangle is perpendicular to r′=⟨1,0⟩,\vb{r}' = \langle 1, 0\rangle\mathclose{\text{,}} so it does no work. Up the line x=1,x = 1\mathclose{\text{,}} r(t)=⟨1,t⟩:\vb{r}(t) = \langle 1, t\rangle\mathclose{\text{:}} the force is ⟨−t,1⟩\langle -t, 1\rangle and r′=⟨0,1⟩,\vb{r}' = \langle 0, 1\rangle\mathclose{\text{,}} so F⋅r′=1\vb{F}\cdot\vb{r}' = 1 and the work is ∫011 dt=1.\int_0^1 1\,dt = 1\mathclose{\text{.}} In all, W=0+1=1.W = 0 + 1 = 1\mathclose{\text{.}}

Three paths with the same ends give three different amounts of work, 0,0\mathclose{\text{,}} 13\tfrac13 and 11 (Figure 20.2).

The force field langle -y, xrangle of Example 20.4 and three paths from (0, 0) to (1, 1). Along the line y = x (green) the force is perpendicular to the motion and does no work. Along the parabola y = x^2 (blue) it does work tfrac13. Along the corner path (orange) it does no work on the bottom edge and work 1 on the right edge.
Figure 20.2

The force field ⟨−y,x⟩\langle -y, x\rangle of Example 20.4 and three paths from (0,0)(0, 0) to (1,1).(1, 1)\mathclose{\text{.}} Along the line y=xy = x (green) the force is perpendicular to the motion and does no work. Along the parabola y=x2y = x^2 (blue) it does work 13.\tfrac13\mathclose{\text{.}} Along the corner path (orange) it does no work on the bottom edge and work 1 on the right edge.

Direction and parametrisation

Trace the parabola backwards, from (1,1)(1, 1) to (0,0):(0, 0)\mathclose{\text{:}} r(t)=⟨1−t,(1−t)2⟩,\vb{r}(t) = \langle 1 - t, (1 - t)^2\rangle\mathclose{\text{,}} 0≤t≤1.0 \le t \le 1\mathclose{\text{.}} Now r′(t)=⟨−1,−2(1−t)⟩\vb{r}'(t) = \langle -1, -2(1 - t)\rangle and F(r(t))⋅r′(t)=(1−t)2−2(1−t)2=−(1−t)2,\vb{F}\big(\vb{r}(t)\big)\cdot\vb{r}'(t) = (1 - t)^2 - 2(1 - t)^2 = -(1 - t)^2\mathclose{\text{,}} so the work is −13:-\tfrac13\mathclose{\text{:}} going the other way, the force works against the motion wherever it helped before. Write −C-C for the curve CC traced in the opposite direction.

Theorem 20.1Parametrisation and direction

Let CC be a smooth curve traced by r(t),\vb{r}(t)\mathclose{\text{,}} a≤t≤b.a \le t \le b\mathclose{\text{.}} Let gg be a function on [c,d][c, d] with a continuous derivative that is never 0, whose values fill [a,b],[a, b]\mathclose{\text{,}} and let r~(u)=r(g(u)),\tilde{\vb{r}}(u) = \vb{r}\big(g(u)\big)\mathclose{\text{,}} c≤u≤d.c \le u \le d\mathclose{\text{.}} Then r~\tilde{\vb{r}} traces the same curve, and for every continuous field F\vb{F} and function ff on C:C\mathclose{\text{:}}

  • if g′>0,g' > 0\mathclose{\text{,}} r~\tilde{\vb{r}} traces CC in the same direction, and gives the same line integral of F;\vb{F}\mathclose{\text{;}}
  • if g′<0,g' < 0\mathclose{\text{,}} r~\tilde{\vb{r}} traces −C,-C\mathclose{\text{,}} and ∫−CF⋅dr=−∫CF⋅dr;\displaystyle\int_{-C} \vb{F}\cdot d\vb{r} = -\int_C \vb{F}\cdot d\vb{r}\mathclose{\text{;}}
  • in both cases it gives the same ∫Cf ds:\displaystyle\int_C f\,ds\mathclose{\text{:}} in particular ∫−Cf ds=∫Cf ds.\displaystyle\int_{-C} f\,ds = \int_C f\,ds\mathclose{\text{.}}
Proof

By the chain rule, r~′(u)=r′(g(u)) g′(u).\tilde{\vb{r}}'(u) = \vb{r}'\big(g(u)\big)\,g'(u)\mathclose{\text{.}} If g′>0,g' > 0\mathclose{\text{,}} then gg is increasing, with g(c)=ag(c) = a and g(d)=b,g(d) = b\mathclose{\text{,}} and the substitution t=g(u)t = g(u) (Theorem 10.7) gives

∫cdF(r(g(u)))⋅r′(g(u)) g′(u) du=∫abF(r(t))⋅r′(t) dt.\begin{aligned} &\int_c^d \vb{F}\big(\vb{r}(g(u))\big)\cdot\vb{r}'\big(g(u)\big)\,g'(u)\,du \\ &\qquad= \int_a^b \vb{F}\big(\vb{r}(t)\big)\cdot\vb{r}'(t)\,dt. \end{aligned}

If g′<0,g' < 0\mathclose{\text{,}} then gg is decreasing, with g(c)=bg(c) = b and g(d)=a,g(d) = a\mathclose{\text{,}} so the same substitution gives ∫ba,\int_b^a\mathclose{\text{,}} which is −∫ab.-\int_a^b\mathclose{\text{.}} For ∫Cf ds,\int_C f\,ds\mathclose{\text{,}} the speed is ∥r~′(u)∥=∥r′(g(u))∥ ∣g′(u)∣.\norm{\tilde{\vb{r}}'(u)} = \norm{\vb{r}'(g(u))}\,\abs{g'(u)}\mathclose{\text{.}} When g′<0,g' < 0\mathclose{\text{,}} ∣g′∣=−g′,\abs{g'} = -g'\mathclose{\text{,}} and this second minus sign cancels the one that comes from reversing the limits.

∎

A change of speed that preserves the ordered traversal leaves either integral unchanged. Reversing the traversal also leaves the scalar integral unchanged, while it negates the work integral. Tracing the path twice would count both traversals.

Watch out

Two slips. (1) Leaving out the speed: ∫Cf ds\int_C f\,ds is ∫abf(r(t)) ∥r′(t)∥ dt,\int_a^b f\big(\vb{r}(t)\big)\,\norm{\vb{r}'(t)}\,dt\mathclose{\text{,}} not ∫abf(r(t)) dt.\int_a^b f\big(\vb{r}(t)\big)\,dt\mathclose{\text{.}} With ⟨cos⁡2u,sin⁡2u⟩,\langle\cos 2u, \sin 2u\rangle\mathclose{\text{,}} 0≤u≤π/2,0 \le u \le \pi/2\mathclose{\text{,}} forgetting the speed 2 gives the wire a mass of (π+2)/2,(\pi + 2)/2\mathclose{\text{,}} half the truth. (2) Using the position instead of the velocity: in Example 20.4(b), the dot product of F\vb{F} with r(t)=⟨t,t2⟩\vb{r}(t) = \langle t, t^2\rangle instead of r′(t)\vb{r}'(t) gives −t3+t3=0,-t^3 + t^3 = 0\mathclose{\text{,}} and a wrong “work” of 0.

Compute itLine integrals with SymPy

Store a field and a path as SymPy matrices; .subs puts the path into the field, .diff(t) differentiates the path, and .dot takes the dot product:

Python
import sympy as sp
x, y, t = sp.symbols('x y t')
F = sp.Matrix([-y, x])

def work(F, path, a, b):
    """The line integral of F along the path (x(t), y(t)), a <= t <= b."""
    r = sp.Matrix(path)
    on_path = F.subs({x: r[0], y: r[1]}, simultaneous=True)
    return sp.integrate(on_path.dot(r.diff(t)), (t, a, b))

print(work(F, [t, t], 0, 1), work(F, [t, t**2], 0, 1))
print(work(F, [t, 0], 0, 1) + work(F, [1, t], 0, 1))
print(work(F, [1 - t, (1 - t)**2], 0, 1))
Output
0 1/3
1
-1/3

These are the works of Example 20.4 along the line, the parabola and the corner path, and along the parabola backwards. For ∫Cf ds,\int_C f\,ds\mathclose{\text{,}} multiply by the speed instead; here is the mass of the wire of Example 20.3:

Python
r = sp.Matrix([sp.cos(t), sp.sin(t)])
speed = sp.sqrt(r.diff(t).dot(r.diff(t)))
print(speed, sp.simplify(speed))
M = sp.integrate((1 + r[1])*sp.simplify(speed), (t, 0, sp.pi))
print(M, sp.N(M, 4))
Output
sqrt(sin(t)**2 + cos(t)**2) 1
2 + pi 5.142

SymPy does not use sin⁡2t+cos⁡2t=1\sin^2 t + \cos^2 t = 1 until sp.simplify asks it to. Finally, a picture: matplotlib’s quiver draws an arrow with components U, V at each point X, Y of a grid.

Python
import numpy as np
import matplotlib.pyplot as plt
X, Y = np.meshgrid(np.linspace(-0.2, 1.2, 8), np.linspace(-0.2, 1.2, 8))
plt.quiver(X, Y, -Y, X, color='grey')            # the field <-y, x>
s = np.linspace(0, 1, 100)
plt.plot(s, s, s, s**2, [0, 1, 1], [0, 0, 1])   # the three paths
plt.gca().set_aspect('equal')
plt.show()

With an interactive matplotlib backend, the plot opens in a window and shows the field and the three paths, as in Figure 20.2.

3

Conservative fields

Work usually depends on the path, as Example 20.4 showed. For gravity near the ground it does not: lifting a book from the floor to a shelf takes the same work against gravity by any route. This section finds the fields with that property. For them a line integral is computed as in Module 10: find a function whose derivative is the integrand, and subtract its values at the ends.

Theorem 20.2The fundamental theorem for line integrals

Let CC be a piecewise smooth curve traced by r(t),\vb{r}(t)\mathclose{\text{,}} a≤t≤b,a \le t \le b\mathclose{\text{,}} from the point A=r(a)A = \vb{r}(a) to the point B=r(b).B = \vb{r}(b)\mathclose{\text{.}} Let ff be a function of two or three variables that is differentiable, with a continuous gradient, on an open region that contains C.C\mathclose{\text{.}} Then

∫C∇f⋅dr=f(B)−f(A).\int_C \nabla f\cdot d\vb{r} = f(B) - f(A).
Proof

First let CC be smooth, and let g(t)=f(r(t))g(t) = f\big(\vb{r}(t)\big) be the value of ff at the moving point. By the chain rule of Module 17,

g′(t)=fx x′(t)+fy y′(t)+fz z′(t)=∇f(r(t))⋅r′(t)\begin{aligned} g'(t) &= f_x\,x'(t) + f_y\,y'(t) + f_z\,z'(t) \\ &= \nabla f\big(\vb{r}(t)\big)\cdot\vb{r}'(t) \end{aligned}

(without the last term in the plane), and this is continuous on [a,b].[a, b]\mathclose{\text{.}} By the net change theorem (Theorem 10.5),

∫C∇f⋅dr=∫abg′(t) dt=g(b)−g(a)=f(B)−f(A).\begin{aligned} \int_C \nabla f\cdot d\vb{r} &= \int_a^b g'(t)\,dt = g(b) - g(a) \\ &= f(B) - f(A). \end{aligned}

If CC is made of smooth pieces from A=A0A = A_0 to A1,A_1\mathclose{\text{,}} from A1A_1 to A2,A_2\mathclose{\text{,}} and so on to An=B,A_n = B\mathclose{\text{,}} add the results for the pieces: the sum (f(A1)−f(A0))+⋯+(f(An)−f(An−1))\big(f(A_1) - f(A_0)\big) + \dots + \big(f(A_n) - f(A_{n-1})\big) telescopes to f(B)−f(A).f(B) - f(A)\mathclose{\text{.}}

∎
Definition 20.4Conservative field and potential

A vector field F\vb{F} on an open region DD is conservative if F=∇f\vb{F} = \nabla f for a differentiable function ff on D.D\mathclose{\text{.}} Such an ff is a potential function, or potential, of F.\vb{F}\mathclose{\text{.}}

As with antiderivatives, f+Kf + K is a potential too, for every constant K.K\mathclose{\text{.}} For a continuous field on an open connected region (defined below), there are no others: if ∇f=∇g,\nabla f = \nabla g\mathclose{\text{,}} Theorem 20.2 for h=f−gh = f - g gives h(B)−h(A)=∫C0⋅dr=0h(B) - h(A) = \int_C \vb{0}\cdot d\vb{r} = 0 for any two points joined by a curve C.C\mathclose{\text{.}}

By Theorem 20.2, the line integral of a continuous conservative field F=∇f\vb{F} = \nabla f depends only on the ends of the curve: it is independent of the path. In particular, along a closed curve, one that ends where it starts, B=AB = A and the line integral is 0. A circle on the integral sign marks a closed curve: ∮CF⋅dr\oint_C \vb{F}\cdot d\vb{r} reads “the integral of F dot d r round C”.

Example 20.5Gravity is conservative✓ Checked

Show that the gravitational field F=−GMm r/∥r∥3\vb{F} = -GMm\,\vb{r}/\norm{\vb{r}}^3 is the gradient of f=GMm/∥r∥f = GMm/\norm{\vb{r}} on space without the origin, and find the work that gravity does on the body of mass mm as it moves from distance r1r_1 to distance r2r_2 from the origin, along any path that avoids the origin.

Write 1/∥r∥=(x2+y2+z2)−1/2.1/\norm{\vb{r}} = (x^2 + y^2 + z^2)^{-1/2}\mathclose{\text{.}} By the chain rule,

∂∂x (x2+y2+z2)−1/2=−12(x2+y2+z2)−3/2⋅2x=−x∥r∥3,\begin{aligned} &\frac{\partial}{\partial x}\,(x^2 + y^2 + z^2)^{-1/2} \\ &\quad= -\tfrac12(x^2 + y^2 + z^2)^{-3/2}\cdot 2x \\ &\quad= -\frac{x}{\norm{\vb{r}}^3}, \end{aligned}

and in the same way for yy and z.z\mathclose{\text{.}} So ∇(1/∥r∥)=−r/∥r∥3,\nabla\big(1/\norm{\vb{r}}\big) = -\vb{r}/\norm{\vb{r}}^3\mathclose{\text{,}} and ∇f=F.\nabla f = \vb{F}\mathclose{\text{.}} The value of ff depends only on the distance from the origin, so by Theorem 20.2 the work is

W=f(B)−f(A)=GMm(1r2−1r1),\begin{aligned} W &= f(B) - f(A) \\ &= GMm\Big(\frac{1}{r_2} - \frac{1}{r_1}\Big), \end{aligned}

whatever the path: positive when the body falls closer (r2<r1),r_2 < r_1\mathclose{\text{),}} negative when it climbs away. Physicists call U=−f=−GMm/∥r∥U = -f = -GMm/\norm{\vb{r}} the potential energy, so the work done by gravity is the drop U(A)−U(B).U(A) - U(B)\mathclose{\text{.}} When gravity is the only force, this work is also the gain in kinetic energy. The sum of kinetic and potential energies stays constant, hence the name “conservative”.

A region D,D\mathclose{\text{,}} in the plane or in space, is open if around each of its points there is a disc (a ball, in space) that lies in D,D\mathclose{\text{,}} and connected if any two of its points can be joined by a piecewise smooth curve in D.D\mathclose{\text{.}}

Theorem 20.3Conservative fields and closed curves

Let F\vb{F} be a continuous vector field on an open connected region D.D\mathclose{\text{.}} These three statements are equivalent: each implies the other two.

  1. F\vb{F} is conservative on D.D\mathclose{\text{.}}
  2. ∫CF⋅dr\int_C \vb{F}\cdot d\vb{r} depends only on the ends of C,C\mathclose{\text{,}} for piecewise smooth curves CC in D.D\mathclose{\text{.}}
  3. ∮CF⋅dr=0\oint_C \vb{F}\cdot d\vb{r} = 0 for every piecewise smooth closed curve CC in D.D\mathclose{\text{.}}
Proof

1 ⇒ 2 is Theorem 20.2. 2 ⇒ 3: split a closed curve CC at two of its points AA and BB into C1,C_1\mathclose{\text{,}} from AA to B,B\mathclose{\text{,}} and C2,C_2\mathclose{\text{,}} from BB back to A.A\mathclose{\text{.}} Both C1C_1 and −C2-C_2 run from AA to B,B\mathclose{\text{,}} so by 2, ∫C1=∫−C2=−∫C2,\int_{C_1} = \int_{-C_2} = -\int_{C_2}\mathclose{\text{,}} and ∮C=∫C1+∫C2=0.\oint_C = \int_{C_1} + \int_{C_2} = 0\mathclose{\text{.}} 3 ⇒ 2: if C1C_1 and C2C_2 both run from AA to B,B\mathclose{\text{,}} then C1C_1 followed by −C2-C_2 is a closed curve, so 0=∫C1−∫C2.0 = \int_{C_1} - \int_{C_2}\mathclose{\text{.}}

2 ⇒ 1 (in the plane). Fix a point AA of D.D\mathclose{\text{.}} For each point (x,y)(x, y) of D,D\mathclose{\text{,}} let f(x,y)=∫CF⋅drf(x, y) = \int_C \vb{F}\cdot d\vb{r} along any piecewise smooth curve CC in DD from AA to (x,y);(x, y)\mathclose{\text{;}} there is one, because DD is connected, and by 2 the value does not depend on the choice. Since DD is open, it contains a short horizontal segment through (x,y),(x, y)\mathclose{\text{,}} from a point (x1,y)(x_1, y) with x1<xx_1 < x to a point on the right of (x,y).(x, y)\mathclose{\text{.}} For each point (x′,y)(x', y) of this segment, choose CC to run from AA to (x1,y)(x_1, y) and then along the segment to (x′,y);(x', y)\mathclose{\text{;}} on the segment yy is constant, so dy=0,dy = 0\mathclose{\text{,}} and

f(x′,y)=f(x1,y)+∫x1x′P(s,y) ds.f(x', y) = f(x_1, y) + \int_{x_1}^{x'} P(s, y)\,ds.

The first term does not depend on x′,x'\mathclose{\text{,}} so Part 1 of the Fundamental Theorem (Section 10.4) gives fx(x,y)=P(x,y).f_x(x, y) = P(x, y)\mathclose{\text{.}} A short vertical segment gives fy=Qf_y = Q in the same way. In space, a third segment gives fz=R.f_z = R\mathclose{\text{.}} These partial derivatives are continuous because F\vb{F} is continuous, so ff is differentiable by Module 17 and ∇f=F.\nabla f = \vb{F}\mathclose{\text{.}}

∎

A test for conservative fields

How can you tell whether F=⟨P,Q⟩\vb{F} = \langle P, Q\rangle is conservative without finding a potential? If F=∇f,\vb{F} = \nabla f\mathclose{\text{,}} then P=fxP = f_x and Q=fy,Q = f_y\mathclose{\text{,}} and Clairaut’s theorem (Module 17) says that the mixed partial derivatives of ff agree.

Theorem 20.4A condition for conservative fields

If F=⟨P,Q⟩\vb{F} = \langle P, Q\rangle is conservative on an open region D,D\mathclose{\text{,}} and PP and QQ have continuous first partial derivatives on D,D\mathclose{\text{,}} then

∂P∂y=∂Q∂xthroughout D.\frac{\partial P}{\partial y} = \frac{\partial Q}{\partial x} \quad\text{throughout } D.
Proof

Let F=∇f,\vb{F} = \nabla f\mathclose{\text{,}} so P=fxP = f_x and Q=fy.Q = f_y\mathclose{\text{.}} Then fxy=Pyf_{xy} = P_y and fyx=Qxf_{yx} = Q_x are continuous on D,D\mathclose{\text{,}} and Clairaut’s theorem gives fxy=fyx,f_{xy} = f_{yx}\mathclose{\text{,}} that is, Py=Qx.P_y = Q_x\mathclose{\text{.}}

∎

So the rotation field ⟨−y,x⟩,\langle -y, x\rangle\mathclose{\text{,}} with Py=−1P_y = -1 and Qx=1,Q_x = 1\mathclose{\text{,}} is not conservative, as Example 20.4 found: the work from (0,0)(0, 0) to (1,1)(1, 1) depended on the path. Does the converse hold? Not always.

Example 20.6A field with a hole✓ Checked

Let F(x,y)=⟨−yx2+y2,xx2+y2⟩,\vb{F}(x, y) = \Big\langle \dfrac{-y}{x^2 + y^2}, \dfrac{x}{x^2 + y^2}\Big\rangle\mathclose{\text{,}} on the plane without the origin.

  • (a) Show that ∂P/∂y=∂Q/∂x\partial P/\partial y = \partial Q/\partial x wherever F\vb{F} is defined.
  • (b) Find ∮CF⋅dr,\oint_C \vb{F}\cdot d\vb{r}\mathclose{\text{,}} where CC is the unit circle, traced once anticlockwise.
  • (c) Is F\vb{F} conservative?

(a) By the quotient rule,

∂P∂y=−(x2+y2)+y⋅2y(x2+y2)2=y2−x2(x2+y2)2,∂Q∂x=(x2+y2)−x⋅2x(x2+y2)2=y2−x2(x2+y2)2.\begin{aligned} \frac{\partial P}{\partial y} &= \frac{-(x^2 + y^2) + y\cdot 2y}{(x^2 + y^2)^2} \\ &= \frac{y^2 - x^2}{(x^2 + y^2)^2}, \\ \frac{\partial Q}{\partial x} &= \frac{(x^2 + y^2) - x\cdot 2x}{(x^2 + y^2)^2} \\ &= \frac{y^2 - x^2}{(x^2 + y^2)^2}. \end{aligned}

(b) Take r(t)=⟨cos⁡t,sin⁡t⟩,\vb{r}(t) = \langle\cos t, \sin t\rangle\mathclose{\text{,}} 0≤t≤2π.0 \le t \le 2\pi\mathclose{\text{.}} On C,C\mathclose{\text{,}} x2+y2=1,x^2 + y^2 = 1\mathclose{\text{,}} so F(r(t))=⟨−sin⁡t,cos⁡t⟩,\vb{F}\big(\vb{r}(t)\big) = \langle -\sin t, \cos t\rangle\mathclose{\text{,}} which is r′(t).\vb{r}'(t)\mathclose{\text{.}} So F⋅r′=sin⁡2t+cos⁡2t=1,\vb{F}\cdot\vb{r}' = \sin^2 t + \cos^2 t = 1\mathclose{\text{,}} and ∮CF⋅dr=2π.\oint_C \vb{F}\cdot d\vb{r} = 2\pi\mathclose{\text{.}}

(c) No. By Theorem 20.3, a conservative field has line integral 0 round every closed curve, and this one has 2π2\pi round C,C\mathclose{\text{,}} although Py=QxP_y = Q_x everywhere. On the right half-plane x>0,x > 0\mathclose{\text{,}} though, F\vb{F} is the gradient of θ(x,y)=arctan⁡(y/x),\theta(x, y) = \arctan(y/x)\mathclose{\text{,}} the polar angle of Module 16 (differentiate to check). Going once round the origin increases the polar angle by 2π:2\pi\mathclose{\text{:}} that is the 2π2\pi of (b). On the whole plane without the origin there is no potential, because the angle cannot be defined continuously all the way round: somewhere it must jump by 2π.2\pi\mathclose{\text{.}}

What went wrong is a hole. The unit circle lies where F\vb{F} is defined, but it goes round a point, the origin, where F\vb{F} is not defined.

Definition 20.5Simply connected region

A simple curve has no repeated points, apart from the common start and end allowed for a simple closed curve. A region DD of the plane is simply connected if it is connected and every simple closed curve in DD encloses only points of D.D\mathclose{\text{.}}

Informally, a simply connected region has no holes. A disc, a half-plane, the whole plane and the inside of any simple closed curve are simply connected; a ring between two circles, and the plane without the origin, are not.

Theorem 20.5A test for conservative fields

Let PP and QQ have continuous first partial derivatives on an open, simply connected region DD of the plane, with

∂P∂y=∂Q∂xthroughout D.\frac{\partial P}{\partial y} = \frac{\partial Q}{\partial x} \quad\text{throughout } D.

Then F=⟨P,Q⟩\vb{F} = \langle P, Q\rangle is conservative on D.D\mathclose{\text{.}}

Section 20.4 shows why, with Green’s theorem. Example 20.6 shows that “simply connected” cannot be left out.

Watch out

Py=QxP_y = Q_x on its own does not make a field conservative: check also that the region where PP and QQ have continuous partial derivatives is simply connected (Example 20.6). And compare the right derivatives, each component differentiated with respect to the other variable: for the rotation field ⟨−y,x⟩,\langle -y, x\rangle\mathclose{\text{,}} Px=0=Qy,P_x = 0 = Q_y\mathclose{\text{,}} but Py=−1≠1=Qx,P_y = -1 \ne 1 = Q_x\mathclose{\text{,}} and the field is not conservative.

Finding a potential

When the test says yes, find ff by undoing the partial derivatives one variable at a time.

Example 20.7Finding a potential✓ Checked

Let F(x,y)=⟨ycos⁡x+2xey, sin⁡x+x2ey+2y⟩.\vb{F}(x, y) = \big\langle y\cos x + 2xe^y,\ \sin x + x^2e^y + 2y\big\rangle\mathclose{\text{.}}

  • (a) Show that F\vb{F} is conservative on the plane.
  • (b) Find a potential f.f\mathclose{\text{.}}
  • (c) Find the work done by F\vb{F} along the curve r(t)=⟨πt/2,t2⟩,\vb{r}(t) = \langle \pi t/2, t^2\rangle\mathclose{\text{,}} 0≤t≤1.0 \le t \le 1\mathclose{\text{.}}

(a) Py=cos⁡x+2xeyP_y = \cos x + 2xe^y and Qx=cos⁡x+2xeyQ_x = \cos x + 2xe^y are equal and continuous on the whole plane, which is simply connected, so by Theorem 20.5 F\vb{F} is conservative.

(b) Since fx=P,f_x = P\mathclose{\text{,}} ff is an antiderivative of PP with respect to x,x\mathclose{\text{,}} with yy held fixed:

f(x,y)=ysin⁡x+x2ey+g(y).f(x, y) = y\sin x + x^2e^y + g(y).

The “constant” of integration may depend on y,y\mathclose{\text{,}} because yy was held fixed. Now differentiate with respect to yy and compare with Q:Q\mathclose{\text{:}}

fy=sin⁡x+x2ey+g′(y)=sin⁡x+x2ey+2y,\begin{aligned} f_y &= \sin x + x^2e^y + g'(y) \\ &= \sin x + x^2e^y + 2y, \end{aligned}

so g′(y)=2yg'(y) = 2y and g(y)=y2+K.g(y) = y^2 + K\mathclose{\text{.}} With K=0,K = 0\mathclose{\text{,}}

f(x,y)=ysin⁡x+x2ey+y2.f(x, y) = y\sin x + x^2e^y + y^2.

Check: ∇f=F.\nabla f = \vb{F}\mathclose{\text{.}}

(c) The curve runs from r(0)=(0,0)\vb{r}(0) = (0, 0) to r(1)=(π/2,1).\vb{r}(1) = (\pi/2, 1)\mathclose{\text{.}} By Theorem 20.2, without integrating along the curve,

W=f(π2,1)−f(0,0)=1+π24e+1−0=2+π2e4≈8.707.\begin{aligned} W &= f\big(\tfrac{\pi}{2}, 1\big) - f(0, 0) \\ &= 1 + \frac{\pi^2}{4}e + 1 - 0 \\ &= 2 + \frac{\pi^2 e}{4} \approx 8.707. \end{aligned}

Every other path from (0,0)(0, 0) to (π/2,1)(\pi/2, 1) gives the same work.

Watch out

Two slips. (1) Writing a plain constant CC for the “constant” of integration with respect to x:x\mathclose{\text{:}} it may depend on y,y\mathclose{\text{,}} and here a plain constant would lose the term y2.y^2\mathclose{\text{.}} (2) Integrating PP with respect to xx and QQ with respect to yy and adding the results: that counts the terms they share, ysin⁡x+x2ey,y\sin x + x^2e^y\mathclose{\text{,}} twice, and the gradient of the sum is not F.\vb{F}\mathclose{\text{.}} Check a potential by computing its gradient.

4

Green’s theorem

The parabola and the line of Example 20.4 together make a closed curve: out along the parabola from (0,0)(0, 0) to (1,1),(1, 1)\mathclose{\text{,}} and back along the line. Round it, the rotation field ⟨−y,x⟩\langle -y, x\rangle does work 13\tfrac13 on the way out and 00 on the way back: 13\tfrac13 in all. The region between the two curves has area ∫01(x−x2) dx=16,\int_0^1 (x - x^2)\,dx = \tfrac16\mathclose{\text{,}} and for this field ∂Q/∂x−∂P/∂y=1−(−1)=2\partial Q/\partial x - \partial P/\partial y = 1 - (-1) = 2 everywhere. And 13=2×16.\tfrac13 = 2 \times \tfrac16\mathclose{\text{.}} This is no coincidence.

Here is the idea. Take a small square with lower left corner (x,y)(x, y) and side h>0.h > 0\mathclose{\text{.}} The anticlockwise traversal goes up on the right and down on the left, so the vertical sides together contribute

∫yy+h[Q(x+h,v)−Q(x,v)] dv.\int_y^{y+h} \big[Q(x+h,v)-Q(x,v)\big]\,dv.

If the first partial derivatives are continuous, the bracket divided by hh is close to Qx(x,y)Q_x(x,y) throughout this short interval, by the Mean Value Theorem. The contribution is therefore about Qx(x,y)h2.Q_x(x,y)h^2\mathclose{\text{.}} The traversal goes right on the bottom and left on the top, so the horizontal sides contribute about −Py(x,y)h2-P_y(x,y)h^2 by the same argument. Thus the circulation is approximately (Qx−Py)h2,(Q_x-P_y)h^2\mathclose{\text{,}} with an error small compared with h2.h^2\mathclose{\text{.}}

For a region made of small squares (Figure 20.3), add these circulations. A shared edge is traced twice in opposite directions, so its contributions cancel. Only the boundary integral remains. The sum of (Qx−Py)(Q_x-P_y) times the square areas approximates the double integral of Qx−PyQ_x-P_y over the region.

Left: a region D and its boundary C, traced anticlockwise, so that D is on the left; at one point, the unit tangent vb{T} and the outward unit normal vb{n}. Right: the same idea in small squares, each traced anticlockwise. On every inner edge two arrows point in opposite directions (grey), so their line integrals cancel; only the outer boundary (blue) is left.
Figure 20.3

Left: a region DD and its boundary C,C\mathclose{\text{,}} traced anticlockwise, so that DD is on the left; at one point, the unit tangent T\vb{T} and the outward unit normal n.\vb{n}\mathclose{\text{.}} Right: the same idea in small squares, each traced anticlockwise. On every inner edge two arrows point in opposite directions (grey), so their line integrals cancel; only the outer boundary (blue) is left.

A simple closed curve CC in the plane is positively oriented if it is traced anticlockwise, that is, so that the region it encloses is on your left as you walk along it.

Theorem 20.6Green’s theorem

Let CC be a positively oriented, piecewise smooth, simple closed curve in the plane, and let DD be the region made of CC and the points it encloses. If PP and QQ have continuous first partial derivatives on an open region that contains D,D\mathclose{\text{,}} then

∮CP dx+Q dy=∬D(∂Q∂x−∂P∂y) dA.\begin{aligned} &\oint_C P\,dx + Q\,dy \\ &\quad= \iint_D \Big(\frac{\partial Q}{\partial x} - \frac{\partial P}{\partial y}\Big)\,dA. \end{aligned}

The proof below is for regions that Module 19 calls both type I and type II, such as discs, triangles and the region between the parabola and the line.

Proof of Green’s theorem for a region of type I and type II

It is enough to prove

∮CP dx=−∬D∂P∂y dAand∮CQ dy=∬D∂Q∂x dA,\begin{aligned} \oint_C P\,dx &= -\iint_D \frac{\partial P}{\partial y}\,dA \quad\text{and} \\ \oint_C Q\,dy &= \iint_D \frac{\partial Q}{\partial x}\,dA, \end{aligned}

and add. For the first, describe DD as a type I region: a≤x≤ba \le x \le b and g1(x)≤y≤g2(x).g_1(x) \le y \le g_2(x)\mathclose{\text{.}} By Fubini’s theorem (Module 19), and then Part 2 of the Fundamental Theorem in y,y\mathclose{\text{,}} with xx held fixed,

∬D∂P∂y dA=∫ab∫g1(x)g2(x)∂P∂y dy dx=∫ab[P(x,g2(x))−P(x,g1(x))] dx.\begin{aligned} \iint_D \frac{\partial P}{\partial y}\,dA &= \int_a^b \int_{g_1(x)}^{g_2(x)} \frac{\partial P}{\partial y}\,dy\,dx \\ &= \int_a^b \Big[P\big(x, g_2(x)\big) \\ &\qquad\quad - P\big(x, g_1(x)\big)\Big]\,dx. \end{aligned}

Now go round CC anticlockwise in four parts, some of which may be single points. Along the bottom, xx runs from aa to bb and y=g1(x).y=g_1(x)\mathclose{\text{.}} Using a piecewise smooth parametrisation of this arc and substituting its xx-coordinate into the integral gives ∫P dx=∫abP(x,g1(x)) dx.\int P\,dx = \int_a^b P\big(x, g_1(x)\big)\,dx\mathclose{\text{.}} This only requires g1g_1 to be continuous, so it also works for an arc with a vertical tangent at an endpoint. Up the right side, x=bx = b does not change, so dx=0dx = 0 and ∫P dx=0.\int P\,dx = 0\mathclose{\text{.}} Along the top, the graph of g2g_2 traced from x=bx = b back to x=a,x = a\mathclose{\text{,}} ∫P dx=−∫abP(x,g2(x)) dx.\int P\,dx = -\int_a^b P\big(x, g_2(x)\big)\,dx\mathclose{\text{.}} Down the left side, dx=0dx = 0 again. Adding the four parts,

∮CP dx=∫ab[P(x,g1(x))−P(x,g2(x))] dx=−∬D∂P∂y dA.\begin{aligned} \oint_C P\,dx &= \int_a^b \Big[P\big(x, g_1(x)\big) \\ &\qquad\quad - P\big(x, g_2(x)\big)\Big]\,dx \\ &= -\iint_D \frac{\partial P}{\partial y}\,dA. \end{aligned}

For the second formula, describe DD as a type II region, c≤y≤dc \le y \le d and h1(y)≤x≤h2(y).h_1(y) \le x \le h_2(y)\mathclose{\text{.}} In the same way, ∬DQx dA=∫cd[Q(h2(y),y)−Q(h1(y),y)] dy.\iint_D Q_x\,dA = \int_c^d \big[Q\big(h_2(y), y\big) - Q\big(h_1(y), y\big)\big]\,dy\mathclose{\text{.}} Going round CC anticlockwise traces the right edge x=h2(y)x = h_2(y) upwards and the left edge x=h1(y)x = h_1(y) downwards, while on the horizontal parts dy=0,dy = 0\mathclose{\text{,}} so ∮CQ dy\oint_C Q\,dy is the same integral.

∎

Other regions. Green’s theorem holds as stated for every region bounded by a piecewise smooth simple closed curve, but the general proof is beyond this series. A region that can be cut into finitely many pieces of type I and type II follows by applying the proof to each piece and adding: each cut is traced twice, once in each direction, so the line integrals along the cuts cancel, as in Figure 20.3. The same cancellation gives Green’s theorem for a region with holes, when every boundary curve is traced with DD on its left: the outer curve anticlockwise and the inner ones clockwise.

Why the test of Section 20.3 works. Let DD be open and simply connected, with Py=QxP_y = Q_x throughout D.D\mathclose{\text{.}} A simple closed curve CC in DD encloses a region RR that lies in D,D\mathclose{\text{,}} since DD has no holes, and Green’s theorem gives ∮CF⋅dr=±∬R(Qx−Py) dA=0\oint_C \vb{F}\cdot d\vb{r} = \pm\iint_R (Q_x - P_y)\,dA = 0 (the sign set by the direction of C).C\mathclose{\text{).}} To include closed paths that cross or retrace themselves, first consider a closed polygonal walk in D.D\mathclose{\text{.}} Split its edges at crossings and at the endpoints of any overlaps. The walk can be split at repeated vertices into simple polygonal loops and pairs of edges traced there and back. The loops give 0 by Green’s theorem, and the pairs cancel.

For a general piecewise smooth closed path, join successive points on it by short chords. The path is compact inside the open set D,D\mathclose{\text{,}} so sufficiently short chords stay in D.D\mathclose{\text{.}} On each smooth piece the resulting polygonal parametrisations approach the path uniformly, and their velocities approach its velocity uniformly away from the subdivision points, by continuity of r′.\vb{r}'\mathclose{\text{.}} Hence the line integrals of the polygonal walks approach the line integral of the path. Each is 0, so the integral along the path is 0 as well. Theorem 20.3 now gives Theorem 20.5. For the field of Example 20.6, Green’s theorem cannot be used on the unit disc, which contains the origin, where the field is not defined.

Example 20.8A line integral made easy✓ Checked

Evaluate ∮C(xy−ex2) dx+(x2+3x+ln⁡(1+y2)) dy,\displaystyle\oint_C \big(xy - e^{x^2}\big)\,dx + \big(x^2 + 3x + \ln(1 + y^2)\big)\,dy\mathclose{\text{,}} where CC is the circle x2+y2=4,x^2 + y^2 = 4\mathclose{\text{,}} traced anticlockwise.

A direct parametrisation produces terms such as 2e4cos⁡2tsin⁡t.2e^{4\cos^2 t}\sin t\mathclose{\text{.}} Green’s theorem avoids integrating those terms along the circle. Here P=xy−ex2P = xy - e^{x^2} and Q=x2+3x+ln⁡(1+y2)Q = x^2 + 3x + \ln(1 + y^2) have continuous partial derivatives on the whole plane, and

∂Q∂x−∂P∂y=(2x+3)−x=x+3.\frac{\partial Q}{\partial x} - \frac{\partial P}{\partial y} = (2x + 3) - x = x + 3.

The awkward terms are gone: ex2e^{x^2} does not depend on y,y\mathclose{\text{,}} and ln⁡(1+y2)\ln(1 + y^2) does not depend on x.x\mathclose{\text{.}} With DD the disc of radius 2, in polar coordinates (Module 19),

∮CP dx+Q dy=∬D(x+3) dA=∫02π ⁣ ⁣∫02(rcos⁡θ+3) r dr dθ=0+3⋅π⋅22=12π.\begin{aligned} &\oint_C P\,dx + Q\,dy = \iint_D (x + 3)\,dA \\ &\quad= \int_0^{2\pi}\!\!\int_0^2 (r\cos\theta + 3)\,r\,dr\,d\theta \\ &\quad= 0 + 3\cdot\pi\cdot 2^2 = 12\pi. \end{aligned}

The integral of xx over the disc is 0, because the disc is symmetric about the yy-axis and xx is odd: in polar form, ∫02πcos⁡θ dθ=0.\int_0^{2\pi}\cos\theta\,d\theta = 0\mathclose{\text{.}}

Circulation and flux

Since P dx+Q dy=F⋅T ds,P\,dx + Q\,dy = \vb{F}\cdot\vb{T}\,ds\mathclose{\text{,}} the left side of Green’s theorem is ∮CF⋅T ds,\oint_C \vb{F}\cdot\vb{T}\,ds\mathclose{\text{,}} the circulation of F\vb{F} round C.C\mathclose{\text{.}} If F\vb{F} is the velocity of a fluid, it measures how strongly the fluid flows along C,C\mathclose{\text{,}} round the loop.

The other natural question is how much fluid flows out across C,C\mathclose{\text{,}} and only the normal component of the velocity carries fluid across. Turning the unit tangent T=⟨x′,y′⟩/∥r′∥\vb{T} = \langle x', y'\rangle/\norm{\vb{r}'} a quarter turn clockwise gives the outward unit normal

n=⟨y′(t),−x′(t)⟩∥r′(t)∥,\vb{n} = \frac{\langle y'(t), -x'(t)\rangle}{\norm{\vb{r}'(t)}},

which points away from D,D\mathclose{\text{,}} because DD is on the left. On the unit circle traced by ⟨cos⁡t,sin⁡t⟩,\langle\cos t, \sin t\rangle\mathclose{\text{,}} for example, n=⟨cos⁡t,sin⁡t⟩.\vb{n} = \langle\cos t, \sin t\rangle\mathclose{\text{.}} The flux of F\vb{F} across CC is ∮CF⋅n ds.\oint_C \vb{F}\cdot\vb{n}\,ds\mathclose{\text{.}}

Theorem 20.7Green’s theorem, flux form

Under the hypotheses of Theorem 20.6, with n\vb{n} the outward unit normal of C,C\mathclose{\text{,}}

∮CF⋅n ds=∬D(∂P∂x+∂Q∂y) dA.\oint_C \vb{F}\cdot\vb{n}\,ds = \iint_D \Big(\frac{\partial P}{\partial x} + \frac{\partial Q}{\partial y}\Big)\,dA.
Proof

Since n ds=⟨y′(t),−x′(t)⟩ dt,\vb{n}\,ds = \langle y'(t), -x'(t)\rangle\,dt\mathclose{\text{,}}

F⋅n ds=(P y′(t)−Q x′(t)) dt=−Q dx+P dy.\begin{aligned} \vb{F}\cdot\vb{n}\,ds &= \big(P\,y'(t) - Q\,x'(t)\big)\,dt \\ &= -Q\,dx + P\,dy. \end{aligned}

The field ⟨−Q,P⟩\langle -Q, P\rangle also has components with continuous partial derivatives, and Green’s theorem for it is

∮C(−Q) dx+P dy=∬D(∂P∂x−∂(−Q)∂y) dA,\begin{aligned} &\oint_C (-Q)\,dx + P\,dy \\ &\quad= \iint_D \Big(\frac{\partial P}{\partial x} - \frac{\partial(-Q)}{\partial y}\Big)\,dA, \end{aligned}

which is the formula.

∎

If F\vb{F} is the velocity of a two-dimensional flow, the flux is the net rate at which fluid leaves DD across CC (in area per unit time), and Px+Qy,P_x + Q_y\mathclose{\text{,}} which Section 20.5 names the divergence, measures how fast the flow spreads out from each point. For the source G=⟨x,y⟩\vb{G} = \langle x, y\rangle and the unit circle, G⋅n=cos⁡2t+sin⁡2t=1,\vb{G}\cdot\vb{n} = \cos^2 t + \sin^2 t = 1\mathclose{\text{,}} so the flux is 2π,2\pi\mathclose{\text{,}} and indeed ∬D(1+1) dA=2π;\iint_D (1 + 1)\,dA = 2\pi\mathclose{\text{;}} the circulation is 0, since G\vb{G} is perpendicular to the circle. For the rotation field it is the other way round: circulation 2π,2\pi\mathclose{\text{,}} flux 0.

Try it

Choose a field, then move the circle with the sliders, or drag on the picture to move its centre. The readout gives the circulation ∮F⋅dr\oint \vb{F}\cdot d\vb{r} (anticlockwise) and the outward flux ∮F⋅n ds\oint \vb{F}\cdot\vb{n}\,ds round the circle, each beside the double integral over the disc that Green’s theorem says it equals, all computed numerically. With the rotation field the circulation is 2πr22\pi r^2 wherever the circle is, because Qx−Py=2Q_x - P_y = 2 everywhere. With the shear ⟨y,0⟩\langle y, 0\rangle every arrow is horizontal, yet the circulation is −πr2.-\pi r^2\mathclose{\text{.}} With the gradient field the circulation is 0 for every circle (Theorem 20.3). Then choose your own field, type PP = -y/(x^2+y^2) and QQ = x/(x^2+y^2) (Example 20.6), and compare circles with the origin strictly outside and strictly inside. With radius 1, try centres (2,1)(2,1) and (0.3,0.2),(0.3,0.2)\mathclose{\text{,}} respectively. The circulation is 0 outside and 2π2\pi inside (Exercise 20.11). Although Qx−Py=0Q_x-P_y=0 wherever the field is defined, a disc containing the origin fails the hypotheses of Green’s theorem. The readout can flag a mismatch or withhold unreliable estimates. Numerical agreement alone cannot check the hypotheses.

Area from the boundary

Under the hypotheses of Green’s theorem, if Qx−Py=1,Q_x - P_y = 1\mathclose{\text{,}} the area of DD is a line integral round its positively oriented boundary. Three simple choices are P=0,P = 0\mathclose{\text{,}} Q=x;Q = x\mathclose{\text{;}} P=−y,P = -y\mathclose{\text{,}} Q=0;Q = 0\mathclose{\text{;}} and P=−y/2,P = -y/2\mathclose{\text{,}} Q=x/2:Q = x/2\mathclose{\text{:}}

A=∮Cx dy=−∮Cy dx=12∮Cx dy−y dx.\begin{aligned} A &= \oint_C x\,dy = -\oint_C y\,dx \\ &= \frac12\oint_C x\,dy - y\,dx. \end{aligned}
Example 20.9The area of an ellipse✓ Checked

Find the area enclosed by the ellipse x=acos⁡t,x = a\cos t\mathclose{\text{,}} y=bsin⁡t,y = b\sin t\mathclose{\text{,}} 0≤t≤2π,0 \le t \le 2\pi\mathclose{\text{,}} where a,b>0.a, b > 0\mathclose{\text{.}}

The ellipse is traced anticlockwise. With dx=−asin⁡t dtdx = -a\sin t\,dt and dy=bcos⁡t dt,dy = b\cos t\,dt\mathclose{\text{,}}

A=12∮Cx dy−y dx=12∫02π(abcos⁡2t+absin⁡2t) dt=πab.\begin{aligned} A &= \frac12\oint_C x\,dy - y\,dx \\ &= \frac12\int_0^{2\pi} \big(ab\cos^2 t + ab\sin^2 t\big)\,dt \\ &= \pi ab. \end{aligned}

With a=b=ra = b = r this is the area of a circle, πr2.\pi r^2\mathclose{\text{.}}

Planimeters. A planimeter is a mechanical instrument that measures the area of a region drawn on paper, such as a field on a map, while its pointer traces the boundary once. With the fixed pivot outside the region, the measuring wheel accumulates a line integral as the pointer goes round. Green’s theorem relates this integral to the area.

Polygons. For a polygon the area formula becomes a sum. Along the edge from (x1,y1)(x_1, y_1) to (x2,y2),(x_2, y_2)\mathclose{\text{,}} traced by x=x1+t(x2−x1),x = x_1 + t(x_2 - x_1)\mathclose{\text{,}} y=y1+t(y2−y1),y = y_1 + t(y_2 - y_1)\mathclose{\text{,}} 0≤t≤1,0 \le t \le 1\mathclose{\text{,}}

x dy−y dx=[x (y2−y1)−y (x2−x1)] dt=(x1y2−x2y1) dt,\begin{aligned} &x\,dy - y\,dx \\ &\quad= \big[x\,(y_2 - y_1) - y\,(x_2 - x_1)\big]\,dt \\ &\quad= (x_1y_2 - x_2y_1)\,dt, \end{aligned}

because on expanding, the terms with tt cancel. So each edge contributes x1y2−x2y1,x_1y_2 - x_2y_1\mathclose{\text{,}} and a simple polygon with corners (x1,y1),…,(xn,yn),(x_1, y_1), \dots, (x_n, y_n)\mathclose{\text{,}} listed anticlockwise, has area

A=12∑k=1n(xkyk+1−xk+1yk),A = \frac12\sum_{k=1}^{n} \big(x_ky_{k+1} - x_{k+1}y_k\big),

where (xn+1,yn+1)(x_{n+1}, y_{n+1}) means the first corner (x1,y1)(x_1, y_1) again. This is the shoelace formula (or surveyor’s formula), which mapping and graphics software uses for the areas of polygons.

Compute itAreas from corners

The shoelace formula is a few lines of Python:

Python
import math

def area(corners):
    """The signed area of a simple polygon, with corners in boundary order."""
    n = len(corners)
    total = 0
    for k in range(n):
        x1, y1 = corners[k]
        x2, y2 = corners[(k + 1) % n]    # next corner; wraps round to the first
        total += x1*y2 - x2*y1
    return total/2

print(area([(0, 0), (2, 0), (2, 1), (0, 1)]))
print(area([(0, 0), (0, 1), (2, 1), (2, 0)]))
print(area([(0, 0), (4, 0), (4, 3), (2, 1), (0, 3)]))
Output
2.0
-2.0
8.0

The first rectangle, 2 by 1, has area 2. The second is the same rectangle with its corners listed clockwise: the sign of the answer gives the direction of the boundary. The third polygon has a notch cut into its top; the formula does not need it to be convex. The area of a regular polygon inscribed in the unit circle approaches the area of the disc as the number of sides increases:

Python
for n in [6, 100, 10000]:
    step = 2*math.pi/n          # angle between neighbouring corners
    corners = [(math.cos(k*step), math.sin(k*step)) for k in range(n)]
    print(f"{n} {area(corners):.10f}")
print(f"{math.pi:.10f}")
Output
6 2.5980762114
100 3.1395259765
10000 3.1415924469
3.1415926536

The values, shown to ten decimal places, approach π,\pi\mathclose{\text{,}} the area of the unit disc.

5

Curl and divergence

The two forms of Green’s theorem have two integrands, Qx−PyQ_x - P_y and Px+Qy.P_x + Q_y\mathclose{\text{.}} In space they become the curl and the divergence. Write ∇,\nabla\mathclose{\text{,}} read “del”, for the vector of partial derivative operators ⟨∂/∂x,∂/∂y,∂/∂z⟩.\big\langle \partial/\partial x, \partial/\partial y, \partial/\partial z\big\rangle\mathclose{\text{.}} Applied to a function ff it gives the gradient ∇f;\nabla f\mathclose{\text{;}} “crossed” and “dotted” with a field F,\vb{F}\mathclose{\text{,}} it gives the following.

Definition 20.6Curl and divergence

Let F=⟨P,Q,R⟩\vb{F} = \langle P, Q, R\rangle be a vector field whose components have first partial derivatives. The curl of F\vb{F} is the vector field

curl⁡F=∇×F=⟨Ry−Qz, Pz−Rx, Qx−Py⟩,\begin{aligned} &\operatorname{curl}\vb{F} = \nabla\times\vb{F} \\ &\quad= \big\langle R_y - Q_z,\ P_z - R_x,\ Q_x - P_y\big\rangle, \end{aligned}

and the divergence of F\vb{F} is the function

div⁡F=∇⋅F=Px+Qy+Rz.\operatorname{div}\vb{F} = \nabla\cdot\vb{F} = P_x + Q_y + R_z.

Here the subscripts are partial derivatives: Ry=∂R/∂y,R_y = \partial R/\partial y\mathclose{\text{,}} and so on.

Read “curl F” (or “del cross F”) and “div F” (or “del dot F”). The curl is the cross product of Module 16, with the operators of ∇\nabla in the middle row of the determinant:

∇×F=∣ijk∂/∂x∂/∂y∂/∂zPQR∣,\nabla\times\vb{F} = \begin{vmatrix} \vb{i} & \vb{j} & \vb{k} \\ \partial/\partial x & \partial/\partial y & \partial/\partial z \\ P & Q & R \end{vmatrix},

where “∂/∂y\partial/\partial y times RR” means ∂R/∂y.\partial R/\partial y\mathclose{\text{.}} The curl is a vector field; the divergence is a scalar field. A field ⟨P(x,y),Q(x,y)⟩\langle P(x, y), Q(x, y)\rangle in the plane counts as the field ⟨P,Q,0⟩\langle P, Q, 0\rangle in space, and then

curl⁡F=⟨0,0,Qx−Py⟩,div⁡F=Px+Qy,\begin{aligned} \operatorname{curl}\vb{F} &= \langle 0, 0, Q_x - P_y\rangle, \\ \operatorname{div}\vb{F} &= P_x + Q_y, \end{aligned}

the two integrands of Green’s theorem. Its two forms read

∮CF⋅T ds=∬D(curl⁡F)⋅k dA,∮CF⋅n ds=∬Ddiv⁡F dA.\begin{aligned} \oint_C \vb{F}\cdot\vb{T}\,ds &= \iint_D (\operatorname{curl}\vb{F})\cdot\vb{k}\,dA, \\ \oint_C \vb{F}\cdot\vb{n}\,ds &= \iint_D \operatorname{div}\vb{F}\,dA. \end{aligned}
Example 20.10Curl and divergence✓ Checked

(a) Find the curl and the divergence of F=⟨xy,yz,zx⟩.\vb{F} = \langle xy, yz, zx\rangle\mathclose{\text{.}} (b) Find Qx−PyQ_x - P_y and Px+QyP_x + Q_y for the rotation field ⟨−y,x⟩,\langle -y, x\rangle\mathclose{\text{,}} the source ⟨x,y⟩,\langle x, y\rangle\mathclose{\text{,}} the sink ⟨−x,−y⟩,\langle -x, -y\rangle\mathclose{\text{,}} the shear ⟨y,0⟩\langle y, 0\rangle and the constant field ⟨1,0.5⟩\langle 1, 0.5\rangle of the demonstration in Section 20.4.

(a) With P=xy,P = xy\mathclose{\text{,}} Q=yzQ = yz and R=zx:R = zx\mathclose{\text{:}}

curl⁡F=⟨0−y, 0−z, 0−x⟩=⟨−y,−z,−x⟩,div⁡F=y+z+x.\begin{aligned} \operatorname{curl}\vb{F} &= \langle 0 - y,\ 0 - z,\ 0 - x\rangle \\ &= \langle -y, -z, -x\rangle, \\ \operatorname{div}\vb{F} &= y + z + x. \end{aligned}

(b) One derivative at a time:

Field Qx−PyQ_x - P_y Px+QyP_x + Q_y
rotation ⟨−y,x⟩\langle -y, x\rangle 1−(−1)=21 - (-1) = 2 00
source ⟨x,y⟩\langle x, y\rangle 00 1+1=21 + 1 = 2
sink ⟨−x,−y⟩\langle -x, -y\rangle 00 −2-2
shear ⟨y,0⟩\langle y, 0\rangle 0−1=−10 - 1 = -1 00
constant ⟨1,0.5⟩\langle 1, 0.5\rangle 00 00

So round every circle of radius r,r\mathclose{\text{,}} Green’s theorem predicts circulation 2πr22\pi r^2 and flux 0 for the rotation field, circulation 0 and flux 2πr22\pi r^2 for the source, and circulation −πr2-\pi r^2 for the shear, wherever the circle is.

What curl and divergence measure

Rotation. Put a tiny paddle wheel into a flowing fluid. It turns if the fluid pushes harder on the paddles on one side of its axle than on the other. Green’s theorem makes this precise. Suppose F\vb{F} has continuous first partial derivatives near P0.P_0\mathclose{\text{.}} Let CrC_r be the circle of radius r>0r > 0 about P0,P_0\mathclose{\text{,}} traced anticlockwise, and DrD_r its disc. Then ∮CrF⋅dr=∬Dr(Qx−Py) dA.\oint_{C_r} \vb{F}\cdot d\vb{r} = \iint_{D_r} (Q_x - P_y)\,dA\mathclose{\text{.}} If Qx−PyQ_x - P_y is continuous, then on a small enough disc it differs from its value at P0P_0 by less than any number ε>0\varepsilon > 0 you choose, so the double integral differs from that value times πr2\pi r^2 by less than επr2.\varepsilon\pi r^2\mathclose{\text{.}} Dividing by the area and letting r→0:r \to 0\mathclose{\text{:}}

(curl⁡F)(P0)⋅k=lim⁡r→01πr2∮CrF⋅dr.(\operatorname{curl}\vb{F})(P_0)\cdot\vb{k} = \lim_{r\to0}\frac{1}{\pi r^2}\oint_{C_r} \vb{F}\cdot d\vb{r}.

The curl measures the limiting circulation per unit area. In space, Stokes’ theorem (Section 20.7) gives the component along n\vb{n} when the small loop lies in a plane with unit normal n.\vb{n}\mathclose{\text{.}} The largest signed value occurs when n\vb{n} points along the curl, if the curl is nonzero. This explains the paddle-wheel picture in the limit of a tiny wheel. For a rigid rotation the curl is twice the angular velocity: a wheel turning about the zz-axis at ω\omega radians per second has velocity field v=⟨−ωy,ωx,0⟩,\vb{v} = \langle -\omega y, \omega x, 0\rangle\mathclose{\text{,}} and curl⁡v=⟨0,0,ω−(−ω)⟩=⟨0,0,2ω⟩.\operatorname{curl}\vb{v} = \langle 0, 0, \omega - (-\omega)\rangle = \langle 0, 0, 2\omega\rangle\mathclose{\text{.}}

Expansion. In the same way, the flux form of Green’s theorem gives

(div⁡F)(P0)=lim⁡r→01πr2∮CrF⋅n ds.(\operatorname{div}\vb{F})(P_0) = \lim_{r\to0}\frac{1}{\pi r^2}\oint_{C_r} \vb{F}\cdot\vb{n}\,ds.

So the divergence is the rate at which the flow carries fluid out of small regions, per unit of area (per unit of volume, in space, by the divergence theorem of Section 20.7). Where div⁡F>0\operatorname{div}\vb{F} > 0 the fluid spreads out, as from the source; where it is negative the fluid gathers, as into the sink. An incompressible flow with no sources or sinks has div⁡F=0:\operatorname{div}\vb{F} = 0\mathclose{\text{:}} what flows into a region flows out again.

Watch out

A field can turn without arrows that go round, and arrows that go round need not turn. The shear ⟨y,0⟩\langle y, 0\rangle has parallel arrows, yet curl⁡F=⟨0,0,−1⟩:\operatorname{curl}\vb{F} = \langle 0, 0, -1\rangle\mathclose{\text{:}} above the xx-axis the fluid moves to the right, faster further up, so a paddle wheel is pushed harder at its top than at its bottom, and it turns clockwise. The arrows of the field of Example 20.6 go round the origin, yet its curl is 0\vb{0} wherever it is defined: the limiting circulation per unit area around a point away from the origin is zero.

Two identities

Theorem 20.8Two identities

If ff has continuous second partial derivatives, then curl⁡(∇f)=0.\operatorname{curl}(\nabla f) = \vb{0}\mathclose{\text{.}} If the components of F\vb{F} have continuous second partial derivatives, then div⁡(curl⁡F)=0.\operatorname{div}(\operatorname{curl}\vb{F}) = 0\mathclose{\text{.}}

Proof

With ∇f=⟨fx,fy,fz⟩,\nabla f = \langle f_x, f_y, f_z\rangle\mathclose{\text{,}}

curl⁡(∇f)=⟨fzy−fyz, fxz−fzx, fyx−fxy⟩,\begin{aligned} &\operatorname{curl}(\nabla f) \\ &\quad= \big\langle f_{zy} - f_{yz},\ f_{xz} - f_{zx},\ f_{yx} - f_{xy}\big\rangle, \end{aligned}

and each component is 0 by Clairaut’s theorem. In the same way,

div⁡(curl⁡F)=(Ry−Qz)x+(Pz−Rx)y+(Qx−Py)z=Ryx−Qzx+Pzy−Rxy+Qxz−Pyz,\begin{aligned} &\operatorname{div}(\operatorname{curl}\vb{F}) \\ &\quad= (R_y - Q_z)_x + (P_z - R_x)_y \\ &\qquad + (Q_x - P_y)_z \\ &\quad= R_{yx} - Q_{zx} + P_{zy} \\ &\qquad - R_{xy} + Q_{xz} - P_{yz}, \end{aligned}

and the six terms cancel in pairs, by Clairaut’s theorem again.

∎

For a field F\vb{F} with continuous first partial derivatives, a nonzero curl rules out a potential by the first identity. Conversely, if curl⁡F=0\operatorname{curl}\vb{F} = \vb{0} on an open, simply connected region of space, then F\vb{F} is conservative. Here simply connected means connected and every closed path can be continuously shrunk to a point within the region. For example, a ball and space with one point removed are simply connected. A loop round a removed line cannot shrink to a point without crossing the line. Section 20.7 gives the idea behind the converse.

By the second identity, a field with nonzero divergence, such as ⟨x,y,z⟩,\langle x, y, z\rangle\mathclose{\text{,}} cannot be the curl of a field with continuous second partial derivatives.

Compute itCurl and divergence with SymPy

SymPy’s sympy.vector module knows the operators of this section. It works in a coordinate system, here called N, with coordinates N.x, N.y, N.z and unit vectors N.i, N.j, N.k:

Python
import sympy as sp
from sympy.vector import CoordSys3D, curl, divergence, gradient
N = CoordSys3D('N')
x, y, z = N.x, N.y, N.z
F = x*y*N.i + y*z*N.j + z*x*N.k          # Example 20.10
print(curl(F))
print(divergence(F))
print(divergence(curl(F)))
Output
(-N.y)*N.i + (-N.z)*N.j + (-N.x)*N.k
N.x + N.y + N.z
0

The answers of Example 20.10, written with SymPy’s unit vectors, and the identity div⁡curl⁡F=0.\operatorname{div}\operatorname{curl}\vb{F} = 0\mathclose{\text{.}} The other identity, and a potential:

Python
f = x**2*y*sp.sin(z)
print(gradient(f))
print(curl(gradient(f)))
from sympy.vector import is_conservative, scalar_potential
G = 2*x*y*N.i + (x**2 + 2*y*z)*N.j + y**2*N.k
print(is_conservative(G), scalar_potential(G, N))
Output
(2*N.x*N.y*sin(N.z))*N.i + (N.x**2*sin(N.z))*N.j + (N.x**2*N.y*cos(N.z))*N.k
0
True N.x**2*N.y + N.y**2*N.z

is_conservative checks only that the curl is 0,\vb{0}\mathclose{\text{,}} and scalar_potential finds a potential by integrating, as in Example 20.7. Neither looks at the region:

Python
V = -y/(x**2 + y**2)*N.i + x/(x**2 + y**2)*N.j      # Example 20.6
print(is_conservative(V))
Output
True

SymPy says yes, but Example 20.6 showed that this field is not conservative on the plane without the origin. The hypothesis “simply connected” is yours to check.

6

Surfaces and surface integrals

Parametric surfaces

A curve in space is traced by a point that depends on one parameter, r(t).\vb{r}(t)\mathclose{\text{.}} A surface is traced by a point that depends on two.

Definition 20.7Parametric surface

A parametric surface SS is the set of points

r(u,v)=⟨x(u,v),y(u,v),z(u,v)⟩\vb{r}(u, v) = \big\langle x(u, v), y(u, v), z(u, v)\big\rangle

for (u,v)(u, v) in a region DD of the uvuv-plane. The function r\vb{r} is a parametrisation of S.S\mathclose{\text{.}}

Three examples recur. The radius aa and cylinder height hh are positive:

  • the sphere of radius aa centred at the origin, from the spherical coordinates of Module 19 with ρ=a:\rho = a\mathclose{\text{:}} r(φ,θ)=⟨asin⁡φcos⁡θ,asin⁡φsin⁡θ,acos⁡φ⟩,\vb{r}(\varphi, \theta) = \langle a\sin\varphi\cos\theta, a\sin\varphi\sin\theta, a\cos\varphi\rangle\mathclose{\text{,}} 0≤φ≤π,0 \le \varphi \le \pi\mathclose{\text{,}} 0≤θ≤2π;0 \le \theta \le 2\pi\mathclose{\text{;}}
  • the cylinder x2+y2=a2,x^2 + y^2 = a^2\mathclose{\text{,}} 0≤z≤h:0 \le z \le h\mathclose{\text{:}} r(θ,z)=⟨acos⁡θ,asin⁡θ,z⟩,\vb{r}(\theta, z) = \langle a\cos\theta, a\sin\theta, z\rangle\mathclose{\text{,}} 0≤θ≤2π,0 \le \theta \le 2\pi\mathclose{\text{,}} 0≤z≤h;0 \le z \le h\mathclose{\text{;}}
  • the graph of a function z=g(x,y)z = g(x, y) over a region D:D\mathclose{\text{:}} r(x,y)=⟨x,y,g(x,y)⟩,\vb{r}(x, y) = \langle x, y, g(x, y)\rangle\mathclose{\text{,}} with xx and yy themselves as the parameters.

Holding vv fixed and letting uu vary traces a curve on S,S\mathclose{\text{,}} a grid curve, whose tangent vector is the partial derivative ru=∂r/∂u\vb{r}_u = \partial\vb{r}/\partial u (differentiate each component); holding uu fixed gives a grid curve with tangent vector rv.\vb{r}_v\mathclose{\text{.}} When these vectors are linearly independent, they span the tangent plane of S.S\mathclose{\text{.}} Their cross product

N=ru×rv\vb{N} = \vb{r}_u\times\vb{r}_v

is perpendicular to S:S\mathclose{\text{:}} a normal vector (Figure 20.4). Here we use smooth patches with continuously differentiable parametrisations on a neighbourhood of DD and ru×rv≠0\vb{r}_u\times\vb{r}_v \ne \vb{0} in its interior. Each patch is traced once apart from possible repeats along its edges. A piecewise smooth surface is made of finitely many such patches that meet only along edges or at points.

Example 20.11Normal vectors of a sphere and of a graph✓ Checked

Find ru×rv\vb{r}_u\times\vb{r}_v (a) for the sphere of radius a,a\mathclose{\text{,}} and (b) for the graph of z=g(x,y).z = g(x, y)\mathclose{\text{.}}

(a) Here rφ=⟨acos⁡φcos⁡θ,acos⁡φsin⁡θ,−asin⁡φ⟩\vb{r}_\varphi = \langle a\cos\varphi\cos\theta, a\cos\varphi\sin\theta, -a\sin\varphi\rangle and rθ=⟨−asin⁡φsin⁡θ,asin⁡φcos⁡θ,0⟩.\vb{r}_\theta = \langle -a\sin\varphi\sin\theta, a\sin\varphi\cos\theta, 0\rangle\mathclose{\text{.}} The cross product, simplified with cos⁡2θ+sin⁡2θ=1,\cos^2\theta + \sin^2\theta = 1\mathclose{\text{,}} is

rφ×rθ=⟨a2sin⁡2φcos⁡θ,a2sin⁡2φsin⁡θ, a2sin⁡φcos⁡φ⟩=asin⁡φ  r(φ,θ).\begin{aligned} &\vb{r}_\varphi\times\vb{r}_\theta \\ &\quad= \big\langle a^2\sin^2\varphi\cos\theta, a^2\sin^2\varphi\sin\theta, \\ &\qquad\ a^2\sin\varphi\cos\varphi\big\rangle \\ &\quad= a\sin\varphi\;\vb{r}(\varphi, \theta). \end{aligned}

For 0<φ<π0 < \varphi < \pi this is a positive multiple of r,\vb{r}\mathclose{\text{,}} so it points outwards. At the poles it is zero, because the longitude grid curve collapses there. Its length is asin⁡φ⋅a=a2sin⁡φ.a\sin\varphi \cdot a = a^2\sin\varphi\mathclose{\text{.}}

(b) Here rx=⟨1,0,gx⟩\vb{r}_x = \langle 1, 0, g_x\rangle and ry=⟨0,1,gy⟩,\vb{r}_y = \langle 0, 1, g_y\rangle\mathclose{\text{,}} so rx×ry=⟨−gx,−gy,1⟩.\vb{r}_x\times\vb{r}_y = \langle -g_x, -g_y, 1\rangle\mathclose{\text{.}} It points upwards (its zz-component is 1), and its length is 1+gx2+gy2.\sqrt{1 + g_x^2 + g_y^2}\mathclose{\text{.}}

A parametric surface: the sphere of Example 20.11. A small rectangle of sides Deltavarphi and Deltatheta in the varphitheta-plane (left) is carried by vb{r} to a small patch of the sphere (right, orange), close to the parallelogram spanned by vb{r}varphiDeltavarphi and vb{r}thetaDeltatheta. The normal vector vb{N} = vb{r}varphitimesvb{r}theta is perpendicular to the sphere, and norm{vb{N}},Deltavarphi,Deltatheta is close to the patch's area.
Figure 20.4

A parametric surface: the sphere of Example 20.11. A small rectangle of sides Δφ\Delta\varphi and Δθ\Delta\theta in the φθ\varphi\theta-plane (left) is carried by r\vb{r} to a small patch of the sphere (right, orange), close to the parallelogram spanned by rφΔφ\vb{r}_\varphi\Delta\varphi and rθΔθ.\vb{r}_\theta\Delta\theta\mathclose{\text{.}} The normal vector N=rφ×rθ\vb{N} = \vb{r}_\varphi\times\vb{r}_\theta is perpendicular to the sphere, and ∥N∥ Δφ Δθ\norm{\vb{N}}\,\Delta\varphi\,\Delta\theta is close to the patch’s area.

Surface area

Cut DD into small rectangles of sides Δu\Delta u and Δv.\Delta v\mathclose{\text{.}} The one with corner (u,v)(u, v) is carried to a small curved patch of SS with a corner at r(u,v).\vb{r}(u, v)\mathclose{\text{.}} Since r(u+Δu,v)−r(u,v)≈ru Δu\vb{r}(u + \Delta u, v) - \vb{r}(u, v) \approx \vb{r}_u\,\Delta u and r(u,v+Δv)−r(u,v)≈rv Δv,\vb{r}(u, v + \Delta v) - \vb{r}(u, v) \approx \vb{r}_v\,\Delta v\mathclose{\text{,}} the patch is close to the parallelogram spanned by ru Δu\vb{r}_u\,\Delta u and rv Δv,\vb{r}_v\,\Delta v\mathclose{\text{,}} whose area is ∥ru×rv∥ Δu Δv\norm{\vb{r}_u\times\vb{r}_v}\,\Delta u\,\Delta v (Module 16). Adding over the patches:

Definition 20.8Surface area

If SS is traced once by a smooth parametrisation r(u,v)\vb{r}(u, v) over a bounded region DD with piecewise smooth boundary, its surface area is

A(S)=∬D∥ru×rv∥ dA.A(S) = \iint_D \norm{\vb{r}_u\times\vb{r}_v}\,dA.

“Traced once” allows repeats on the edge of D:D\mathclose{\text{:}} the sphere’s parametrisation gives the points with θ=0\theta = 0 and θ=2π\theta = 2\pi twice, and each pole for a whole edge of D,D\mathclose{\text{,}} but those repeats have zero surface area. For a piecewise smooth surface, add the areas of its patches. For a smooth graph z=g(x,y),z = g(x, y)\mathclose{\text{,}} by Example 20.11(b),

A(S)=∬D1+gx2+gy2 dA.A(S) = \iint_D \sqrt{1 + g_x^2 + g_y^2}\,dA.
Example 20.12Two surface areas✓ Checked

(a) Find the area of the sphere of radius a.a\mathclose{\text{.}} (b) Find the area of the dome z=1−x2−y2,z = 1 - x^2 - y^2\mathclose{\text{,}} z≥0.z \ge 0\mathclose{\text{.}}

(a) By Example 20.11, ∥rφ×rθ∥=a2sin⁡φ,\norm{\vb{r}_\varphi\times\vb{r}_\theta} = a^2\sin\varphi\mathclose{\text{,}} so

A=∫02π ⁣ ⁣∫0πa2sin⁡φ dφ dθ=2πa2[−cos⁡φ]0π=4πa2,\begin{aligned} A &= \int_0^{2\pi}\!\!\int_0^\pi a^2\sin\varphi\,d\varphi\,d\theta \\ &= 2\pi a^2\big[-\cos\varphi\big]_0^\pi = 4\pi a^2, \end{aligned}

the familiar formula, which Module 12 also found from a surface of revolution.

(b) The dome is the graph of g(x,y)=1−x2−y2g(x, y) = 1 - x^2 - y^2 over the unit disc DD (where z≥0).z \ge 0\mathclose{\text{).}} With gx=−2xg_x = -2x and gy=−2y,g_y = -2y\mathclose{\text{,}} in polar coordinates,

A=∬D1+4x2+4y2 dA=∫02π ⁣ ⁣∫011+4r2 r dr dθ.\begin{aligned} A &= \iint_D \sqrt{1 + 4x^2 + 4y^2}\,dA \\ &= \int_0^{2\pi}\!\!\int_0^1 \sqrt{1 + 4r^2}\,r\,dr\,d\theta. \end{aligned}

Substitute w=1+4r2,w = 1 + 4r^2\mathclose{\text{,}} dw=8r dr:dw = 8r\,dr\mathclose{\text{:}} ∫011+4r2 r dr=18∫15w dw=112(55−1).\int_0^1 \sqrt{1 + 4r^2}\,r\,dr = \frac18\int_1^5 \sqrt w\,dw = \frac{1}{12}\big(5\sqrt5 - 1\big)\mathclose{\text{.}} So

A=π6(55−1)≈5.330,A = \frac{\pi}{6}\big(5\sqrt5 - 1\big) \approx 5.330,

against π≈3.142\pi \approx 3.142 for the flat disc under the dome.

Surface integrals

Think of a thin shell whose density varies across its surface. Approximate its mass by splitting it into patches and multiplying each patch’s area by the density at one point. The limit uses the same area factor as before, with an extra factor for the density.

Definition 20.9Surface integral of a function

Let SS be traced once by a smooth parametrisation r(u,v),\vb{r}(u, v)\mathclose{\text{,}} (u,v)(u, v) in D,D\mathclose{\text{,}} and let ff be continuous on S.S\mathclose{\text{.}} The surface integral of ff over SS is

∬Sf dS=∬Df(r(u,v)) ∥ru×rv∥ dA.\begin{aligned} &\iint_S f\,dS \\ &\quad= \iint_D f\big(\vb{r}(u, v)\big)\,\norm{\vb{r}_u\times\vb{r}_v}\,dA. \end{aligned}

As ∫Cf ds\int_C f\,ds adds up ff times short lengths, ∬Sf dS\iint_S f\,dS adds up ff times small areas dS=∥ru×rv∥ dA.dS = \norm{\vb{r}_u\times\vb{r}_v}\,dA\mathclose{\text{.}} With f=1f = 1 it is the area of S;S\mathclose{\text{;}} with a density, it gives the mass of a thin shell. Divide by the area, if it is positive, to get the average of f.f\mathclose{\text{.}} For a surface made of several patches, add their integrals. A smooth change of parameters multiplies the cross product by its signed Jacobian determinant, by the chain rule. The length picks up the absolute value, exactly the factor in Module 19’s change of variables formula. This makes the integral independent of the choice of smooth parameters.

Example 20.13The centre of mass of a shell✓ Checked

Find the height of the centre of mass of a thin shell of uniform positive density in the shape of the hemisphere x2+y2+z2=a2,x^2 + y^2 + z^2 = a^2\mathclose{\text{,}} z≥0,z \ge 0\mathclose{\text{,}} with a>0.a > 0\mathclose{\text{.}}

By symmetry xˉ=yˉ=0.\bar x = \bar y = 0\mathclose{\text{.}} With a constant density, zˉ\bar z is the average of zz over the shell, zˉ=1A∬Sz dS,\bar z = \frac{1}{A}\iint_S z\,dS\mathclose{\text{,}} where A=2πa2A = 2\pi a^2 is half the area of the sphere. With the sphere’s parametrisation and 0≤φ≤π/2,0 \le \varphi \le \pi/2\mathclose{\text{,}}

∬Sz dS=∫02π ⁣ ⁣∫0π/2(acos⁡φ)(a2sin⁡φ) dφ dθ=2πa3[12sin⁡2φ]0π/2=πa3.\begin{aligned} &\iint_S z\,dS \\ &\quad= \int_0^{2\pi}\!\!\int_0^{\pi/2} (a\cos\varphi)(a^2\sin\varphi)\,d\varphi\,d\theta \\ &\quad= 2\pi a^3\Big[\tfrac12\sin^2\varphi\Big]_0^{\pi/2} = \pi a^3. \end{aligned}

So zˉ=πa3/(2πa2)=a/2:\bar z = \pi a^3/(2\pi a^2) = a/2\mathclose{\text{:}} the centre of mass is exactly halfway up. For a uniform solid hemisphere the horizontal slices have area π(a2−z2),\pi(a^2-z^2)\mathclose{\text{,}} which decreases with height. Its centre of mass is lower, at ∫0az(a2−z2) dz∫0a(a2−z2) dz=3a/8.\dfrac{\int_0^a z(a^2-z^2)\,dz}{\int_0^a (a^2-z^2)\,dz} = 3a/8\mathclose{\text{.}}

Orientation and flux

A sphere, or a dome, has two sides. To orient a smooth surface, choose a unit normal n\vb{n} that varies continuously and points towards the chosen side. On a piecewise smooth surface, the choices on adjoining patches must pick the same side, though the normals may differ at a crease. A closed surface such as a sphere or the surface of a cube has no edge. When it bounds a solid, the outward orientation points away from that solid. On a regular patch, n=(ru×rv)/∥ru×rv∥\vb{n} = (\vb{r}_u\times\vb{r}_v)/\norm{\vb{r}_u\times\vb{r}_v} chooses one side and −n-\vb{n} chooses the other. Not every surface has two sides: a Möbius strip, a strip of paper given half a twist before its ends are joined, has only one, and cannot be oriented.

Now let a fluid with velocity F\vb{F} flow through S,S\mathclose{\text{,}} as water through a net. Through a small, nearly flat patch of area ΔS\Delta S with unit normal n,\vb{n}\mathclose{\text{,}} the fluid that crosses in a short time Δt\Delta t fills a slanted box with base ΔS\Delta S and height ∣F⋅n∣ Δt.\abs{\vb{F}\cdot\vb{n}}\,\Delta t\mathclose{\text{.}} The signed rate across the patch is (F⋅n) ΔS,(\vb{F}\cdot\vb{n})\,\Delta S\mathclose{\text{,}} in volume per unit time. A negative sign means flow against the chosen normal. The tangential part carries nothing across. Adding over the patches:

Definition 20.10Flux

Let SS be an oriented surface with unit normal n,\vb{n}\mathclose{\text{,}} and let F\vb{F} be a continuous vector field on S.S\mathclose{\text{.}} The flux of F\vb{F} across SS is

∬SF⋅dS=∬SF⋅n dS.\iint_S \vb{F}\cdot d\vb{S} = \iint_S \vb{F}\cdot\vb{n}\,dS.

To compute it, trace SS once by r(u,v),\vb{r}(u, v)\mathclose{\text{,}} (u,v)(u, v) in D,D\mathclose{\text{,}} with ru×rv\vb{r}_u\times\vb{r}_v pointing to the side that n\vb{n} chooses. Then the lengths cancel,

n dS=ru×rv∥ru×rv∥ ∥ru×rv∥ dA=(ru×rv) dA,\begin{aligned} \vb{n}\,dS &= \frac{\vb{r}_u\times\vb{r}_v}{\norm{\vb{r}_u\times\vb{r}_v}}\,\norm{\vb{r}_u\times\vb{r}_v}\,dA \\ &= \big(\vb{r}_u\times\vb{r}_v\big)\,dA, \end{aligned}

and so

∬SF⋅dS=∬DF(r(u,v))⋅(ru×rv) dA.\iint_S \vb{F}\cdot d\vb{S} = \iint_D \vb{F}\big(\vb{r}(u, v)\big)\cdot\big(\vb{r}_u\times\vb{r}_v\big)\,dA.

If ru×rv\vb{r}_u\times\vb{r}_v points to the other side, the flux is minus this. The same definition gives electric flux, magnetic flux and the flux of heat across a surface.

Example 20.14Flux out of a sphere✓ Checked

Find the flux of F(x,y,z)=⟨x,y,z⟩\vb{F}(x, y, z) = \langle x, y, z\rangle outwards across the sphere of radius aa centred at the origin.

By Example 20.11, rφ×rθ=asin⁡φ r(φ,θ)\vb{r}_\varphi\times\vb{r}_\theta = a\sin\varphi\,\vb{r}(\varphi, \theta) points outwards away from the poles, and F(r(φ,θ))=r(φ,θ),\vb{F}\big(\vb{r}(\varphi, \theta)\big) = \vb{r}(\varphi, \theta)\mathclose{\text{,}} whose length is a.a\mathclose{\text{.}} So F⋅(rφ×rθ)=asin⁡φ ∥r∥2=a3sin⁡φ,\vb{F}\cdot(\vb{r}_\varphi\times\vb{r}_\theta) = a\sin\varphi\,\norm{\vb{r}}^2 = a^3\sin\varphi\mathclose{\text{,}} and

∬SF⋅dS=∫02π ⁣ ⁣∫0πa3sin⁡φ dφ dθ=4πa3.\begin{aligned} \iint_S \vb{F}\cdot d\vb{S} &= \int_0^{2\pi}\!\!\int_0^\pi a^3\sin\varphi\,d\varphi\,d\theta \\ &= 4\pi a^3. \end{aligned}

The same without the parametrisation: on the sphere n=r/a,\vb{n} = \vb{r}/a\mathclose{\text{,}} so F⋅n=∥r∥2/a=a\vb{F}\cdot\vb{n} = \norm{\vb{r}}^2/a = a everywhere, and the flux is aa times the area, a⋅4πa2=4πa3.a\cdot 4\pi a^2 = 4\pi a^3\mathclose{\text{.}}

Watch out

Two slips with surfaces. (1) Forgetting ∥ru×rv∥\norm{\vb{r}_u\times\vb{r}_v} in ∬Sf dS:\iint_S f\,dS\mathclose{\text{:}} it is the factor that turns du dvdu\,dv into area, as ∥r′(t)∥\norm{\vb{r}'(t)} turns dtdt into length. (2) In a flux integral, using the length ∥ru×rv∥\norm{\vb{r}_u\times\vb{r}_v} where the vector ru×rv\vb{r}_u\times\vb{r}_v belongs, or not checking which way it points: with rθ×rφ=−rφ×rθ,\vb{r}_\theta\times\vb{r}_\varphi = -\vb{r}_\varphi\times\vb{r}_\theta\mathclose{\text{,}} the normal of the sphere points inwards, and the flux of Example 20.14 comes out as −4πa3.-4\pi a^3\mathclose{\text{.}} The flux changes sign when the orientation is reversed, as ∫CF⋅dr\int_C \vb{F}\cdot d\vb{r} does when CC is reversed, while ∬Sf dS,\iint_S f\,dS\mathclose{\text{,}} like ∫Cf ds,\int_C f\,ds\mathclose{\text{,}} does not.

7

Stokes’ theorem and the divergence theorem

Stokes’ theorem

Green’s theorem relates the circulation round a closed curve in the plane to the curl inside it. The same circle in space can be the edge of a flat disc or a curved dome. When both surfaces are oriented compatibly and the field is smooth on a neighbourhood of each, Stokes’ theorem says the circulation round the circle equals the flux of the curl through either surface.

The boundary curve CC of an oriented surface SS is positively oriented if, when you walk along CC with your head pointing in the direction of n,\vb{n}\mathclose{\text{,}} the surface is on your left. For a flat disc, curl the fingers of your right hand in the direction of CC and your thumb points along n\vb{n} (the right-hand rule; Figure 20.5, left).

Theorem 20.9Stokes’ theorem

Let SS be an oriented, piecewise smooth surface whose boundary is a simple closed, piecewise smooth curve CC with positive orientation. If the components of F\vb{F} have continuous first partial derivatives on an open region of space that contains S,S\mathclose{\text{,}} then

∮CF⋅dr=∬Scurl⁡F⋅dS.\oint_C \vb{F}\cdot d\vb{r} = \iint_S \operatorname{curl}\vb{F}\cdot d\vb{S}.

When SS is a flat region of the xyxy-plane, oriented upwards, n=k\vb{n} = \vb{k} and curl⁡F⋅k=Qx−Py.\operatorname{curl}\vb{F}\cdot\vb{k} = Q_x - P_y\mathclose{\text{.}} Stokes’ theorem becomes Green’s theorem in its circulation form. More generally, the boundary integral adds the contributions of all boundary curves with their induced orientations. In particular it is 0 for a closed surface. These extensions use cancellation along cuts between patches.

The idea of the proof. Cut SS into small, nearly flat patches. Round each patch the circulation is about (curl⁡F⋅n) ΔS:(\operatorname{curl}\vb{F}\cdot\vb{n})\,\Delta S\mathclose{\text{:}} the small-square estimate of Section 20.4, made in the plane of the patch, with its normal n\vb{n} in place of k.\vb{k}\mathclose{\text{.}} Add over the patches. An edge shared by two patches is traced once in each direction, so its contributions cancel, and what is left is the circulation round C;C\mathclose{\text{;}} meanwhile the terms (curl⁡F⋅n) ΔS(\operatorname{curl}\vb{F}\cdot\vb{n})\,\Delta S add up to about ∬Scurl⁡F⋅dS.\iint_S \operatorname{curl}\vb{F}\cdot d\vb{S}\mathclose{\text{.}} For a surface that is a graph, a longer computation with the chain rule reduces Stokes’ theorem to Green’s theorem; the general proof is beyond this series.

Example 20.15Stokes’ theorem on a dome✓ Checked

Let F=⟨z,x,y⟩,\vb{F} = \langle z, x, y\rangle\mathclose{\text{,}} and let SS be the dome z=1−x2−y2,z = 1 - x^2 - y^2\mathclose{\text{,}} z≥0,z \ge 0\mathclose{\text{,}} oriented upwards. Check Stokes’ theorem by computing both sides.

The line integral. The edge of the dome is the unit circle in the xyxy-plane. For the upward orientation of the graph, the region projects to the left of an anticlockwise traversal of the rim, so the positive direction is anticlockwise seen from above: r(t)=⟨cos⁡t,sin⁡t,0⟩,\vb{r}(t) = \langle\cos t, \sin t, 0\rangle\mathclose{\text{,}} 0≤t≤2π.0 \le t \le 2\pi\mathclose{\text{.}} Then F(r(t))=⟨0,cos⁡t,sin⁡t⟩\vb{F}\big(\vb{r}(t)\big) = \langle 0, \cos t, \sin t\rangle and r′(t)=⟨−sin⁡t,cos⁡t,0⟩,\vb{r}'(t) = \langle -\sin t, \cos t, 0\rangle\mathclose{\text{,}} so

∮CF⋅dr=∫02πcos⁡2t dt=π.\oint_C \vb{F}\cdot d\vb{r} = \int_0^{2\pi} \cos^2 t\,dt = \pi.

The surface integral. With P=z,P = z\mathclose{\text{,}} Q=xQ = x and R=y,R = y\mathclose{\text{,}}

curl⁡F=⟨1−0, 1−0, 1−0⟩=⟨1,1,1⟩.\begin{aligned} \operatorname{curl}\vb{F} &= \langle 1 - 0,\ 1 - 0,\ 1 - 0\rangle \\ &= \langle 1, 1, 1\rangle. \end{aligned}

By Example 20.11(b) with g=1−x2−y2,g = 1 - x^2 - y^2\mathclose{\text{,}} the upward normal is ⟨−gx,−gy,1⟩=⟨2x,2y,1⟩,\langle -g_x, -g_y, 1\rangle = \langle 2x, 2y, 1\rangle\mathclose{\text{,}} so

∬Scurl⁡F⋅dS=∬D(2x+2y+1) dA\iint_S \operatorname{curl}\vb{F}\cdot d\vb{S} = \iint_D (2x + 2y + 1)\,dA

over the unit disc D.D\mathclose{\text{.}} The terms 2x2x and 2y2y integrate to 0 by symmetry, which leaves the area of D:D\mathclose{\text{:}} π.\pi\mathclose{\text{.}} Both sides are π.\pi\mathclose{\text{.}}

The flat unit disc, oriented upwards, has the same boundary, and on it curl⁡F⋅k=1,\operatorname{curl}\vb{F}\cdot\vb{k} = 1\mathclose{\text{,}} so its flux is π\pi as well. That is no accident: by Stokes’ theorem, the flux of curl⁡F\operatorname{curl}\vb{F} is the same through any two surfaces with the same oriented boundary, provided the field meets the hypotheses on both.

Left: Stokes' theorem on the dome of Example 20.15. The normals point upwards, and the boundary circle is traced anticlockwise seen from above: walking along it with your head along the normals, the dome is on your left. Right: the divergence theorem on the solid cylinder of Example 20.16. The boundary has three pieces, the top, the bottom and the side, and on each the normal points outwards.
Figure 20.5

Left: Stokes’ theorem on the dome of Example 20.15. The normals point upwards, and the boundary circle is traced anticlockwise seen from above: walking along it with your head along the normals, the dome is on your left. Right: the divergence theorem on the solid cylinder of Example 20.16. The boundary has three pieces, the top, the bottom and the side, and on each the normal points outwards.

Why the test in space works. Suppose F\vb{F} has continuous first partial derivatives and zero curl on an open, simply connected region. If a loop bounds an oriented surface within the region, Stokes’ theorem gives zero circulation. For the general case, shrinking the loop to a point gives a continuous map of a disc into the region. The image can overlap itself. Approximate the map by small triangles, joining nearby image points by straight segments. Fineness keeps those triangles in the region because the image is compact and the region is open. Stokes’ theorem gives zero circulation round each triangle. Shared edges cancel even if the triangles overlap in space, and the remaining boundary chords tend to the original loop as in Section 20.4. Thus every piecewise smooth loop has zero circulation, which gives a potential by Theorem 20.3.

The divergence theorem

The flux form of Green’s theorem relates the flux out of a plane region to the divergence inside. Here is its version in space.

Theorem 20.10The divergence theorem

Let EE be a bounded solid region including its boundary S,S\mathclose{\text{,}} with SS a closed, piecewise smooth surface, oriented outwards. If the components of F\vb{F} have continuous first partial derivatives on an open region that contains E,E\mathclose{\text{,}} then

∬SF⋅dS=∭Ediv⁡F dV.\iint_S \vb{F}\cdot d\vb{S} = \iiint_E \operatorname{div}\vb{F}\,dV.

It is also called Gauss’s theorem. In words: the net rate at which a fluid flows out through the boundary equals the total, over the inside, of the rate at which the fluid is produced or expands there.

Proof of the divergence theorem for a box

Let EE be the box a1≤x≤b1,a_1 \le x \le b_1\mathclose{\text{,}} a2≤y≤b2,a_2 \le y \le b_2\mathclose{\text{,}} a3≤z≤b3,a_3 \le z \le b_3\mathclose{\text{,}} and write F=⟨P,0,0⟩+⟨0,Q,0⟩+⟨0,0,R⟩.\vb{F} = \langle P, 0, 0\rangle + \langle 0, Q, 0\rangle + \langle 0, 0, R\rangle\mathclose{\text{.}} Both sides of the theorem are sums of the corresponding terms for these three fields, so take ⟨0,0,R⟩.\langle 0, 0, R\rangle\mathclose{\text{.}} On the four side faces of the box n\vb{n} is horizontal, and ⟨0,0,R⟩⋅n=0.\langle 0, 0, R\rangle\cdot\vb{n} = 0\mathclose{\text{.}} On the top n=k,\vb{n} = \vb{k}\mathclose{\text{,}} and on the bottom n=−k.\vb{n} = -\vb{k}\mathclose{\text{.}} With ZZ the rectangle a1≤x≤b1,a_1 \le x \le b_1\mathclose{\text{,}} a2≤y≤b2,a_2 \le y \le b_2\mathclose{\text{,}}

∬S⟨0,0,R⟩⋅dS=∬Z[R(x,y,b3)−R(x,y,a3)] dA=∬Z∫a3b3∂R∂z dz dA=∭E∂R∂z dV,\begin{aligned} &\iint_S \langle 0, 0, R\rangle\cdot d\vb{S} \\ &\quad= \iint_Z \big[R(x, y, b_3) - R(x, y, a_3)\big]\,dA \\ &\quad= \iint_Z \int_{a_3}^{b_3} \frac{\partial R}{\partial z}\,dz\,dA \\ &\quad= \iiint_E \frac{\partial R}{\partial z}\,dV, \end{aligned}

by Part 2 of the Fundamental Theorem in zz and Fubini’s theorem. In the same way the flux of ⟨P,0,0⟩\langle P, 0, 0\rangle is ∭EPx dV,\iiint_E P_x\,dV\mathclose{\text{,}} and that of ⟨0,Q,0⟩\langle 0, Q, 0\rangle is ∭EQy dV.\iiint_E Q_y\,dV\mathclose{\text{.}} Adding the three gives the theorem.

∎

A solid made of boxes with disjoint interiors follows by adding: on a face shared by two boxes their outward normals point in opposite directions, so the fluxes through it cancel. General solids need a finer argument, beyond this series. The theorem also holds for a solid with cavities, such as a thick spherical shell, when every part of its boundary is oriented away from E:E\mathclose{\text{:}} the outer surface outwards, and the surface of each cavity into the cavity.

Example 20.16The divergence theorem on a cylinder✓ Checked

Let F=⟨x,y,z2⟩,\vb{F} = \langle x, y, z^2\rangle\mathclose{\text{,}} and let EE be the solid cylinder x2+y2≤1,x^2 + y^2 \le 1\mathclose{\text{,}} 0≤z≤2.0 \le z \le 2\mathclose{\text{.}} Check the divergence theorem by computing both sides.

The volume integral. div⁡F=1+1+2z=2+2z.\operatorname{div}\vb{F} = 1 + 1 + 2z = 2 + 2z\mathclose{\text{.}} Each horizontal slice of the cylinder is a disc of area π,\pi\mathclose{\text{,}} on which 2+2z2 + 2z is constant, so

∭E(2+2z) dV=∫02(2+2z) π dz=π[2z+z2]02=8π.\begin{aligned} \iiint_E (2 + 2z)\,dV &= \int_0^2 (2 + 2z)\,\pi\,dz \\ &= \pi\big[2z + z^2\big]_0^2 = 8\pi. \end{aligned}

The flux. The boundary has three smooth pieces. On the top (z=2,z = 2\mathclose{\text{,}} n=k),\vb{n} = \vb{k}\mathclose{\text{),}} F⋅n=z2=4,\vb{F}\cdot\vb{n} = z^2 = 4\mathclose{\text{,}} so the flux is 4×π=4π.4\times\pi = 4\pi\mathclose{\text{.}} On the bottom (z=0,z = 0\mathclose{\text{,}} n=−k),\vb{n} = -\vb{k}\mathclose{\text{),}} F⋅n=−z2=0:\vb{F}\cdot\vb{n} = -z^2 = 0\mathclose{\text{:}} flux 0. On the side, where x2+y2=1,x^2 + y^2 = 1\mathclose{\text{,}} the outward unit normal is n=⟨x,y,0⟩,\vb{n} = \langle x, y, 0\rangle\mathclose{\text{,}} so F⋅n=x2+y2=1,\vb{F}\cdot\vb{n} = x^2 + y^2 = 1\mathclose{\text{,}} and the flux is the area of the side, 2π⋅1⋅2=4π.2\pi\cdot 1\cdot 2 = 4\pi\mathclose{\text{.}} In all, 4π+0+4π=8π.4\pi + 0 + 4\pi = 8\pi\mathclose{\text{.}}

If F\vb{F} has continuous first partial derivatives near P0,P_0\mathclose{\text{,}} apply the divergence theorem to small balls BrB_r centred at P0.P_0\mathclose{\text{.}} The average divergence over each ball tends to its value at P0P_0 by continuity. Thus (div⁡F)(P0)(\operatorname{div}\vb{F})(P_0) is the limit of the outward flux through the surface of BrB_r divided by the volume of Br,B_r\mathclose{\text{,}} the outflow per unit volume. Under the theorem’s hypotheses, if div⁡F=0\operatorname{div}\vb{F} = 0 throughout E,E\mathclose{\text{,}} the flux in equals the flux out.

Compute itBoth sides with SymPy

The two theorems can be checked by computer. First Stokes’ theorem on the dome of Example 20.15. The helper at puts a point into an expression, and curl follows Definition 20.6:

Python
import sympy as sp
x, y, z, t, r, th = sp.symbols('x y z t r theta')

def at(e, p):
    """e (an expression or a Matrix in x, y, z) at the point p."""
    return e.subs({x: p[0], y: p[1], z: p[2]}, simultaneous=True)

def curl(F):
    P, Q, R = F
    return sp.Matrix([sp.diff(R, y) - sp.diff(Q, z),
                      sp.diff(P, z) - sp.diff(R, x),
                      sp.diff(Q, x) - sp.diff(P, y)])

F = sp.Matrix([z, x, y])
edge = sp.Matrix([sp.cos(t), sp.sin(t), 0])
print(sp.integrate(at(F, edge).dot(edge.diff(t)), (t, 0, 2*sp.pi)))
Output
pi

That is the line integral round the edge. For the surface integral, parametrise the dome with polar coordinates, r(r,θ)=⟨rcos⁡θ,rsin⁡θ,1−r2⟩:\vb{r}(r, \theta) = \langle r\cos\theta, r\sin\theta, 1 - r^2\rangle\mathclose{\text{:}}

Python
dome = sp.Matrix([r*sp.cos(th), r*sp.sin(th), 1 - r**2])
N = dome.diff(r).cross(dome.diff(th))          # r_r x r_theta
print(sp.simplify(N[2]))
integrand = sp.simplify(at(curl(F), dome).dot(N))
print(sp.integrate(integrand, (r, 0, 1), (th, 0, 2*sp.pi)))
Output
r
pi

The zz-component rr of rr×rθ\vb{r}_r\times\vb{r}_\theta is positive for r>0,r>0\mathclose{\text{,}} so this normal points upwards, as the orientation asks, and both sides are π.\pi\mathclose{\text{.}} Now the divergence theorem for F=⟨x3,y3,z3⟩\vb{F} = \langle x^3, y^3, z^3\rangle and the unit ball, whose surface is the unit sphere of Example 20.11:

Python
phi, rho = sp.symbols('phi rho')
G = sp.Matrix([x**3, y**3, z**3])
sphere = sp.Matrix([sp.sin(phi)*sp.cos(th), sp.sin(phi)*sp.sin(th),
                    sp.cos(phi)])
N = sphere.diff(phi).cross(sphere.diff(th))    # outwards
flux = sp.integrate(sp.simplify(at(G, sphere).dot(N)),
                    (phi, 0, sp.pi), (th, 0, 2*sp.pi))
divG = sp.diff(G[0], x) + sp.diff(G[1], y) + sp.diff(G[2], z)
dV = rho**2*sp.sin(phi)                         # spherical coordinates
inside = sp.integrate(at(divG, rho*sphere)*dV,
                      (rho, 0, 1), (phi, 0, sp.pi), (th, 0, 2*sp.pi))
print(divG)
print(flux, inside)
Output
3*x**2 + 3*y**2 + 3*z**2
12*pi/5 12*pi/5

The volume integral uses spherical coordinates, with dV=ρ2sin⁡φ dρ dφ dθdV = \rho^2\sin\varphi\,d\rho\,d\varphi\,d\theta (Module 19). Again the two sides agree.

Maxwell’s equations

The classic application of these theorems is electromagnetism. Maxwell’s equations describe how electric and magnetic fields E\vb{E} and B\vb{B} are produced by charges and currents, and how they change in time. In SI units, the equations for the fields and total charge and current use fluxes and circulations. For a closed surface SS oriented outwards, with QQ the electric charge inside it,

∬SE⋅dS=Qε0(Gauss’s law),∬SB⋅dS=0,\begin{aligned} \iint_S \vb{E}\cdot d\vb{S} &= \frac{Q}{\varepsilon_0} \quad\text{(Gauss's law)}, \\ \iint_S \vb{B}\cdot d\vb{S} &= 0, \end{aligned}

and for a fixed oriented surface SS with positively oriented boundary C,C\mathclose{\text{,}} with II the signed electric current through SS along its chosen normal,

∮CE⋅dr=−ddt∬SB⋅dS,∮CB⋅dr=μ0I+μ0ε0ddt∬SE⋅dS,\begin{aligned} \oint_C \vb{E}\cdot d\vb{r} &= -\frac{d}{dt}\iint_S \vb{B}\cdot d\vb{S}, \\ \oint_C \vb{B}\cdot d\vb{r} &= \mu_0 I \\ &\quad+ \mu_0\varepsilon_0\frac{d}{dt}\iint_S \vb{E}\cdot d\vb{S}, \end{aligned}

where ε0\varepsilon_0 and μ0\mu_0 are physical constants; the first of these two laws is Faraday’s law. In differential form, about divergence and curl at each point, Maxwell’s equations read

div⁡E=ρε0,div⁡B=0,curl⁡E=−∂B∂t,curl⁡B=μ0J+μ0ε0∂E∂t,\begin{aligned} \operatorname{div}\vb{E} &= \frac{\rho}{\varepsilon_0}, & \operatorname{div}\vb{B} &= 0, \\ \operatorname{curl}\vb{E} &= -\frac{\partial\vb{B}}{\partial t}, & \operatorname{curl}\vb{B} &= \mu_0\vb{J} + \mu_0\varepsilon_0\frac{\partial\vb{E}}{\partial t}, \end{aligned}

where ρ\rho is the charge density (charge per unit volume) and J\vb{J} the current density, so I=∬SJ⋅dS.I=\iint_S \vb{J}\cdot d\vb{S}\mathclose{\text{.}}

The divergence theorem and Stokes’ theorem translate each law from one form to the other, where the fields have continuous first derivatives in space and time and the charge and current densities are continuous. For a fixed surface, a continuous time derivative can be taken inside the flux integral. For Gauss’s law, write Q=∭Eρ dVQ = \iiint_E \rho\,dV for the solid EE inside S;S\mathclose{\text{;}} the divergence theorem turns the left side into ∭Ediv⁡E dV,\iiint_E \operatorname{div}\vb{E}\,dV\mathclose{\text{,}} so

∭E(div⁡E−ρε0) dV=0\iiint_E \Big(\operatorname{div}\vb{E} - \frac{\rho}{\varepsilon_0}\Big)\,dV = 0

for every solid E.E\mathclose{\text{.}} If the continuous function in brackets were positive at some point, it would be positive on a small ball around that point, and its integral over that ball would be positive; in the same way it cannot be negative anywhere. So div⁡E=ρ/ε0\operatorname{div}\vb{E} = \rho/\varepsilon_0 at every point. For the circulation laws, Stokes’ theorem gives zero flux of the difference of the two differential expressions through every small disc. If that difference were nonzero at a point, a sufficiently small disc with its normal along the difference there would have positive flux, by continuity. In empty space the four differential equations combine into equations for waves that travel at the speed 1/μ0ε0,1/\sqrt{\mu_0\varepsilon_0}\mathclose{\text{,}} which is the speed of light: light is an electromagnetic wave.

8

The one pattern

Module 1 began with a car’s speedometer and odometer, and with a promise: calculus is about rates and accumulation, and the Fundamental Theorem of Calculus connects them. This module has proved or stated four more theorems of the same kind. Side by side:

Theorem and region Integral of a derivative over the region = values on its boundary
Fundamental Theorem (Module 10): an interval [a,b][a, b] ∫abF′(x) dx=F(b)−F(a)\displaystyle\int_a^b F'(x)\,dx = F(b) - F(a)
Line integrals (Theorem 20.2): a curve from AA to BB ∫C∇f⋅dr=f(B)−f(A)\displaystyle\int_C \nabla f\cdot d\vb{r} = f(B) - f(A)
Green (Theorem 20.6): a plane region DD with edge CC ∬D(Qx−Py) dA=∮CP dx+Q dy\displaystyle\iint_D (Q_x - P_y)\,dA = \oint_C P\,dx + Q\,dy
Stokes (Theorem 20.9): a surface SS with edge CC ∬Scurl⁡F⋅dS=∮CF⋅dr\displaystyle\iint_S \operatorname{curl}\vb{F}\cdot d\vb{S} = \oint_C \vb{F}\cdot d\vb{r}
Divergence (Theorem 20.10): a solid EE with surface SS ∭Ediv⁡F dV=∬SF⋅dS\displaystyle\iiint_E \operatorname{div}\vb{F}\,dV = \iint_S \vb{F}\cdot d\vb{S}

Under the hypotheses of each theorem, the left side integrates a derivative over a region, and the right side involves only the thing differentiated, on the region’s boundary. The derivative fits the dimension: F′F' for a function of one variable, the gradient for a scalar field along a curve, the curl for circulation round the edge of a surface, the divergence for flux out of a solid. Each boundary carries the orientation that the region gives it: the edge of a plane region with the region on the left, the edge of a surface by the right-hand rule, the surface of a solid outwards. Even the first row has one: the two ends of [a,b][a, b] count with signs, +F(b)+F(b) and −F(a).-F(a)\mathclose{\text{.}}

The proofs share one idea as well. For a small piece of the region, the theorem is the Fundamental Theorem in one variable, as in the proofs of Green’s theorem and of the divergence theorem for a box. Adding the pieces, everything on the inner boundaries cancels, because each inner boundary belongs to two pieces that trace it in opposite directions; only the outer boundary is left.

Even the identities of Section 20.5 fit the pattern. The boundary of a region has no boundary of its own: a closed curve has no ends, and a closed surface has no edge. Correspondingly, curl⁡(∇f)=0\operatorname{curl}(\nabla f) = \vb{0} and div⁡(curl⁡F)=0.\operatorname{div}(\operatorname{curl}\vb{F}) = 0\mathclose{\text{.}} For example, if F\vb{F} meets the hypotheses of Stokes’ theorem on a closed surface, the flux of curl⁡F\operatorname{curl}\vb{F} is 0 because the surface has no edge. If the surface bounds a solid and F\vb{F} has continuous second partial derivatives near the solid, the divergence theorem gives the same result from div⁡(curl⁡F)=0.\operatorname{div}(\operatorname{curl}\vb{F}) = 0\mathclose{\text{.}} Exercise 20.10 uses this argument.

Key idea

Every fundamental theorem says the same thing: adding up a derivative over a region gives the values on the region’s boundary. Module 1’s speedometer and odometer were the first case: add up the rate over a stretch of time, and you get the change between its two ends. In this module the same sentence describes flowing fluids, gravity and electricity, in two and three dimensions.

Where to go next

This is the end of the series, and the start of several roads.

  • Differential equations. Module 13 solved equations for functions of one variable. The laws of physics in differential form, such as Maxwell’s equations, are partial differential equations: the heat equation, the wave equation, and Laplace’s equation div⁡(∇u)=0.\operatorname{div}(\nabla u) = 0\mathclose{\text{.}} The divergence theorem is how a conservation law (“what flows out of a region is what is lost inside it”) becomes such an equation, and numerical methods that simulate fluids and heat are built on it.
  • Real analysis proves, with the ε–δ reasoning of Section 2.7, results this series uses without a full proof, including the Extreme Value Theorem, the integrability of continuous functions, the more general forms of Fubini’s theorem, the change of variables formula, and Green’s theorem for general regions.
  • Complex analysis does calculus with functions of a complex variable, the setting of Euler’s formula eiθ=cos⁡θ+isin⁡θe^{i\theta} = \cos\theta + i\sin\theta in Module 15. Its central theorem, Cauchy’s, says that ∮Cf(z) dz=0\oint_C f(z)\,dz = 0 for a piecewise smooth closed path CC when ff is complex differentiable throughout an open, simply connected region containing C.C\mathclose{\text{.}} It is a close relative of Green’s theorem. For 1/z,1/z\mathclose{\text{,}} whose domain has a hole at 0, the 2π2\pi of Example 20.6 returns as ∮Cdz/z=2πi\oint_C dz/z = 2\pi i round a circle centred at 0 and traced once anticlockwise.
  • Differential geometry studies curves and surfaces with calculus: how they bend, and the shortest paths on them. In its language of differential forms, the five theorems of the table are one theorem, written ∫Mdω=∫∂Mω:\int_M d\omega = \int_{\partial M} \omega\mathclose{\text{:}} the integral of the derivative of ω\omega over a region MM equals the integral of ω\omega over its boundary ∂M.\partial M\mathclose{\text{.}}

On this site, Mathematical Foundations for Computer Science and AI continues with linear algebra, probability and statistics, optimisation and numerical computation, and AI: From Machine Learning to Large Language Models puts gradients and the chain rule to work in neural networks.

9

What you learned

  • A vector field assigns a vector to each point: wind, fluid velocity, gravity, the electric field, the gradient ∇f\nabla f of a function. Its pictures are arrows on a grid, scaled to fit; a flow line follows the arrows.
  • The line integral of a function, ∫Cf ds=∫abf(r(t))∥r′(t)∥ dt,\int_C f\,ds = \int_a^b f\big(\vb{r}(t)\big)\norm{\vb{r}'(t)}\,dt\mathclose{\text{,}} adds up ff times length (mass, average values). The line integral of a field, ∫CF⋅dr=∫abF(r(t))⋅r′(t) dt=∫CP dx+Q dy,\int_C \vb{F}\cdot d\vb{r} = \int_a^b \vb{F}\big(\vb{r}(t)\big)\cdot\vb{r}'(t)\,dt = \int_C P\,dx + Q\,dy\mathclose{\text{,}} adds up the tangential component (work). Neither depends on the parametrisation; the second changes sign when the direction is reversed.
  • The fundamental theorem for line integrals: ∫C∇f⋅dr=f(B)−f(A).\int_C \nabla f\cdot d\vb{r} = f(B) - f(A)\mathclose{\text{.}} A field is conservative, F=∇f,\vb{F} = \nabla f\mathclose{\text{,}} exactly when its line integrals are independent of the path, exactly when they are 0 round closed curves. For a planar field with continuous first partial derivatives on an open region, Py=QxP_y = Q_x is necessary. On a simply connected region it is sufficient; ⟨−y,x⟩/(x2+y2),\langle -y, x\rangle/(x^2 + y^2)\mathclose{\text{,}} with circulation 2π2\pi round the origin, shows why the region matters. Find a potential by integrating one variable at a time.
  • Green’s theorem: ∮CP dx+Q dy=∬D(Qx−Py) dA\oint_C P\,dx + Q\,dy = \iint_D (Q_x - P_y)\,dA for a positively oriented, piecewise smooth, simple closed curve and components with continuous first partial derivatives on a neighbourhood of the enclosed region. Its flux form is ∮CF⋅n ds=∬D(Px+Qy) dA.\oint_C \vb{F}\cdot\vb{n}\,ds = \iint_D (P_x + Q_y)\,dA\mathclose{\text{.}} Areas are line integrals, A=12∮Cx dy−y dx:A = \tfrac12\oint_C x\,dy - y\,dx\mathclose{\text{:}} the planimeter and the shoelace formula.
  • curl⁡F=∇×F\operatorname{curl}\vb{F} = \nabla\times\vb{F} measures rotation (circulation per unit area; twice the angular velocity of a rigid rotation), and div⁡F=∇⋅F\operatorname{div}\vb{F} = \nabla\cdot\vb{F} measures expansion (outflow per unit area or volume). With continuous second partial derivatives, curl⁡(∇f)=0\operatorname{curl}(\nabla f) = \vb{0} and div⁡(curl⁡F)=0.\operatorname{div}(\operatorname{curl}\vb{F}) = 0\mathclose{\text{.}}
  • A parametric surface r(u,v)\vb{r}(u, v) has normal ru×rv,\vb{r}_u\times\vb{r}_v\mathclose{\text{,}} area ∬D∥ru×rv∥ dA,\iint_D \norm{\vb{r}_u\times\vb{r}_v}\,dA\mathclose{\text{,}} surface integrals ∬Sf dS,\iint_S f\,dS\mathclose{\text{,}} and flux ∬SF⋅dS=∬DF(r(u,v))⋅(ru×rv) dA\iint_S \vb{F}\cdot d\vb{S} = \iint_D \vb{F}\big(\vb{r}(u,v)\big)\cdot(\vb{r}_u\times\vb{r}_v)\,dA when the cross product agrees with the chosen orientation.
  • Stokes’ theorem, ∮CF⋅dr=∬Scurl⁡F⋅dS\oint_C \vb{F}\cdot d\vb{r} = \iint_S \operatorname{curl}\vb{F}\cdot d\vb{S} (with the right-hand rule), and the divergence theorem, ∬SF⋅dS=∭Ediv⁡F dV\iint_S \vb{F}\cdot d\vb{S} = \iiint_E \operatorname{div}\vb{F}\,dV (outward normal), carry Green’s theorem into space. The field needs continuous first partial derivatives near the surface for Stokes’ theorem and near the solid for the divergence theorem. The two theorems relate Maxwell’s integral and differential equations.
  • All the fundamental theorems share one pattern: the integral of a derivative over a region equals the values on its boundary.
10

Exercises

Exercise 20.1★Reading a field

Let F(x,y)=⟨x−y,x+y⟩.\vb{F}(x, y) = \langle x - y, x + y\rangle\mathclose{\text{.}}

  • (a) Find F\vb{F} at (1,0),(1, 0)\mathclose{\text{,}} (0,1),(0, 1)\mathclose{\text{,}} (−1,0),(-1, 0)\mathclose{\text{,}} (0,−1)(0, -1) and (1,1),(1, 1)\mathclose{\text{,}} and describe the picture.
  • (b) Write F\vb{F} as the sum of two fields of Example 20.1, and find Qx−PyQ_x - P_y and Px+Qy.P_x + Q_y\mathclose{\text{.}}
  • (c) Is F\vb{F} conservative?
Show solution✓ Checked

(a) F(1,0)=⟨1,1⟩,\vb{F}(1, 0) = \langle 1, 1\rangle\mathclose{\text{,}} F(0,1)=⟨−1,1⟩,\vb{F}(0, 1) = \langle -1, 1\rangle\mathclose{\text{,}} F(−1,0)=⟨−1,−1⟩,\vb{F}(-1, 0) = \langle -1, -1\rangle\mathclose{\text{,}} F(0,−1)=⟨1,−1⟩\vb{F}(0, -1) = \langle 1, -1\rangle and F(1,1)=⟨0,2⟩.\vb{F}(1, 1) = \langle 0, 2\rangle\mathclose{\text{.}} Each arrow points outwards and anticlockwise at once. In general F⋅⟨x,y⟩=x2+y2\vb{F}\cdot\langle x, y\rangle = x^2 + y^2 and ∥F∥=2x2+y2,\norm{\vb{F}} = \sqrt{2}\sqrt{x^2 + y^2}\mathclose{\text{,}} so away from the origin the angle α\alpha between F\vb{F} and the position vector has cos⁡α=1/2:\cos\alpha = 1/\sqrt2\mathclose{\text{:}} every arrow makes an angle of π/4\pi/4 with the direction away from the origin. A fluid with this velocity spirals outwards.

(b) ⟨x−y,x+y⟩=⟨−y,x⟩+⟨x,y⟩,\langle x - y, x + y\rangle = \langle -y, x\rangle + \langle x, y\rangle\mathclose{\text{,}} the rotation field plus the source. Qx−Py=1−(−1)=2Q_x - P_y = 1 - (-1) = 2 and Px+Qy=1+1=2:P_x + Q_y = 1 + 1 = 2\mathclose{\text{:}} the field turns like the rotation field and spreads like the source.

(c) No: Py=−1P_y = -1 and Qx=1Q_x = 1 differ, so by Theorem 20.4 it is not conservative on any open region.

Exercise 20.2★A helical spring

A wire is wound along one turn of the helix r(t)=⟨3cos⁡t,3sin⁡t,4t⟩,\vb{r}(t) = \langle 3\cos t, 3\sin t, 4t\rangle\mathclose{\text{,}} 0≤t≤2π,0 \le t \le 2\pi\mathclose{\text{,}} with lengths in centimetres.

  • (a) Find the length of the wire.
  • (b) Let CC be the path of the wire. Find ∫Cz ds\int_C z\,ds and the average height of the wire.
  • (c) Does the answer to (b) change if the helix is traced from top to bottom?
Show solution✓ Checked

(a) r′(t)=⟨−3sin⁡t,3cos⁡t,4⟩,\vb{r}'(t) = \langle -3\sin t, 3\cos t, 4\rangle\mathclose{\text{,}} so ∥r′(t)∥=9sin⁡2t+9cos⁡2t+16=25=5.\norm{\vb{r}'(t)} = \sqrt{9\sin^2 t + 9\cos^2 t + 16} = \sqrt{25} = 5\mathclose{\text{.}} The length is ∫02π5 dt=10π≈31.42\int_0^{2\pi} 5\,dt = 10\pi \approx 31.42 cm.

(b) On the wire z=4t,z = 4t\mathclose{\text{,}} so

∫Cz ds=∫02π4t⋅5 dt=20[t22]02π=40π2≈394.8 cm2.\begin{aligned} \int_C z\,ds &= \int_0^{2\pi} 4t\cdot 5\,dt \\ &= 20\Big[\frac{t^2}{2}\Big]_0^{2\pi} \\ &= 40\pi^2 \approx 394.8\text{ cm}^2. \end{aligned}

The average height is 40π2/(10π)=4π≈12.5740\pi^2/(10\pi) = 4\pi \approx 12.57 cm: half the height of the top of the wire, 8π,8\pi\mathclose{\text{,}} because the wire climbs at a steady rate.

(c) No. By Theorem 20.1, ∫−Cf ds=∫Cf ds.\int_{-C} f\,ds = \int_C f\,ds\mathclose{\text{.}} For instance, r(2π−t)\vb{r}(2\pi - t) traces the helix from the top, and gives ∫02π4(2π−t)⋅5 dt=40π2\int_0^{2\pi} 4(2\pi - t)\cdot 5\,dt = 40\pi^2 again.

Exercise 20.3★Work and direction

Let F(x,y)=⟨y,2x⟩.\vb{F}(x, y) = \langle y, 2x\rangle\mathclose{\text{.}} Find the work done by F:\vb{F}\mathclose{\text{:}}

  • (a) along the quarter of the unit circle from (1,0)(1, 0) to (0,1),(0, 1)\mathclose{\text{,}} anticlockwise;
  • (b) along the same quarter circle from (0,1)(0, 1) to (1,0);(1, 0)\mathclose{\text{;}}
  • (c) along the straight segment from (1,0)(1, 0) to (0,1).(0, 1)\mathclose{\text{.}}

What does the comparison of (a) and (c) tell you about F?\vb{F}\mathclose{\text{?}}

Show solution✓ Checked

(a) Take r(t)=⟨cos⁡t,sin⁡t⟩,\vb{r}(t) = \langle\cos t, \sin t\rangle\mathclose{\text{,}} 0≤t≤π/2.0 \le t \le \pi/2\mathclose{\text{.}} Then F(r(t))=⟨sin⁡t,2cos⁡t⟩\vb{F}\big(\vb{r}(t)\big) = \langle\sin t, 2\cos t\rangle and r′(t)=⟨−sin⁡t,cos⁡t⟩,\vb{r}'(t) = \langle -\sin t, \cos t\rangle\mathclose{\text{,}} so F⋅r′=−sin⁡2t+2cos⁡2t.\vb{F}\cdot\vb{r}' = -\sin^2 t + 2\cos^2 t\mathclose{\text{.}} Since ∫0π/2sin⁡2t dt=∫0π/2cos⁡2t dt=π/4\int_0^{\pi/2} \sin^2 t\,dt = \int_0^{\pi/2} \cos^2 t\,dt = \pi/4 (Exercise 10.12),

W=−π4+2⋅π4=π4≈0.785.W = -\frac{\pi}{4} + 2\cdot\frac{\pi}{4} = \frac{\pi}{4} \approx 0.785.

(b) The same curve in the opposite direction: by Theorem 20.1, W=−π/4.W = -\pi/4\mathclose{\text{.}}

(c) Take r(t)=⟨1−t,t⟩,\vb{r}(t) = \langle 1 - t, t\rangle\mathclose{\text{,}} 0≤t≤1.0 \le t \le 1\mathclose{\text{.}} Then F(r(t))=⟨t,2(1−t)⟩\vb{F}\big(\vb{r}(t)\big) = \langle t, 2(1 - t)\rangle and r′(t)=⟨−1,1⟩,\vb{r}'(t) = \langle -1, 1\rangle\mathclose{\text{,}} so F⋅r′=−t+2−2t=2−3t,\vb{F}\cdot\vb{r}' = -t + 2 - 2t = 2 - 3t\mathclose{\text{,}} and W=∫01(2−3t) dt=2−32=12.W = \int_0^1 (2 - 3t)\,dt = 2 - \tfrac32 = \tfrac12\mathclose{\text{.}}

Two paths with the same ends give different work, π/4\pi/4 and 12,\tfrac12\mathclose{\text{,}} so F\vb{F} is not conservative (Theorem 20.3). The test agrees: Py=1P_y = 1 and Qx=2Q_x = 2 differ.

Exercise 20.4★Curl and divergence

Let F(x,y,z)=⟨x2y,−xy2,z⟩.\vb{F}(x, y, z) = \langle x^2y, -xy^2, z\rangle\mathclose{\text{.}}

  • (a) Find curl⁡F\operatorname{curl}\vb{F} and div⁡F.\operatorname{div}\vb{F}\mathclose{\text{.}}
  • (b) Is F\vb{F} conservative?
  • (c) Is F\vb{F} the curl of some field G\vb{G} whose components have continuous second partial derivatives?
Show solution✓ Checked

(a) With P=x2y,P = x^2y\mathclose{\text{,}} Q=−xy2Q = -xy^2 and R=z:R = z\mathclose{\text{:}}

curl⁡F=⟨0−0, 0−0, −y2−x2⟩=⟨0,0,−(x2+y2)⟩,div⁡F=2xy−2xy+1=1.\begin{aligned} &\operatorname{curl}\vb{F} \\ &\quad= \langle 0 - 0,\ 0 - 0,\ -y^2 - x^2\rangle \\ &\quad= \langle 0, 0, -(x^2 + y^2)\rangle, \\ &\operatorname{div}\vb{F} = 2xy - 2xy + 1 = 1. \end{aligned}

(b) No. If F=∇f,\vb{F} = \nabla f\mathclose{\text{,}} then ff would have continuous second partial derivatives (the first partial derivatives of P,P\mathclose{\text{,}} QQ and R),R\mathclose{\text{),}} so curl⁡F=curl⁡(∇f)=0\operatorname{curl}\vb{F} = \operatorname{curl}(\nabla f) = \vb{0} by Theorem 20.8. But at (1,0,0),(1, 0, 0)\mathclose{\text{,}} curl⁡F=⟨0,0,−1⟩.\operatorname{curl}\vb{F} = \langle 0, 0, -1\rangle\mathclose{\text{.}}

(c) No. By Theorem 20.8, div⁡(curl⁡G)=0,\operatorname{div}(\operatorname{curl}\vb{G}) = 0\mathclose{\text{,}} but div⁡F=1.\operatorname{div}\vb{F} = 1\mathclose{\text{.}}

Exercise 20.5★★A potential in the plane

Let F(x,y)=⟨3x2y+y, x3+x+2y⟩.\vb{F}(x, y) = \langle 3x^2y + y,\ x^3 + x + 2y\rangle\mathclose{\text{.}}

  • (a) Show that F\vb{F} is conservative.
  • (b) Find a potential.
  • (c) Find ∫CF⋅dr,\int_C \vb{F}\cdot d\vb{r}\mathclose{\text{,}} where CC is traced by r(t)=⟨t2,t3+1⟩,\vb{r}(t) = \langle t^2, t^3 + 1\rangle\mathclose{\text{,}} 0≤t≤1.0 \le t \le 1\mathclose{\text{.}}
  • (d) What is ∮CF⋅dr\oint_C \vb{F}\cdot d\vb{r} round any closed curve?
Show solution✓ Checked

(a) Py=3x2+1P_y = 3x^2 + 1 and Qx=3x2+1Q_x = 3x^2 + 1 are equal and continuous on the whole plane, which is simply connected, so F\vb{F} is conservative by Theorem 20.5.

(b) Integrate PP with respect to x:x\mathclose{\text{:}} f=x3y+xy+g(y).f = x^3y + xy + g(y)\mathclose{\text{.}} Then fy=x3+x+g′(y),f_y = x^3 + x + g'(y)\mathclose{\text{,}} and comparing with QQ gives g′(y)=2y,g'(y) = 2y\mathclose{\text{,}} so g(y)=y2g(y) = y^2 (taking the constant 0) and

f(x,y)=x3y+xy+y2.f(x, y) = x^3y + xy + y^2.

Check: fx=3x2y+yf_x = 3x^2y + y and fy=x3+x+2y.f_y = x^3 + x + 2y\mathclose{\text{.}}

(c) The curve runs from r(0)=(0,1)\vb{r}(0) = (0, 1) to r(1)=(1,2).\vb{r}(1) = (1, 2)\mathclose{\text{.}} The velocity vanishes only at the first endpoint, which is allowed in Theorem 20.2. So

∫CF⋅dr=f(1,2)−f(0,1)=(2+2+4)−(0+0+1)=7.\begin{aligned} &\int_C \vb{F}\cdot d\vb{r} = f(1, 2) - f(0, 1) \\ &\quad= (2 + 2 + 4) - (0 + 0 + 1) \\ &\quad= 7. \end{aligned}

Computing ∫01F(r(t))⋅r′(t) dt\int_0^1 \vb{F}\big(\vb{r}(t)\big)\cdot\vb{r}'(t)\,dt directly gives 7 too, after expanding a polynomial of degree 8.

(d) 0, by Theorem 20.3: F\vb{F} is conservative on the whole plane.

Exercise 20.6★★A potential in space

Let F(x,y,z)=⟨2xy+z2, x2+2yz, y2+2xz⟩.\vb{F}(x, y, z) = \langle 2xy + z^2,\ x^2 + 2yz,\ y^2 + 2xz\rangle\mathclose{\text{.}}

  • (a) Show that curl⁡F=0.\operatorname{curl}\vb{F} = \vb{0}\mathclose{\text{.}}
  • (b) Find a potential f.f\mathclose{\text{.}}
  • (c) Find the work done by F\vb{F} along the helix r(t)=⟨cos⁡t,sin⁡t,t⟩,\vb{r}(t) = \langle\cos t, \sin t, t\rangle\mathclose{\text{,}} 0≤t≤π.0 \le t \le \pi\mathclose{\text{.}}
Show solution✓ Checked

(a)

curl⁡F=⟨2y−2y,2z−2z,2x−2x⟩=0.\begin{aligned} &\operatorname{curl}\vb{F} \\ &\enspace= \langle 2y - 2y, 2z - 2z, 2x - 2x\rangle \\ &\enspace= \vb{0}. \end{aligned}

Space is simply connected, so F\vb{F} is conservative (Section 20.5).

(b) Integrate PP with respect to x:x\mathclose{\text{:}} f=x2y+xz2+g(y,z),f = x^2y + xz^2 + g(y, z)\mathclose{\text{,}} where the “constant” may depend on yy and z.z\mathclose{\text{.}} Then fy=x2+gy=x2+2yz,f_y = x^2 + g_y = x^2 + 2yz\mathclose{\text{,}} so gy=2yzg_y = 2yz and g=y2z+h(z).g = y^2z + h(z)\mathclose{\text{.}} Then fz=2xz+y2+h′(z)=y2+2xz,f_z = 2xz + y^2 + h'(z) = y^2 + 2xz\mathclose{\text{,}} so h′(z)=0;h'(z) = 0\mathclose{\text{;}} take h=0:h = 0\mathclose{\text{:}}

f(x,y,z)=x2y+xz2+y2z.f(x, y, z) = x^2y + xz^2 + y^2z.

(c) The helix runs from r(0)=(1,0,0)\vb{r}(0) = (1, 0, 0) to r(π)=(−1,0,π).\vb{r}(\pi) = (-1, 0, \pi)\mathclose{\text{.}} By Theorem 20.2,

W=f(−1,0,π)−f(1,0,0)=(0−π2+0)−0=−π2.\begin{aligned} W &= f(-1, 0, \pi) - f(1, 0, 0) \\ &= (0 - \pi^2 + 0) - 0 = -\pi^2. \end{aligned}
Exercise 20.7★★Green’s theorem on a square

Let P=xyP = xy and Q=x2,Q = x^2\mathclose{\text{,}} and let CC be the boundary of the square 0≤x≤1,0 \le x \le 1\mathclose{\text{,}} 0≤y≤1,0 \le y \le 1\mathclose{\text{,}} traced anticlockwise.

  • (a) Compute ∮CP dx+Q dy\oint_C P\,dx + Q\,dy directly, edge by edge.
  • (b) Compute it with Green’s theorem.
  • (c) What is the answer if CC is traced clockwise?
Show solution✓ Checked

(a) Along the bottom (y=0,y = 0\mathclose{\text{,}} xx from 0 to 1): P=0P = 0 and dy=0,dy = 0\mathclose{\text{,}} so the edge gives 0. Up the right side (x=1,x = 1\mathclose{\text{,}} yy from 0 to 1): dx=0dx = 0 and Q=1,Q = 1\mathclose{\text{,}} so it gives ∫011 dy=1.\int_0^1 1\,dy = 1\mathclose{\text{.}} Along the top (y=1,y = 1\mathclose{\text{,}} xx from 1 back to 0): P=xP = x and dy=0,dy = 0\mathclose{\text{,}} so it gives ∫10x dx=−12.\int_1^0 x\,dx = -\tfrac12\mathclose{\text{.}} Down the left side (x=0):x = 0\mathclose{\text{):}} dx=0dx = 0 and Q=0,Q = 0\mathclose{\text{,}} so it gives 0. In all, 0+1−12+0=12.0 + 1 - \tfrac12 + 0 = \tfrac12\mathclose{\text{.}}

(b) Qx−Py=2x−x=x,Q_x - P_y = 2x - x = x\mathclose{\text{,}} so

∮CP dx+Q dy=∫01 ⁣ ⁣∫01x dx dy=12.\begin{aligned} \oint_C P\,dx + Q\,dy &= \int_0^1\!\!\int_0^1 x\,dx\,dy \\ &= \frac12. \end{aligned}

(c) −12:-\tfrac12\mathclose{\text{:}} reversing the direction changes the sign of the line integral (Theorem 20.1), and Green’s theorem in the form stated needs the anticlockwise direction.

Exercise 20.8★★Areas from boundaries
  • (a) Use the shoelace formula to find the area of the quadrilateral with corners (0,0),(0, 0)\mathclose{\text{,}} (4,0),(4, 0)\mathclose{\text{,}} (5,3)(5, 3) and (1,4),(1, 4)\mathclose{\text{,}} and check the answer by cutting it into two triangles.
  • (b) Find the area enclosed by the astroid x=cos⁡3t,x = \cos^3 t\mathclose{\text{,}} y=sin⁡3t,y = \sin^3 t\mathclose{\text{,}} 0≤t≤2π.0 \le t \le 2\pi\mathclose{\text{.}}
Show solution✓ Checked

(a) The corners are listed anticlockwise. The four terms xkyk+1−xk+1ykx_ky_{k+1} - x_{k+1}y_k are

0⋅0−4⋅0=0,4⋅3−5⋅0=12,5⋅4−1⋅3=17,1⋅0−0⋅4=0,\begin{aligned} &0\cdot0 - 4\cdot0 = 0, \\ &4\cdot3 - 5\cdot0 = 12, \\ &5\cdot4 - 1\cdot3 = 17, \\ &1\cdot0 - 0\cdot4 = 0, \end{aligned}

so A=12(0+12+17+0)=292=14.5.A = \tfrac12(0 + 12 + 17 + 0) = \tfrac{29}{2} = 14.5\mathclose{\text{.}} The diagonal from (0,0)(0, 0) to (5,3)(5, 3) cuts the quadrilateral into two triangles. Half the magnitude of the cross product of the two sides from the origin (Module 16) gives their areas 12(4⋅3−5⋅0)=6\tfrac12(4\cdot3 - 5\cdot0) = 6 and 12(5⋅4−1⋅3)=172,\tfrac12(5\cdot4 - 1\cdot3) = \tfrac{17}{2}\mathclose{\text{,}} and 6+172=292.6 + \tfrac{17}{2} = \tfrac{29}{2}\mathclose{\text{.}}

(b) Here dx=−3cos⁡2tsin⁡t dtdx = -3\cos^2 t\sin t\,dt and dy=3sin⁡2tcos⁡t dt,dy = 3\sin^2 t\cos t\,dt\mathclose{\text{,}} and the astroid is traced anticlockwise. The velocity is nonzero between successive axis crossings and zero at the four cusps. Split the boundary at the cusps to get a piecewise smooth path. So

x dy−y dx=(3cos⁡4tsin⁡2t+3sin⁡4tcos⁡2t) dt=3sin⁡2tcos⁡2t dt=34sin⁡22t dt,\begin{aligned} &x\,dy - y\,dx \\ &\quad= \big(3\cos^4 t\sin^2 t \\ &\qquad\quad + 3\sin^4 t\cos^2 t\big)\,dt \\ &\quad= 3\sin^2 t\cos^2 t\,dt \\ &\quad= \tfrac34\sin^2 2t\,dt, \end{aligned}

taking out the factor 3sin⁡2tcos⁡2t3\sin^2 t\cos^2 t and using cos⁡2t+sin⁡2t=1\cos^2 t + \sin^2 t = 1 and sin⁡2t=2sin⁡tcos⁡t.\sin 2t = 2\sin t\cos t\mathclose{\text{.}} Since ∫02πsin⁡22t dt=π,\int_0^{2\pi} \sin^2 2t\,dt = \pi\mathclose{\text{,}}

A=12∫02π34sin⁡22t dt=3π8≈1.178.\begin{aligned} A &= \frac12\int_0^{2\pi} \frac34\sin^2 2t\,dt \\ &= \frac{3\pi}{8} \approx 1.178. \end{aligned}
Exercise 20.9★★Flux through a dome

Let F=⟨x,y,z⟩,\vb{F} = \langle x, y, z\rangle\mathclose{\text{,}} and let SS be the dome z=1−x2−y2,z = 1 - x^2 - y^2\mathclose{\text{,}} z≥0,z \ge 0\mathclose{\text{,}} oriented upwards.

  • (a) Compute the flux of F\vb{F} across S.S\mathclose{\text{.}}
  • (b) Check your answer with the divergence theorem, applied to the solid EE between the dome and the unit disc in the xyxy-plane.
Show solution✓ Checked

(a) As in Example 20.15, the upward normal of the graph is ⟨2x,2y,1⟩,\langle 2x, 2y, 1\rangle\mathclose{\text{,}} and on the dome F=⟨x,y,1−x2−y2⟩.\vb{F} = \langle x, y, 1 - x^2 - y^2\rangle\mathclose{\text{.}} So

F⋅⟨2x,2y,1⟩=2x2+2y2+1−x2−y2=1+x2+y2,\begin{aligned} &\vb{F}\cdot\langle 2x, 2y, 1\rangle \\ &\quad= 2x^2 + 2y^2 + 1 - x^2 - y^2 \\ &\quad= 1 + x^2 + y^2, \end{aligned}

and over the unit disc D,D\mathclose{\text{,}} in polar coordinates,

∬SF⋅dS=∫02π ⁣ ⁣∫01(1+r2) r dr dθ=2π(12+14)=3π2.\begin{aligned} &\iint_S \vb{F}\cdot d\vb{S} \\ &\quad= \int_0^{2\pi}\!\!\int_0^1 (1 + r^2)\,r\,dr\,d\theta \\ &\quad= 2\pi\Big(\frac12 + \frac14\Big) = \frac{3\pi}{2}. \end{aligned}

(b) The boundary of EE is the dome, oriented outwards (upwards), and the disc, oriented outwards, which here means downwards: n=−k.\vb{n} = -\vb{k}\mathclose{\text{.}} On the disc z=0,z = 0\mathclose{\text{,}} so F⋅n=−z=0,\vb{F}\cdot\vb{n} = -z = 0\mathclose{\text{,}} and its flux is 0. So the flux out of EE is 3π2+0.\tfrac{3\pi}{2} + 0\mathclose{\text{.}} On the other side, div⁡F=3,\operatorname{div}\vb{F} = 3\mathclose{\text{,}} and the volume of EE is ∫02π∫01(1−r2) r dr dθ=2π(12−14)=π2,\int_0^{2\pi}\int_0^1 (1 - r^2)\,r\,dr\,d\theta = 2\pi\big(\tfrac12 - \tfrac14\big) = \tfrac{\pi}{2}\mathclose{\text{,}} so ∭E3 dV=3π2.\iiint_E 3\,dV = \tfrac{3\pi}{2}\mathclose{\text{.}} The two agree.

Exercise 20.10★★★One boundary, two surfaces

Let F=⟨−y3, x3, ezsin⁡(xy)⟩,\vb{F} = \big\langle -y^3,\ x^3,\ e^z\sin(xy)\big\rangle\mathclose{\text{,}} let HH be the hemisphere x2+y2+z2=1,x^2 + y^2 + z^2 = 1\mathclose{\text{,}} z≥0,z \ge 0\mathclose{\text{,}} oriented outwards, and let DD be the unit disc in the xyxy-plane, oriented upwards.

  • (a) Use Stokes’ theorem to show that ∬Hcurl⁡F⋅dS=∬Dcurl⁡F⋅dS,\iint_H \operatorname{curl}\vb{F}\cdot d\vb{S} = \iint_D \operatorname{curl}\vb{F}\cdot d\vb{S}\mathclose{\text{,}} and compute the common value.
  • (b) Explain the equality in (a) again, with the divergence theorem instead.
Show solution✓ Checked

(a) Both surfaces have the same boundary, the unit circle C,C\mathclose{\text{,}} and the outward normal on HH and the upward normal on DD both induce the anticlockwise orientation when seen from above. By Stokes’ theorem both fluxes equal ∮CF⋅dr.\oint_C \vb{F}\cdot d\vb{r}\mathclose{\text{.}} With r(t)=⟨cos⁡t,sin⁡t,0⟩,\vb{r}(t) = \langle\cos t, \sin t, 0\rangle\mathclose{\text{,}} F(r(t))=⟨−sin⁡3t,cos⁡3t,sin⁡(cos⁡tsin⁡t)⟩\vb{F}\big(\vb{r}(t)\big) = \langle -\sin^3 t, \cos^3 t, \sin(\cos t\sin t)\rangle and r′(t)=⟨−sin⁡t,cos⁡t,0⟩,\vb{r}'(t) = \langle -\sin t, \cos t, 0\rangle\mathclose{\text{,}} so the integrand is sin⁡4t+cos⁡4t.\sin^4 t + \cos^4 t\mathclose{\text{.}} Since

sin⁡4t+cos⁡4t=(sin⁡2t+cos⁡2t)2−2sin⁡2tcos⁡2t=1−12sin⁡22t,\begin{aligned} &\sin^4 t + \cos^4 t \\ &\quad= \big(\sin^2 t + \cos^2 t\big)^2 \\ &\qquad - 2\sin^2 t\cos^2 t \\ &\quad= 1 - \tfrac12\sin^2 2t, \end{aligned}

the circulation is 2π−12⋅π=3π2.2\pi - \tfrac12\cdot\pi = \tfrac{3\pi}{2}\mathclose{\text{.}} Over the flat disc the computation is short too: curl⁡F⋅k=Qx−Py=3x2+3y2,\operatorname{curl}\vb{F}\cdot\vb{k} = Q_x - P_y = 3x^2 + 3y^2\mathclose{\text{,}} and ∫02π∫013r2⋅r dr dθ=3π2.\int_0^{2\pi}\int_0^1 3r^2\cdot r\,dr\,d\theta = \tfrac{3\pi}{2}\mathclose{\text{.}} On the hemisphere, by contrast, curl⁡F\operatorname{curl}\vb{F} has the components xezcos⁡(xy)xe^z\cos(xy) and −yezcos⁡(xy)-ye^z\cos(xy) as well, and the direct computation is unpleasant.

(b) H,H\mathclose{\text{,}} oriented outwards, together with D,D\mathclose{\text{,}} oriented downwards, is the closed surface of the solid half ball E,E\mathclose{\text{,}} oriented outwards. By the divergence theorem the flux of curl⁡F\operatorname{curl}\vb{F} out of EE is ∭Ediv⁡(curl⁡F) dV=0,\iiint_E \operatorname{div}(\operatorname{curl}\vb{F})\,dV = 0\mathclose{\text{,}} by Theorem 20.8. So the flux up through HH plus the flux down through DD is 0: the flux up through HH equals the flux up through D.D\mathclose{\text{.}}

Exercise 20.11★★★The vortex round any curve

Let F=⟨−y,x⟩/(x2+y2),\vb{F} = \big\langle -y, x\big\rangle/(x^2 + y^2)\mathclose{\text{,}} the field of Example 20.6.

  • (a) Show that the line integral of F\vb{F} anticlockwise round the circle CεC_\varepsilon of radius ε\varepsilon centred at the origin is 2π,2\pi\mathclose{\text{,}} for every ε>0.\varepsilon > 0\mathclose{\text{.}}
  • (b) Let CC be a positively oriented, piecewise smooth, simple closed curve whose inside contains the origin. Use Green’s theorem for a region with a hole to show that ∮CF⋅dr=2π.\oint_C \vb{F}\cdot d\vb{r} = 2\pi\mathclose{\text{.}}
  • (c) What is ∮CF⋅dr\oint_C \vb{F}\cdot d\vb{r} if the origin is strictly outside C?C\mathclose{\text{?}}
Show solution✓ Checked

(a) With r(t)=⟨εcos⁡t,εsin⁡t⟩,\vb{r}(t) = \langle\varepsilon\cos t, \varepsilon\sin t\rangle\mathclose{\text{,}} x2+y2=ε2,x^2 + y^2 = \varepsilon^2\mathclose{\text{,}} so F(r(t))=1ε⟨−sin⁡t,cos⁡t⟩,\vb{F}\big(\vb{r}(t)\big) = \tfrac{1}{\varepsilon}\langle -\sin t, \cos t\rangle\mathclose{\text{,}} while r′(t)=ε⟨−sin⁡t,cos⁡t⟩.\vb{r}'(t) = \varepsilon\langle -\sin t, \cos t\rangle\mathclose{\text{.}} Their dot product is sin⁡2t+cos⁡2t=1:\sin^2 t + \cos^2 t = 1\mathclose{\text{:}} the ε\varepsilon's cancel, and the line integral is 2π.2\pi\mathclose{\text{.}}

(b) The inside of CC is open and contains the origin, so it contains a small circle CεC_\varepsilon with its disc. Let RR be the region between CC and Cε,C_\varepsilon\mathclose{\text{,}} a region with one hole. Its boundary, traced with RR on the left, is CC anticlockwise together with CεC_\varepsilon clockwise. PP and QQ have continuous partial derivatives everywhere except at the origin, which is not in R,R\mathclose{\text{,}} and by Example 20.6, Qx−Py=0Q_x - P_y = 0 there. So Green’s theorem for RR gives

∮CF⋅dr+∮−CεF⋅dr=∬R0 dA=0,\begin{aligned} &\oint_C \vb{F}\cdot d\vb{r} + \oint_{-C_\varepsilon} \vb{F}\cdot d\vb{r} \\ &\quad= \iint_R 0\,dA = 0, \end{aligned}

and ∮CF⋅dr=∮CεF⋅dr=2π,\oint_C \vb{F}\cdot d\vb{r} = \oint_{C_\varepsilon} \vb{F}\cdot d\vb{r} = 2\pi\mathclose{\text{,}} by (a).

(c) 0. Now the region DD inside CC does not contain the origin, and F\vb{F} has continuous partial derivatives on an open region that contains DD (the plane without a small enough disc about the origin). Green’s theorem gives ∮CF⋅dr=∬D0 dA=0.\oint_C \vb{F}\cdot d\vb{r} = \iint_D 0\,dA = 0\mathclose{\text{.}} So the line integral of F\vb{F} round a simple closed curve is 2π2\pi or 0, depending only on whether the curve goes round the origin: this is how F\vb{F} counts turns. When CC passes through the origin, the field is undefined there, so the ordinary line integral definition does not apply.

Exercise 20.12★★★Gauss’s law

Let F=r/∥r∥3,\vb{F} = \vb{r}/\norm{\vb{r}}^3\mathclose{\text{,}} with r=⟨x,y,z⟩,\vb{r} = \langle x, y, z\rangle\mathclose{\text{,}} on space without the origin.

  • (a) Show that div⁡F=0.\operatorname{div}\vb{F} = 0\mathclose{\text{.}}
  • (b) Show that the outward flux of F\vb{F} across every sphere centred at the origin is 4π.4\pi\mathclose{\text{.}}
  • (c) Let SS be a closed, piecewise smooth surface, bounding a solid whose inside contains the origin. Show that the outward flux of F\vb{F} across SS is 4π.4\pi\mathclose{\text{.}}
  • (d) The electric field of a point charge qq at the origin is E=q4πε0F.\vb{E} = \dfrac{q}{4\pi\varepsilon_0}\vb{F}\mathclose{\text{.}} Deduce Gauss’s law for it: the flux of E\vb{E} out of SS is q/ε0.q/\varepsilon_0\mathclose{\text{.}}
Show solution✓ Checked

(a) Write ∥r∥=ρ,\norm{\vb{r}} = \rho\mathclose{\text{,}} so P=xρ−3P = x\rho^{-3} with ρ2=x2+y2+z2.\rho^2 = x^2 + y^2 + z^2\mathclose{\text{.}} By the product and chain rules, ∂ρ/∂x=x/ρ\partial\rho/\partial x = x/\rho and

Px=ρ−3−3xρ−4⋅xρ=ρ2−3x2ρ5.\begin{aligned} P_x &= \rho^{-3} - 3x\rho^{-4}\cdot\frac{x}{\rho} \\ &= \frac{\rho^2 - 3x^2}{\rho^5}. \end{aligned}

In the same way Qy=(ρ2−3y2)/ρ5Q_y = (\rho^2 - 3y^2)/\rho^5 and Rz=(ρ2−3z2)/ρ5,R_z = (\rho^2 - 3z^2)/\rho^5\mathclose{\text{,}} and the sum is (3ρ2−3(x2+y2+z2))/ρ5=0.\big(3\rho^2 - 3(x^2 + y^2 + z^2)\big)/\rho^5 = 0\mathclose{\text{.}}

(b) On the sphere of radius a,a\mathclose{\text{,}} n=r/a\vb{n} = \vb{r}/a and ∥r∥=a,\norm{\vb{r}} = a\mathclose{\text{,}} so F⋅n=r⋅ra⋅a3=1a2,\vb{F}\cdot\vb{n} = \dfrac{\vb{r}\cdot\vb{r}}{a\cdot a^3} = \dfrac{1}{a^2}\mathclose{\text{,}} a constant. The flux is 1a2⋅4πa2=4π,\dfrac{1}{a^2}\cdot 4\pi a^2 = 4\pi\mathclose{\text{,}} whatever the radius.

(c) The divergence theorem cannot be applied to the solid inside S,S\mathclose{\text{,}} because F\vb{F} is not defined at the origin. Instead, choose a sphere SaS_a about the origin, so small that it lies inside S,S\mathclose{\text{,}} and let EE be the solid between SS and Sa:S_a\mathclose{\text{:}} a solid with a cavity, which does not contain the origin. F\vb{F} has continuous partial derivatives on an open region containing E,E\mathclose{\text{,}} so by the divergence theorem, with the surface of the cavity oriented into the cavity, that is, towards the origin,

∬SF⋅dS+∬Sa, inwardsF⋅dS=∭E0 dV=0.\begin{aligned} &\iint_S \vb{F}\cdot d\vb{S} + \iint_{S_a,\ \text{inwards}} \vb{F}\cdot d\vb{S} \\ &\quad= \iiint_E 0\,dV = 0. \end{aligned}

The flux inwards across SaS_a is −4π,-4\pi\mathclose{\text{,}} by (b), so the flux out of SS is 4π.4\pi\mathclose{\text{.}}

(d) The flux of E\vb{E} is q4πε0\dfrac{q}{4\pi\varepsilon_0} times that of F:\vb{F}\mathclose{\text{:}} q4πε0⋅4π=qε0,\dfrac{q}{4\pi\varepsilon_0}\cdot 4\pi = \dfrac{q}{\varepsilon_0}\mathclose{\text{,}} the integral form of Gauss’s law in Section 20.7, for a point charge.

11

Check yourself

1
Which sign rule holds when you reverse the direction of a curve C?C\mathclose{\text{?}}
2
Let F=⟨2x,2y⟩.\vb{F} = \langle 2x, 2y\rangle\mathclose{\text{.}} The work done by F\vb{F} along any piecewise smooth path from (1,0)(1, 0) to (0,2)(0, 2) is
3
Which of these fields is conservative on the whole plane?
4
The field ⟨−y,x⟩/(x2+y2)\langle -y, x\rangle/(x^2 + y^2) has Py=QxP_y = Q_x wherever it is defined, yet its line integral round the unit circle is 2π.2\pi\mathclose{\text{.}} Why does this not contradict the test for conservative fields?
5
If CC is the circle x2+y2=4,x^2 + y^2 = 4\mathclose{\text{,}} traced anticlockwise, then ∮Cx dy\oint_C x\,dy equals
6
The curl of F=⟨−y,x,0⟩\vb{F} = \langle -y, x, 0\rangle is
7
The flux of F=⟨x,y,z⟩\vb{F} = \langle x, y, z\rangle out of the sphere of radius 2 centred at the origin is
8
If ff and the components of F\vb{F} have continuous second partial derivatives, which of these is always 0?
Finished this module?