Chapter 39. Shortcut for flux: the divergence theorem

§39.1 [TEXT] The divergence theorem

Remember back when we had Green’s theorem, we could transform 2D scalar flux (which was a line integral) into an area integral:

∮𝒞︀(𝐅⋅𝐧d𝑠)⏟=∮𝒞︀(−𝑞d𝑥+𝑝d𝑦)=∬ℛ︀∇⋅𝐅d𝐴⏟=∬ℛ︀(𝜕𝑝𝜕𝑥+𝜕𝑞𝜕𝑦)d𝐴.

This was nice because parametrization was annoying and straight-up area integrals are simpler. In general, if you still have the poster, the green pictures are easier to deal with.

The divergence theorem will let you do the same thing, transforming a flux surface integral (which is the horrendous surface integral that has been haunting you for the last couple weeks) into a volume integral. Which is an even bigger profit — no parametrization, no cross product table, etc.

Figure 94: The highlighted arrow for the divergence theorem in our poster Figure 75.

Here’s the result:

Memorize: Divergence theorem

Suppose a closed surface 𝒮︀ encloses a compact solid 𝒯︀, and 𝐅 is defined everywhere in 𝒯︀. Then

∯𝒮︀𝐅⋅𝐧d𝑆⏟=∬ℛ︀𝐅(𝐫(𝑢,𝑣))⋅(𝜕𝐫𝜕𝑢×𝜕𝐫𝜕𝑣)d𝑢d𝑣=∭𝒯︀∇⋅𝐅d𝑉⏟=∭𝒯︀(𝜕𝑝𝜕𝑥+𝜕𝑞𝜕𝑦+𝜕𝑟𝜕𝑧)d𝑉.

I’ve snuck in a new symbol ∯𝒮︀, but the extra circle is analogous to before. Just like how ∮𝒞︀ was a reminder that 𝒞︀ was a closed loop:

Definition of ∯
∯𝒮︀ means “∬𝒮︀ but with an extra optional reminder that 𝒮︀ is a closed surface”. (The reminder is optional, i.e. you are not obligated to add it even if 𝒮︀ is closed.)

Also, note there’s a fine-print requirement that 𝒯︀ should be compact, i.e. it should not extend infinitely in any direction.

Remark: “Closed surface” = “holds water”

If you’re unclear what “closed surface” means, a picture to keep in your head might be “holds water”, i.e., you could imagine filling the interior of 𝒮︀ with a water (that’s the volume 𝒯︀) and it shouldn’t leak out. So the following are not closed surfaces:

  • Curved part of hemisphere (e.g., bowl with no lid)
  • Curved part of cylinder (e.g., straw)

But the following are closed surfaces:

  • Cylinder including the two caps (e.g., water bottle)
  • Sphere
  • The six faces of a rectangular prism

We can jump straight into examples now!

Sample Question
Let 𝑅>0 be given. Compute the flux of the vector field 𝐅(𝑥,𝑦,𝑧)=(𝑥𝑦𝑧) through the closed surface of the sphere 𝒮︀ defined by 𝑥2+𝑦2+𝑧2=𝑅2 oriented outward, using the Divergence Theorem.

Solution. The sphere 𝒮︀ encloses a ball 𝒯︀ of radius 𝑅. The divergence is given by

∇⋅𝐅=𝜕𝑝𝜕𝑥+𝜕𝑞𝜕𝑦+𝜕𝑟𝜕𝑧=1+1+1=3

Then the answer is

∭𝒯︀∇⋅𝐅d𝑉=∭𝒯︀3d𝑉=3Vol(𝒮︀)=3⋅43𝜋𝑅3=4𝜋𝑅3.

□

Remark: Connection to surface area of sphere

This was also the first example we did with the surface area trick, where we found that the answer was 𝑅⋅SurfArea(𝒮︀) which is also 4𝜋𝑅3.

Actually, put another way: if you know the volume of the sphere is 43𝜋𝑅3 and the divergence theorem, then the surface area trick lets you derive the surface area formula of 4𝜋𝑅2.

