VC 4
VC 4
VC 4
The fundamental theorem of calculus states that integration is the inverse of the dif-
ferentiation, in the sense that
Z b
df
dx = f (b) f (a)
a dx
In this section, we describe a number of generalisations of this result to higher dimen-
sional integrals. Along the way, we will also gain some intuition for the meaning of the
various vector derivative operators.
and this becomes exact as the region shrinks to zero size. The divergence theorem then
provides a coordinate independent definition of the divergence
Z
1
r · F = lim F · dS (4.2)
V !0 V S
This is the result that we advertised in Section 3: the right way to think about the
divergence of a vector field is as the net flow into, or out of, a region. If r · F > 0 at
some point x, then there is a net flow out of that point; if r · F < 0 at some point x
then there is a net flow inwards.
– 67 –
We can illustrate this by looking at a couple of
the Maxwell equations (3.7). The magnetic field B is
solenoidal, obeying
r·B=0
Example
Before proving the theorem, we first give an example. Take
the volume V to be the solid hemispherical ball, defined as
x2 + y 2 + z 2 R2 and z 0. Then boundary of V then
has two pieces
@V = S1 + S2
F = (0, 0, z + R)
– 68 –
which is the volume of the hemispherical ball. For the surface integral, we work with
S1 and S2 separately. On the hemisphere S1 , the unit normal vector is n = R1 (x, y, z)
and so
z(z + R)
F·n= = R cos ✓(cos ✓ + 1)
R
where we’ve used polar coordinates z = R cos ✓. The integral is then
Z Z 2⇡ Z ⇡/2
F · dS = d d✓ (R2 sin ✓) R cos ✓(cos ✓ + 1)
S1 0 0
⇡/2
1 1
= 2⇡R3 cos3 ✓ cos2 ✓
3 2 0
✓ ◆
3 1 1 5⇡R3
= = 2⇡R + = (4.4)
3 2 3
where the R2 sin ✓ factor in the first line is the Jacobian that we previously saw in (2.9).
Meanwhile, for the integral over the disc S2 , we have the normal vector n = (0, 0, 1),
and so (remembering that the disc sits at z = 0),
Z
F·n= R ) F · dS = ( R) ⇥ ⇡R2
S2
with ⇡R2 the area of the disc. Adding these together, we have
Z
2
F · dS = ⇡R3
S1 +S2 3
which reproduces the volume integral as promised.
It’s worth tracking what became of the +R term in the vector field F. Obviously
it didn’t contribute to the volume integral. For the surface integral over S1 , it gave
the +1/2 term in the penultimate expression in (4.4). This was then cancelled by the
surface integral over S2 , which only received a contribution from the +R term. We see
that this constant vector field when in the top surface, and out the bottom surface,
giving no contribution to the overall surface integral. This is how we get agreement
with the volume integral which, due to the derivative, is oblivious to any constant (or,
indeed, divergent free) components of F.
– 69 –
To get some intuition for the divergence theorem,
take the volume V and divide it up into a bunch of
small cubes. A given cube Vx has one corner of the
cube sitting at x = (x, y, z) and sides of lengths x,
y and z.
– 70 –
The derivation above is simple and intuitive, but it might
leave you a little nervous. The essence of the divergence the-
orem is to relate a bulk integral to a boundary integral. But
it’s not obvious that the boundary can be well approximated
by stacking cubes together. To give an analogy, if you try to
approximate a 45 line by a series of horizontal and vertical
p
lines, as shown on the right, then the total length of the steps is always going to be 2
larger than the length of the horizontal line, no matter how fine you make them. You
might worry that these kind of issues a✏ict the proof above. For that reason, we now
give a more careful derivation of the divergence theorem.
Before we proceed, first note that, suitably interpreted, the divergence theorem holds
in arbitrary dimension Rn , where a “surface” now means a codimension one subspace.
In particular, the divergence theorem holds in R2 , where a surface is a curve. This
result, which is interesting in its own right, will serve as a warm-up exercise to proving
the general divergence theorem.
where D is a region in R2 , bounded by the closed curve C and n is the outward normal
to C.
We then have
Z Z Z y+ (x)
@F
r · F dA = dx dy
D X y (x) @y
– 71 –
in red in the figure, and a lower curve C shown in blue. We then have
Z Z ⇣ ⌘
r · F dA = dx F (x, y+ (x)) F (x, y (x))
D X
x = cos ✓ s = ŷ · n s along C+
Along the lower curve, C , the normal n points downwards and so ŷ · n is negative.
We then have
x= ŷ · n s along C
– 72 –
R
Figure 13. Performing the dz integral for the proof of the 3d divergence theorem.
where the limits of the integral z± (x, y) are the upper and lower surfaces of the volume
V . The area integral over D is an integral in the (x, y) plane, while to prove Gauss’
theorem we need to convert this into a surface integral over S = @V . This step of the
argument is the same as before: at any given point, the di↵erent between dA = dxdy
and dS is the angle cos ✓ = n · ẑ (up to a sign). This then gives the promised result
(4.1). ⇤
– 73 –
This is true for any constant vector a, and so the expression in the brackets must itself
vanish. ⇤
Gauss was born to working class parents in what is now Lower Saxony, Germany. In
1795 he went to study at the university of Göttingen and remained there for the next
60 years.
There are remarkably few stories about Gauss that do not, at the end of the day,
boil down to the observation that he was just really good at maths. There is even a
website that has collected well over 100 retellings of how Gauss performed the sum
P100
1 n when still a foetus. (You can find an interesting dissection of this story here.)
In all these cases, the quantity is conserved. But we can say something stronger
than that: it is conserved locally. For example, an electric charge sitting in the palm
of your hand can’t disappear and turn up on Jupiter. That would satisfy a “global”
conservation of charge, but that’s not the way the universe works. If the electric charge
disappears from your hand, then most likely it has fallen o↵ and is now sitting on the
floor. Or, said more precisely, it must have moved to a nearby region of space.
The divergence theorem provides the technology to describe local conservation laws
of this type. First, we introduce the density ⇢(x, t) of the conserved object. For
the purposes of this discussion, we will take this to be the density of electric charge,
although it could equally well be the density of any of the other conserved quantities
– 74 –
described above. The total electric charge in some region V is then given by the integral
Z
Q= ⇢ dV
V
The conservation of charge is captured by the following statement: there exists a vector
field J(x, t) such that
@⇢
+r·J=0
@t
This is known as the continuity equation and J is called the current density.
The continuity equation doesn’t tell us that the density ⇢ can’t change in time; that
would be overly prohibitive. But it does tell us that ⇢ must change only in a certain
way. This ensures that the change in the charge Q in a fixed region V is given by
Z Z Z
dQ @⇢
= dV = r · J dV = J · dS
dt V @t V S
The intuition behind this idea is straightforward. If you want to keep tabs on the
number of people in a nightclub, you don’t continuously count them. Instead you
measure the number of people entering and leaving through the door.
If the current is known to vanish outside some region, so J(x) = 0 for |x| > R,
then the total charge contained inside that region must be unchanging. Often, in such
situations, we ask only that J(x, t) ! 0 suitably quickly as |x| ! 1, in which case the
total charge is unchanging
Z
dQtotal
Qtotal = ⇢ dV and =0
R3 dt
In later courses, we’ll see many examples of the continuity equation. The example of
electric charge discussed above will be covered in the lectures on Electromagnetism,
where the flux of J through a surface S is
Z
I= J · dS
S
– 75 –
We will also see the same equation in the lectures on Quantum Mechanics where ⇢(x)
has the interpretation of the probability density for a particle to be at some point x
R
and Q = V ⇢ dV is the probability that the particle sits in some region V . Obviously,
in this example we must have Qtotal = 1 which is the statement that particle definitely
sits somewhere.
Finally, the continuity equation also plays an important role in Fluid Mechanics
where the mass of the fluid is conserved. In that case, ⇢(x, t) is the density of the fluid
and the current is J = ⇢u where u(x, t) is the velocity field. The continuity equation
then reads
@⇢
+ r · (⇢u) = 0
@t
In this case the flux is the mass of fluid that passes through a surface S in time t.
r·u=0 (4.7)
This makes sense: for a solenoidal vector field, the flow into any region must be accom-
panied by an equal outgoing flow, telling us that the fluid can’t pile up anywhere, as
expected for an incompressible fluid. The statement that fluids are incompressible is a
fairly good approximation until we come to think about sound, which arises because of
changes in the density which propagate as waves.
– 76 –
At this point we need to invoke a couple of physical principles. First, the energy
density in a gas is proportional to the temperature of the gas,
where cV is the specific heat capacity. Next comes a key step: in hot systems, where
everything is jiggling around randomly, the heat flow is due to temperature di↵erences
between di↵erent parts of the system. The relation between the two is captured by the
equation
J= rT (4.10)
where is called the thermal conductivity and the minus sign ensures that heat flows
from hot to cold. This relation is known as Fick’s law. Neither (4.9) nor (4.10) are
fundamental equations of physics and both can be derived from first principles by
thinking about the motion of the underlying atoms. (This will be described in the
lectures on Statistical Physics and, for Fick’s law, the lectures on Kinetic Theory.)
Combining the continuity equation (4.8) with the definition of temperature (4.9) and
Fick’s law (4.10), we find the heat equation
@T
= Dr2 T
@t
where the di↵usion constant is given by D = /c. This tells us how the temperature
of a system evolves. As we mentioned previously, the same heat equation describes the
di↵usive motion of any conserved quantity.
First some background. Predator-prey systems describe the interaction between two
species. We will take our predators to be wolves. (Because they’re cool.) We will denote
the population of wolves at a given time t as w(t). The wolves prey upon something
cute and furry. We will denote the population of this cute, furry thing as c(t).
– 77 –
We want to write down a system of di↵erential equations to describe the interaction
between wolves and cute furry things. The simplest equations were first written down
by Lotka and Volterra and (after some rescaling) take the form
dw
= w( ↵ + c)
dt
dc
= c( w)
dt
with ↵, > 0 are some constants. There is a clear meaning to the di↵erent terms in
these equations. Without food, the wolves die out. That is what the ↵w term in
the first equation is telling us which, if c = 0, will cause the wolf population to decay
exponentially quickly. In contrast, without wolves the cute furry things eat grass and
prosper. That’s what the + c term in the second equation is telling us which, if w = 0,
ensures that the population of cute furry things grows exponentially. The second term
in each equation, ±wc, tells us what happens when the wolves and cute furry things
meet. The ± sign means that it’s good news for one, less good for the other.
So much for the Lotka-Volterra equations. Let’s now look at something more com-
plicated. Suppose that there is some intra-species competition: a little wolfy bickering
that sometimes gets out of hand, and some cute, furry in-fighting. We can model this
by adding extra terms to the original equations:
dw
= w( ↵ + c µw)
dt
dc
= c( w ⌫c) (4.11)
dt
– 78 –
where the two new constants are also positive, µ, ⌫ > 0. Both new terms come with
minus signs, which is appropriate because fighting is bad.
Sadly, we can’t just solve the di↵erential equation like we did before because it’s no
longer separable. Instead, we’re going to need a more creative method to understand
what’s going on. This is where the divergence theorem comes in. We will use it to
show that, provided µ 6= 0 or ⌫ 6= 0, the periodic orbits of the Lotka-Volterra equation
no longer exist.
We first change notation a little. We write the pair of predator-prey equations (4.11)
in vector form
! !
da w w( ↵ + c µw)
= p with a = and p =
dt c c( w ⌫c)
Any solution to these equations traces out a path a(t) in the animal phase plane. The
re-writing above makes it clear that p is the tangent to this path. The question that
we wish to answer is: does this path close? In other words, is there a periodic orbit?
By the 2d divergence theorem, this in turn means that the following integral over the
area enclosed by the periodic orbit must also vanish:
Z
r · [b(w, c)p] dA = 0
D
where, in this context, the gradient operator is r = (@/@w, @/@c). At this juncture,
the trick is to find a cunning choice of function b(w, c). The one that works for us is
b = 1/wc. This is because we have
p µ ⌫
r· =
wc c w
– 79 –
Both of these terms are strictly negative. (For this it is important to remember that
populations w and c are strictly positive!) But if r · (p/wc) is always negative then
there’s no way to integrate it over a region and get zero. Something has gone wrong.
And what’s gone wrong was our original assumption of closed orbits. We learn that the
nice periodic solutions of the Lotka-Volterra equations are spoiled by any intra-species
competition. We’re left just with the fixed point which is now stable. All of which is
telling us that a little in-fighting may not be so bad after all. It keeps things stable.
The general version of the story above goes by the name of the Bendixson-Dulac
theorem and is a powerful tool in the study of dynamical systems.
The 2d divergence theorem is the statement that the left-hand sides of (4.13) and (4.14)
are equal; Green’s theorem in the plane is the statement that the right-hand sides are
equal. ⇤
– 80 –
Applied to a rectangular region, Green’s theorem in the
plane reduces to the fundamental theorem of calculus. We
take the rectangular region to be 0 x a and 0 y b.
Then
Z Z a Z b
@P @P
dA = dx dy
A @y @y
Z a0 ⇣ 0 ⌘ Z
= dx P (x, b) + P (x, 0) = P dx
0 C
where only the horizontal segments contribute, and the minus signs are such that C is
traversed anti-clockwise. Meanwhile, we also have
Z Z b Z a
@Q @Q
dA = dy dx
A @x 0 0 @y
Z b ⇣ ⌘ Z
= dy Q(x, a) Q(x, 0) = Q dx
0 C
where, this time, only the vertical segments contribute.
Green’s theorem also holds if the area A has a number of disconnected components,
as shown in Figure 14. In this case, the integral should be done in an anti-clockwise
direction around the exterior boundary, and in a clockwise direction on any interior
boundary. The quickest way to see this is to do the integration around a continu-
ous boundary, as shown in the right-hand figure, with an infinitesimal gap. The two
contributions across the gap then cancel.
An Example
Let P = x2 y and Q = xy 2 . We’ll take A to be the region bounded by the parabola
y 2 = 4ax and the line x = a, both with 2a y 2a. Then Green’s theorem in the
plane tells us that
Z Z
2 2
(y x ) dA = x2 y dx + xy 2 dy
A C
But this was a problem on the examples sheet, where you found that both give the
answer 104
105
a4 .
– 81 –
Figure 14. Don’t mind the gap. Green’s theorem for an area with disconnected boundaries.
It is not known where Green learned his mathematics. The Nottingham subscription
library held some volumes, but not enough to provide Green with the background
that he clearly gained. Yet, from his mill, Green produced some of the most striking
mathematics of his time, including the development of potential theory and, most
importantly, the formalism of Green’s functions that you will meet in Section 5, as
well as in later courses. Much of this was contained in a self-published pamphlet, from
1828, entitled “An Essay on the Application of Mathematical Analysis to the Theories
of Electricity and Magnetism”. 51 copies were printed.
Green’s reputation spread and, at the age of 40, with no formal education, and
certainly no Latin or Greek, Green the miller came to Cambridge as a mathematics
undergraduate, clothes covered in flour and pretending it was chalk. (University motto:
nurturing imposter syndrome since 1209.) With hindsight, this may not have been the
best move. Green did well in his exams, but his published papers did not reach the
revolutionary heights of his work in the mill. He got a fellowship at Caius, developed
a taste for port, then gout, and died before he reached his 50th birthday.
There are parallels between Green’s story and that of Ramanujan who came to
Cambridge several decades later. To lose one self-taught genius might be regarded as
a misfortune. To lose two begins to look like carelessness.
– 82 –
Figure 15. The surface S and bounding curve C for Stokes’ theorem. The normal to the
surface is shown (at one point) by the red arrow. The theorem invites us to compute the flux
of a vector field F, shown by the green arrows, through the surface, and compare it to the
line integral around the boundary.
Note that there will typically be many surfaces S that share the same boundary
C. By Stokes’ theorem, the integral of r ⇥ F over S must give the same answer for
all such surfaces. The theorem also holds if the boundary @S consists of a number of
disconnected components, again with their orientation determined by that of S.
We’ll give a proof of Stokes’ theorem shortly. But first we put it to some use.
– 83 –
where A is the area and n the normal of the surface. Taking the limit in which this
area shrinks to zero, Stokes’ theorem then tell us that
Z
1
n · (r ⇥ F) = lim F · dx (4.15)
A!0 A C
In other words, at any given point, the value of r ⇥ F in the direction n tells us about
the circulation of F in the plane normal to n
around any closed curve C. But we showed in Section 1.2 that any such conservative
field can be written as F = r for some potential .
– 84 –
An Example
Let S be the cap of a sphere of radius R that is
covered by the angle 0 ✓ ↵, as shown in the
figure. We’ll take
That leaves us with the line integral around the rim. This curve C is parameterised by
the angle and is given by
We then have
Z Z 2⇡ Z 2⇡
3 2
F · dx = d Rxz sin ↵ cos = R sin ↵ cos ↵ d cos2 = ⇡R3 sin2 ↵ cos ↵
C 0 0
Another Example
As a second example, consider the conical surface S defined by z 2 = x2 + y 2 with
0 < a z b. This surface is parameterised, in cylindrical polar coordinates, by
– 85 –
We’ll integrate the same vector field (4.16) over this surface. We have
where we’ve substituted in the parametric expressions for x and z from (4.18). The
integral is then
Z Z b Z 2⇡
r ⇥ F · dS = d⇢ d ⇢2 (1 + cos2 ) = ⇡(b3 a3 ) (4.19)
S a 0
Now the surface has two boundaries, and we must integrate over both of them. We
write @S = Cb Ca where Cb has radius b and Ca radius a. Note the minus sign,
reflecting the fact that the orientation of the two circles is opposite.
For a circle of radius R, we have x( ) = R(cos , sin , 1), and so dx = R( sin , cos , 0)
and
Z Z 2⇡
F · dx = d R3 cos2 = ⇡R3
CR 0
Z Z ✓ ◆
@Q @P
r ⇥ F · dS = dS
S S @x @y
However, with a little more work we can also show that the converse is true. In other
words, we can lift Green’s theorem out of the plane to find Stokes’ theorem.
– 86 –
Consider a parameterised surface S defined by x(u, v) and denote the associated area
in the (u, v) plane as A. We parameterise the boundary C = @S as x(u(t), v(t)) and
the corresponding boundary @A as (u(t), v(t)). The key idea is to use Green’s theorem
in the (u, v) plane for the area A and then uplift this to prove Stokes theorem for the
surface S.
Now our task is clear. We should look at the partial derivatives on the right hand side.
We just need to be careful about what thing depends on what thing:
✓ ◆ ✓ ◆ ✓ ◆
@Fv @ @x @ @xi @Fi @xj @xi @ 2 xi
= F· = Fi = + F i
@u @u @v @u @v @xj @u @v @u@v
Meanwhile, we have
✓ ◆ ✓ ◆ ✓ ◆
@Fu @ @x @ @xi @Fi @xj @xi @ 2 xi
= F· = Fi = + Fi
@v @v @u @v @u @xj @v @u @v@u
Subtracting the second expression from the first, the second derivative terms cancel,
leaving us with
✓ ◆
@Fv @Fu @xj @xi @Fi @Fj @xk @xl @Fi
= = ( jk il jl ik )
@u @v @u @v @xj @xi @u @v @xj
✏jip ✏pkl = jk il jl ik
We then have
✓ ◆
@Fv @Fu @xk @xl @Fi @x @x
= ✏jip ✏pkl = (r ⇥ F) · ⇥
@u @v @u @v @xj @u @v
– 87 –
Figure 16. You may now turn the page. . . the original version of Stokes’ theorem, set as an
exam question.
Now we’re done. Following through the chain of identities above, we have
Z Z ✓ ◆
@Fv @Fu
F · dx = dudv
C A @u @v
Z ✓ ◆
@x @x
= (r ⇥ F) · ⇥ dudv
A @u @v
Z
= (r ⇥ F) · dS
S
– 88 –
If you’re in Cambridge and looking for a tranquil place away from the tourists to
sit, drink co↵ee, and ponder the wider universe, then you could do worse than the Mill
Road cemetery, large parts of which are overgrown, derelict, and beautiful. Stokes is
buried there, as is Cayley, although both gravestones were destroyed long ago. You can
find Stokes’ resting place nestled between the graves of his wife and daughter1 .
r ⇥ B = µ0 J (4.20)
where J is the current density and µ0 is a constant of nature that determines the
strength of the magnetic field and has some pretentious name that I can never remem-
ber. Another of the Maxwell equations reads r·B = 0 and in most situations we should
solve this in conjunction with (4.20) but here it will turn out, somewhat fortuitously,
that if we just find the obvious solution to (4.20) then it solves r · B = 0 automatically.
The equation (4.20) provides a simple opportunity to use Stokes’ theorem. We inte-
grate both sides over a surface S that cuts through the wire, as shown in the figure to
the right. We then have
Z Z Z
r ⇥ B · dS = B · dx = µ0 J · dS = µ0 I
S C S
– 89 –
don’t like the z direction to be horizontal.) Then if S is a disc of radius ⇢, then the
boundary C = @S is paramterised by the curve
@x
x = ⇢(cos , sin , 0) =) t= = ⇢( sin , cos , 0)
@
We’ll make the obvious guess that B lies in the same direction as t and work with the
ansatz
Then B · t = ⇢b(⇢). Provided that ⇢ is bigger than the radius of the wire, Maxwell’s
equation tells us that
Z Z 2⇡
µ0 I
µ0 I = B · dx = d ⇢b(⇢) =) B(x) = ( sin , cos , 0)
C 0 2⇡⇢
You can check that this answer also satisfies the other Maxwell equation r · B = 0.
We learn that the magnetic field circulates around the wire, and drops o↵ as 1/⇢ with
⇢ the distance from the wire.
Z
1
r · F = lim F · dS
V !0 V S
– 90 –
upper face in the figure is roughly hu hv u v. Since hu and hv may depend on the
coordinates, this could di↵er from the area of the lower face, albeit only by a small
amount w. Then, assuming that F is roughly constant on each face, we have
Z h i
F · dS ⇡ hu hv Fw (u, v, w + w) hu hv Fw (u, v, w) u v + two more terms
S
@
⇡ (hu hv Fw ) u v w + two more terms
@w
Dividing through by the volume then gives us the advertised expression for r · F. ⇤
Claim: The curl of a vector field F(u, v, w) in a general orthogonal, curvilinear coor-
dinate system is given by
h u e u h v e v h w ew
1 @ @ @
r⇥F = @u @v @w
hu hv hw
hu Fu hv Fv hw F w
✓ ◆
1 @ @
= (hw Fw ) (hv Fv ) eu + two similar terms
hv hw @v @w
Proof: This time we use the integral definition of curl
(4.15)
Z
1
n · (r ⇥ F) = lim F · dx
A!0 A C
– 91 –