Lab 7B - Divergence Theorem
Math 2374 - University of Minnesota
http://www.math.umn.edu/math2374
Questions to: swenson@math.umn.edu

Integration in More than Two Dimensions

In last week's lab, we recalled the six different kinds of integrals we've studied this semester -- here they are again, for reference.

Type Symbol Region Integrand How to Do It
double ∫∫_R^  u A R, a region scalar function u ∫ (∫u (x, y) dy) dx
triple ∫∫∫_S^ u V S, a solid scalar function u ∫ (∫ (∫u (x, y, z) dz) dy) dx
line (path) ∫_C^ u L   or   ∮_Cu L C, a curve withparametrizationf (t), a≤t≤b scalar function u ∫_a^bu (f (t)) ∥f ' (t) ∥ t
line (path) ∫_C^ F · x   or   ∮_CF · x C, a curve withparametrizationf (t), a≤t≤b vector field F ∫_a^bF (f (t)) · f ' (t) t
surface ∫∫_M^ uσ   or   ∯_Muσ M, a surface withparametrization f (s, t) and parameter range R scalar function u ∫∫_R^ u (f (s, t)) ∥∂f/∂s × ∂f/∂t∥A
surface (flux) ∫∫_MF · nσ   or   ∯_MF · nσ M, a surface withparametrization f (s, t) and parameter range R vector field F ∫∫_R^ F (f (s, t)) · (∂f/∂s × ∂f/∂t) A

We saw last week that Stokes's Theorem links line integrals of vector fields to surface integrals of vector fields via the curl.  This week, we will work with the Divergence Theorem, which links surface integrals of vector fields to triple integrals via the divergence.

Divergence Theorem:  Suppose S is a solid with smooth boundary ∂S, and let F be a vector field which is smooth on and "near" S.  Then ∯_ (∂S) F · n σ = ∫∫∫_Sdiv FV.

Using the Divergence Theorem: Example 1

Triple integrals of scalar functions are almost always easier to compute than surface integrals of vector fields.  Therefore, we usually apply the Divergence Theorem to replace a surface integral with a triple integral.  Of course, this only works if our surface is the boundary of some solid!

Example 1

Let F(x, y, z) = (sinx cos^2y, sin^3y cos^4z, sin^5z cos^6x), and let M be the surface of the cube in the first octant bounded by the coordinate planes and the planes x = π/2, y = π/2, and z = π/2.  Using the Divergence Theorem, calculate the outward flux of F across M.

We need to calculate div F; we can do this by hand, or use Mathematica.  Let's use Mathematica:

In[81]:=

F[x_, y_, z_] = {(Sin[x]) * (Cos[y]^2), (Sin[y]^3) * (Cos[z]^4), (Sin[z]^5) * (Cos[x]^6)}

Out[81]=

{Cos[y]^2 Sin[x], Cos[z]^4 Sin[y]^3, Cos[x]^6 Sin[z]^5}

Remember: Mathematica will not understand our shorthand notation Sin^5[x]!

Mathematica can compute the divergence of a vector field using the command Div:

In[82]:=

d[x_, y_, z_] = Div[F[x, y, z]]

Out[82]=

Cos[x] Cos[y]^2 + 3 Cos[y] Cos[z]^4 Sin[y]^2 + 5 Cos[x]^6 Cos[z] Sin[z]^4

Now, by the Divergence Theorem, we can just take the triple integral of our result.

In[83]:=

Integrate[d[x, y, z], {x, 0, Pi/2}, {y, 0, Pi/2}, {z, 0, Pi/2}]

Out[83]=

(19 π^2)/64

If we didn't know the Divergence Theorem, we'd have to parametrize all six faces individually, check the normal vectors to be sure they pointed outward, evaluate the six integrals, and sum the values.  If you'd like, you can do this to check our result.

Using the Divergence Theorem: Example 2

Sometimes, we can use the Divergence Theorem to simplify a surface integral, even when the surface isn't the boundary of any solid.  The idea is to invent another, simpler surface which completes the boundary of a solid.  Then the Divergence Theorem will give the surface integral over the two surfaces together; we can calculate the simpler integral and subtract it from the total to get our solution.

This is tricky, but it's an important idea.  Re-read that last paragraph until it makes sense, or ask your TA to help you figure it out.

Example 2