Warning: Beware of undefined points of 𝐅

You need to be careful to only apply the divergence theorem if the force is actually defined on the entire solid 𝒯︀! Here’s an example of what can go wrong.

Let 𝒮︀ denote the sphere 𝑥2+𝑦2+𝑧2=𝑅2 of radius 𝑅 again. Let 𝐆 be the force of gravity exerted by a point mass 𝑚 at the origin. In the last chapter we computed

∬𝒮︀𝐆⋅𝐧d𝑆=−4𝜋𝐺𝑚

using the surface area trick.

However, if you compute the divergence ∇⋅𝐆, you’ll actually find it’s zero at every point — except the origin, where 𝐆 is undefined because the gravity causes division-by-zero. (See Exercise 32.1.) If you blindly apply the divergence theorem and don’t notice the issue with the origin, you would instead get the wrong answer ∭𝒯︀0d𝑉=0, rather than the correct answer −4𝜋𝐺𝑚. (That said, see Exercise 39.2 for a safe usage.)

Sample Question
Let 𝑎>0 be given. Calculate the flux of the vector field 𝐅(𝑥,𝑦,𝑧)=(𝑥2𝑦2𝑧2) through the closed surface of the cube 𝒮︀ bounded by 0≤𝑥,𝑦,𝑧≤𝑎 using the Divergence Theorem.

Solution. The divergence is

∇⋅𝐅=𝜕𝜕𝑥(𝑥2)+𝜕𝜕𝑦(𝑦2)+𝜕𝜕𝑧(𝑧2)=2𝑥+2𝑦+2𝑧.

Hence the flux turns into

∭𝒯︀(2𝑥+2𝑦+2𝑧)d𝑉=2∭𝒯︀𝑥d𝑉+2∭𝒯︀𝑦d𝑉+2∭𝒯︀𝑧d𝑉.

Due to the symmetry of the cube:

∭𝒯︀𝑥d𝑉=∭𝒯︀𝑦d𝑉=∭𝒯︀𝑧d𝑉=𝑎2⋅Vol(𝒯︀)=𝑎42.

If you can’t see it by symmetry, you could also just explicitly calculate

∭𝒯︀𝑥d𝑉=(∫𝑥=0𝑎𝑥d𝑥)(∫𝑦=0𝑎d𝑦)(∫𝑧=0𝑎d𝑧)=𝑎22⋅𝑎⋅𝑎=𝑎42.

In any case, we get an answer of

2⋅𝑎42+2⋅𝑎42+2⋅𝑎42=3𝑎4.

□

Sample Question
Compute the flux of the vector field 𝐅(𝑥,𝑦,𝑧)=(𝑦𝑧𝑥𝑧𝑥𝑦) through the closed surface 𝒮︀ defined by 𝑥4+(𝑦−5)6+𝑧8=2025.

Solution. The surface 𝒮︀ is hard to describe, but it encloses some solid 𝒯︀. However, if you compute the divergence, it is

∇⋅𝐅=𝜕𝜕𝑥(𝑦𝑧)+𝜕𝜕𝑦(𝑥𝑧)+𝜕𝜕𝑧(𝑥𝑦)=0+0+0=0.

So it doesn’t even matter what the solid 𝒯︀ is; the answer is just

∭𝒯︀0d𝑉=0.

□

Sample Question
Compute the flux of the vector field 𝐅(𝑥,𝑦,𝑧)=(𝑥𝑦𝑦𝑧𝑧𝑥) through the closed surface 𝒮︀ formed by the paraboloid 𝑧=𝑥2+𝑦2 and its circular base 𝑧=0, where 𝑥2+𝑦2≤1.

Solution. Let 𝒯︀ denote the region enclosed by 𝒮︀. The divergence is given by

∇⋅𝐅=𝜕𝜕𝑥(𝑥𝑦)+𝜕𝜕𝑦(𝑦𝑧)+𝜕𝜕𝑧(𝑧𝑥)=𝑦+𝑧+𝑥

The region 𝒯︀ is bounded by 𝑧=𝑥2+𝑦2 and 𝑧=0, within 𝑥2+𝑦2≤1. So the divergence theorem means we need to calculate

∬𝑥2+𝑦2≤1∫𝑧=0𝑥2+𝑦2(𝑥+𝑦+𝑧)d𝑧d𝑥d𝑦.

Naturally, this is best done using cylindrical coordinates. Writing 𝑥=𝑟cos𝜃 and 𝑦=𝑟sin𝜃, and remembering that

d𝑥d𝑦d𝑧=d𝑉=𝑟d𝑟d𝜃d𝑧

then this becomes

∫𝑟=01∫𝜃=02𝜋∫𝑧=0𝑟2𝑟(𝑟cos𝜃+𝑟sin𝜃+𝑧)d𝑧d𝜃d𝑟.

But the integrals with 𝜃 in them are going to be zero by symmetry. For example, the first term is

∫𝑟=01∫𝜃=02𝜋∫𝑧=0𝑟2𝑟2cos𝜃d𝑧d𝑟d𝜃=(∫𝑟=01∫𝑧=0𝑟2𝑟2d𝑧d𝑟)(∫𝜃=02𝜋cos𝜃d𝜃)⏟=0=0.

Similarly, the contribution of 𝑟sin𝜃 is just zero as well. So we are just left with

∫𝑟=01∫𝜃=02𝜋∫𝑧=0𝑟2𝑟𝑧d𝑧d𝜃d𝑟=(∫𝑟=01∫𝑧=0𝑟2𝑟𝑧d𝑧d𝑟)(∫𝜃=02𝜋d𝜃).

Obviously ∫𝜃=02𝜋d𝜃=2𝜋. The double integral can be evaluated as

∫𝑟=01𝑟∫𝑧=0𝑟2𝑧d𝑧d𝑟=∫𝑟=01𝑟⋅[𝑧22]𝑧=0𝑟2d𝑟=∫𝑟=01𝑟52d𝑟=[𝑟612]𝑟=01=112.

Hence the final answer is

112⋅2𝜋=𝜋6.

□

§39.2 [SIDENOTE] A picture for why the divergence theorem is true

The picture is actually exactly the same as Figure 90 from Section 35.4, our picture of Green’s theorem for 2D flux! The divergence is still drawn as green explosions. The only change is in the dimensions:

And the rest of the analogy carries over: all the interior green arrows cancel except for those pushing directly against the purple faces of the cube, so there’s the flux integral we wanted.

§39.3 [RECAP] All the methods for flux

Here’s a complete recipe for flux, augmented with the two shortcuts we described.

Recipe for flux, with shortcuts

Suppose we need to calculate the flux of 𝐅 through a surface 𝒮︀.

  1. If 𝒮︀ is a closed region, use the divergence theorem to avoid parametrization:

    ∯𝒮︀𝐅⋅𝐧d𝑆=∭𝒯︀∇⋅𝐅d𝑉⏟=∭𝒯︀(𝜕𝑝𝜕𝑥+𝜕𝑞𝜕𝑦+𝜕𝑟𝜕𝑧)d𝑉.
  2. If 𝐅⋅𝐧 happens to equal the same constant 𝑐 everywhere (as described in Section 38.6), then output 𝑐 times the surface area of 𝒮︀, i.e.

    ∯𝒮︀𝐅⋅𝐧d𝑆=𝑐SurfArea(𝒮︀).
  3. Otherwise, fall back to the parametrization recipe described in Section 38.5. To describe it again here briefly:

    1. Get the cross product 𝜕𝐫𝜕𝑢×𝜕𝐫𝜕𝑣 by either looking it up from Table 23 or by computing it by hand, for a parametrization 𝐫:ℛ︀→ℝ3 of the surface 𝒮︀.
    2. If necessary, negate the cross product to match the orientation of the surface specified in the question.
    3. Compute the dot product 𝐅⋅(𝜕𝐫𝜕𝑢×𝜕𝐫𝜕𝑣).
    4. Integrate over the region ℛ︀ using any method for double integrals.