Let F(x, y, z) = (y^2 - 2y z, z^2 - 2x z, x^2 - 2x y) and let M be the surface parametrized by f(r,θ)=(r cos(θ), r sin(θ), cos(5π(1-r))-1, 0≤r≤1, 0≤θ≤2π.  Find the flux of F through M, using the upward normal vector.

This surface is terrible!  Here's a graph:

In[84]:=

f[r_, theta_] = {r * Cos[theta], r * Sin[theta], Cos[Sin[5Pi * (1 - r)]] - 1} ; M = ParametricPlot3D[f[r, theta], {r, 0, 1}, {theta, 0, 2Pi}, PlotPoints40] ShowLive[M]

[Graphics:HTMLFiles/index_24.gif]

Out[85]=

⁃Graphics3D⁃

Out[86]=

⁃Graphics3D⁃

Of course, M is not the boundary of a solid.  However, the boundary of M is the unit circle in the xy-plane (check this!).  Therefore, M and the unit disk (call it Δ) do form the boundary of a solid (call it S): try looking at the following graph from a few different points of view.

In[90]:=

g[r_, theta_] = {r * Cos[theta], r * Sin[theta], 0} ; Δ = ParametricPlot3D[g[r, theta], {r, 0, 1}, {theta, 0, 2Pi}] S = Show[M, Δ] S = ShowLive[M, Δ]

[Graphics:HTMLFiles/index_28.gif]

Out[91]=

⁃Graphics3D⁃

[Graphics:HTMLFiles/index_30.gif]

Out[92]=

⁃Graphics3D⁃

Out[93]=

⁃Graphics3D⁃

Roughly speaking, in English here's what we're going to do in order to calculate the surface integral of our original surface:

1. (Surface Integral over our original surface and the disk) = (triple integral of div F over the solid region enclosed by the two surfaces)    [By the Div Them]

2.  (Surface Integral over original surface) + (Surface integral over disk) = (triple integral over the solid region)    [Computing the two surface integrals separately]

3. (Surface Integral over original surface) = (triple integral over solid region) - (Surface Integral over disk)        [Solving for our original integral]

Remember, in the Divergence Theorem we use the outward pointing normal vector.  In the problem, we're asked to find the integral over M with the upward pointing normal vector, but when we combine it with the unit disk, the outward pointing normal is the downward pointing normal vector.  That means we have to replace M with -M in our calculations.  (As you should recall from lecture, the only real difference is that it will multiply our answer by -1.)

Let's rewrite the three equations above mathematically.

1.  ∯_ (Δ + (-M)) F · nσ = ∫∫∫_Sdiv F V            [By the Div Them; -M because we've switched the normal]

2.   ∫∫_ΔF · nσ + ∫∫_ (-M) F · nσ = ∫∫∫_Sdiv F V    [Computing the two surface integrals separately]

3. ∫∫_ (-M) F · nσ = ∫∫∫_Sdiv F V - ∫∫_ΔF · nσ        [Solving for our original integral; here I've multiplied by -1 to get the correct sign]

We're interested in the integral over M, not -M, so let's fix that:

4(a). -∫∫_MF · nσ = ∫∫∫_Sdiv F V - ∫∫_ΔF · nσ        [integral over -M = - (integral over M)]

4(b). ∫∫_MF · nσ = ∫∫_ΔF · nσ - ∫∫∫_Sdiv F V            [Multiplying by -1]

Now there's another step which makes this particular problem much easier.  It turns out that  F is a very nice vector field: evaluate the cell below.

In[94]:=

F[x_, y_, z_] = {y^2 - 2y z, z^2 - 2x z, x^2 - 2x y} Div[F[x, y, z]]

Out[94]=

{y^2 - 2 y z, -2 x z + z^2, x^2 - 2 x y}

Out[95]=

0

Hence the triple intregral of div F is 0, and we can conclude that ∫∫_ΔF · nσ - ∫∫_MF · nσ = 0, so the integrals are equal!  This means that we can work with the unit disk in place of our terrible surface M.

Let's finish off the calculation on Δ: ∫∫_ΔF · nσ=∫∫_R^ F (g (r, θ)) · (∂g/∂r × ∂g/∂θ) A, so first, we substitute g into F:

In[96]:=

v1[r_, theta_] = Apply[F, g[r, theta]]

Out[96]=

{r^2 Sin[theta]^2, 0, r^2 Cos[theta]^2 - 2 r^2 Cos[theta] Sin[theta]}

Next, we cross the partial derivatives of g.

In[97]:=

dgdr[r_, theta_] = D[g[r, theta], r] dgdtheta[r_, theta_] = D[g[r, theta], theta] Cross[dgdr[r, theta], dgdtheta[r, theta]] v2[r_, theta_] = Simplify[%]

Out[97]=

{Cos[theta], Sin[theta], 0}

Out[98]=

{-r Sin[theta], r Cos[theta], 0}

Out[99]=

{0, 0, r Cos[theta]^2 + r Sin[theta]^2}

Out[100]=

{0, 0, r}

Lastly, we dot our results together and integrate.

In[101]:=

v1[r, theta] . v2[r, theta] Integrate[%, {r, 0, 1}, {theta, 0, 2Pi}]

Out[101]=

r (r^2 Cos[theta]^2 - 2 r^2 Cos[theta] Sin[theta])

Out[102]=

π/4

So the flux of F through Δ is π/4.  Notice that this is the flux up through Δ: the normal vector above is (0,0,r), and r is positive.  By the Divergence Theorem, the flux of F down through M is -π/4; the flux of F up through M is π/4.  Remember, when we apply the Divergence Theorem, our combined surface integral has to use the outward normal vector; this is the downward normal to M and the upward normal to Δ.

Exercises

Exercise 1

Let  r(x,y,z)=(x,y,z), and F(x,y,z)=∥ rr, where the double bars stand for magnitude, and let M be the surface of the solid bounded by the paraboloid z = 25 - x^2 - y^2 and the xy-plane.  Use the Divergence Theorem to compute the outward flux of F through M.  [Hint: Mathematica can't compute the integral exactly; you should use NIntegrate.]

Exercise 2

Let  r(x,y,z)=(x,y,z), and F(x,y,z) = r / ∥ r∥ , where the double bars stand for magnitude, and let M be the surface of the solid bounded by the paraboloid z = 26 - x^2 - y^2 and the plane z = 1.  Use the Divergence Theorem to compute the outward flux of F through M.  [Hint: Mathematica can't compute the integral exactly; you should use NIntegrate.]

Exercise 3

Use the Divergence Theorem to calculate the outward flux of F(x, y, z) = (z^2x, 1/3y^3 + tan(z), x^2z + y^2) through the top half of the sphere x^2 + y^2 + z^2 = 1.  [Hint: the surface is not closed; you need a closed surface to apply the Divergence Theorem.  Make a closed surface by adding a flat bottom to the hemisphere -- and think carefully!]

Exercise 4

Use the Divergence Theorem to calculate the outward flux of F(x, y, z) = (y^2x + e^yz, x^2y + tan(z), z^3/3 + x^2/5 + 9y^2)/3 through the bottom half of the sphere x^2 + y^2 + z^2 = 4.  [Hint: the surface is not closed; you need a closed surface to apply the Divergence Theorem.  Make a closed surface by adding a flat top to the hemisphere -- and think carefully!]

Exercise 5

In this problem, we will prove Archimedes's Principle: the buoyant force on a submerged object equals the weight of the fluid it displaces.  We choose a system of coordinates so that z represents the depth below the fluid surface; that is, the fluid surface is the xy-plane and the z-axis points down into the fluid.  At every point where z≥0, the pressure is given by the scalar function p(x,y,z)=δgz, where δ is the density of the fluid (assumed constant) and g is the acceleration due to gravity (also assumed constant).

Set up an integral to calculate the weight of the fluid displaced by S, where S is any solid completely submerged in fluid (i.e. z≥0 at every point of S).  This means that you are to write a general integral that works for every S, not just to choose some particular S.  [Hint: how much fluid does S displace?]

b) Loosely, buoyant force is the integral of pressure.  More precisely, the buoyant force is given by the vector integral B = -∯_ (∂S) (pn) σ.  Write a paragraph explaining why this is a reasonable formula.  [Hint: think of the integral as a sum of many little pieces.  Don't forget to explain the minus sign!]

c) By direct calculations, we can see that pn = p (n_1, n_2, n_3) = (pn_1, 0, 0) + (0, pn_2, 0) + (0, 0, pn_3) = (pi · n) i + (pj · n) j + (pk · n) k. Use this substitution, rearrange, and use the Divergence Theorem (three times) to prove Archimedes's Principle.

Credits


Created by Mathematica  (November 6, 2004)