§39.4 [TEXT] Advanced technique: sealing regions

This is the 3D analog of Section 34.6: in some situations if you have a surface 𝒮︀ which isn’t closed, you can seal it by adding some part to the surface. The picture you can have in your head is that you have a bowl or something, and then you add a layer of plastic wrap on the bowl.

Sample Question

Let 𝐅 be the vector field defined by:

𝐅(𝑥,𝑦,𝑧)=⟨𝑥+tan𝑧,𝑦+𝑒𝑧,1⟩.

Consider the hemisphere 𝒮︀ defined by the equation:

𝑥2+𝑦2+𝑧2=1with𝑧≥0

oriented outward. Compute the flux of 𝐅 through 𝒮︀.

Figure 95: Sealing a bowl with a lid. Like microwaving food, though the bowl is upside-down.

Solution. Our picture is that 𝒮︀ looks like an upside-down bowl. So we add a lid 𝒮︀lid consisting of the disk 𝑧=0 and 𝑥2+𝑦2≤1. This encloses a solid region 𝒯︀, half a solid ball of radius 1, as in Figure 95.

The divergence of 𝐅 is:

∇⋅𝐅=𝜕𝜕𝑥(𝑥+tan𝑧)+𝜕𝜕𝑦(𝑦+𝑒𝑧)+𝜕𝜕𝑧(1)=1+1+0=2

which is constant. So the integral of the divergence over 𝒯︀ is just

∭𝒯︀∇⋅𝐅d𝑉=2⋅Vol(𝒯︀)=2⋅(12⋅43𝜋⋅13)=43𝜋.

Meanwhile, 𝒮︀lid (which we orient downwards) is a flat surface, so its flux integral is easy to calculate: from Table 23 we choose 𝐧d𝑆=⟨0,0,−1⟩ and hence

∬𝒮︀lid𝐅⋅𝐧d𝑆=∬𝑥2+𝑦2≤1⟨𝑥+tan0,𝑦+𝑒0,1⟩⋅⟨0,0,−1⟩d𝑥d𝑦=∬𝑥2+𝑦2≤1(−1)d𝑥d𝑦=−𝜋.

So when we apply the divergence theorem, we get that

∬𝒮︀𝐅⋅𝐧d𝑆⏟Answer+∬𝒮︀lid𝐅⋅𝐧d𝑆⏟=−𝜋=∭𝒯︀∇⋅𝐅d𝑉⏟=43𝜋.

Hence, we get the answer

∬𝒮︀𝐅⋅𝐧d𝑆=43𝜋−(−𝜋)=73𝜋.

□

§39.5 [EXER] Exercises

Exercise 39.1. Let 𝒮︀ be the part of the surface 𝑧=𝑒𝑥2+𝑦2 where 𝑧≤𝑒, with normal vector oriented downwards. Let 𝐅(𝑥,𝑦,𝑧)=⟨cos(𝑧2)−𝑥,sin(𝑧2)−𝑦,2𝑧⟩. Compute the flux of 𝐅 through 𝒮︀. (Recommended approach: sealing.)

Exercise 39.2. Suppose 𝒮︀1 and 𝒮︀2 are two closed surfaces that don’t intersect and such that 𝒮︀2 is contained inside 𝒮︀1. Orient both surfaces outwards. Let 𝑂 be a point contained inside 𝒮︀2. Consider the force of gravity 𝐆 exerted by a point mass of mass 𝑚 at 𝑂. Show that

∯𝒮︀1𝐆⋅𝐧d𝑆=∯𝒮︀2𝐆⋅𝐧d𝑆.

Exercise 39.3 (*). Prove Green’s theorem for flux by quoting the divergence theorem.

That is, suppose 𝐅=(𝑝𝑞) is a vector field in ℝ2 and 𝒞︀ is a closed loop enclosing a region ℛ︀ counterclockwise. Find a way to use the divergence theorem to prove

∮𝒞︀𝐅⋅𝐧d𝐬=∬ℛ︀(𝜕𝑝𝜕𝑥+𝜕𝑞𝜕𝑦)d𝐴.