Using the Divergence Theorem

Learning Objectives

  • Use the divergence theorem to calculate the flux of a vector field.
  • Apply the divergence theorem to an electrostatic field.

Using the Divergence Theorem

The divergence theorem translates between the flux integral of closed surface SS and a triple integral over the solid enclosed by SS. Therefore, the theorem allows us to compute flux integrals or triple integrals that would ordinarily be difficult to compute by translating the flux integral into a triple integral and vice versa.

Example: applying the divergence theorem

Calculate the surface integral SFdSSFdS, where SS is cylinder x2+y2=1x2+y2=1, 0z20z2, including the circular top and bottom, and F=x33+yz,y33sin(xz),zxyF=x33+yz,y33sin(xz),zxy.

Try it

Use the divergence theorem to calculate flux integral SFdSSFdS, where SS is the boundary of the box given by 0x20x2, 1y41y4, 0z10z1, and F=x2+yz,yz,2x+2y+2zF=x2+yz,yz,2x+2y+2z (see the following figure).

This figure is a vector diagram in three dimensions. The box of the figure spans x from 0 to 2; y from 0 to 4; and z from 0 to 1. The vectors point up increasingly with distance from the origin; toward larger x with increasing distance from the origin; and toward smaller y values with increasing height.

Figure 1. The box given by 0x20x2, 1y41y4, 0z10z1, and F=x2+yz,yz,2x+2y+2zF=x2+yz,yz,2x+2y+2z

Example: applying the divergence theorem

Let v=yz,xz,0v=yz,xz,0 be the velocity field of a fluid. Let CC be the solid cube given by 1x41x4, 2y52y5, 1z41z4, and let SS be the boundary of this cube (see the following figure). Find the flow rate of the fluid across SS.

<img src="/apps/archive/20220422.171947/resources/4df0ac7e1163d69369ff76a71f516bddb63c4bcb" data-media-type="image/jpeg" alt="This is a figure of a diagram of the given vector field in three dimensions. The x components are –y/z, the y components are x/z, and the z components are 0." id="13">

Figure 2. Vector field v=yz,xz,0v=yz,xz,0.

try it

Let v=xz,yz,0v=xz,yz,0 be the velocity field of a fluid. Let CC be the solid cube given by 1x41x4, 2y52y5, 1z41z4, and let SS be the boundary of this cube (see the following figure). Find the flow rate of the fluid across SS.

This is a figure of a diagram of the given vector field in three dimensions. The x components are x/z, the y components are y/z, and the z components are 0.

Figure 3. The solid cube given by 1x41x4, 2y52y5, 1z41z4

Watch the following video to see the worked solution to the above Try It

Example “Applying the Divergence Theorem” illustrates a remarkable consequence of the divergence theorem. Let SS be a piecewise, smooth closed surface and let FF be a vector field defined on an open region containing the surface enclosed by SS. If FF has the form F=f(y,z),g(x,z),h(x,y)F=f(y,z),g(x,z),h(x,y), then the divergence of FF is zero. By the divergence theorem, the flux of FF across SS is also zero. This makes certain flux integrals incredibly easy to calculate. For example, suppose we wanted to calculate the flux integral SFdSSFdS where SS is a cube and

F=sin(y)eyz,x2z2,cos(xy)esinxF=sin(y)eyz,x2z2,cos(xy)esinx.

Calculating the flux integral directly would be difficult, if not impossible, using techniques we studied previously. At the very least, we would have to break the flux integral into six integrals, one for each face of the cube. But, because the divergence of this field is zero, the divergence theorem immediately shows that the flux integral is zero.

We can now use the divergence theorem to justify the physical interpretation of divergence that we discussed earlier. Recall that if FF is a continuous three-dimensional vector field and PP is a point in the domain of FF, then the divergence of FF at PP is a measure of the “outflowing-ness” of FF at PP. If FF represents the velocity field of a fluid, then the divergence of FF at PP is a measure of the net flow rate out of point PP (the flow of fluid out of PP less the flow of fluid in to PP). To see how the divergence theorem justifies this interpretation, let BrBr be a ball of very small radius rr with center PP, and assume that BrBr is in the domain of FF. Furthermore, assume that BrBr has a positive, outward orientation. Since the radius of BrBr is small and FF is continuous, the divergence of FF is approximately constant on BrBr. That is, if PP is any point in BrBr, then div F(P)div F(P)div F(P)div F(P). Let SrSr denote the boundary sphere of BrBr. We can approximate the flux across SrSr using the divergence theorem as follows:

SFdS=Brdiv FdVBrdiv F(P)dV=div F(P)V(Br)SFdS=Brdiv FdVBrdiv F(P)dV=div F(P)V(Br).

As we shrink the radius rr to zero via a limit, the quantity div F(P)V(Br)div F(P)V(Br) gets arbitrarily close to the flux. Therefore,

div F(P)=limr01V(Br)SrFdSdiv F(P)=limr01V(Br)SrFdS

and we can consider the divergence at P as measuring the net rate of outward flux per unit volume at P. Since “outflowing-ness” is an informal term for the net rate of outward flux per unit volume, we have justified the physical interpretation of divergence we discussed earlier, and we have used the divergence theorem to give this justification.

Application to Electrostatic Fields

The divergence theorem has many applications in physics and engineering. It allows us to write many physical laws in both an integral form and a differential form (in much the same way that Stokes’ theorem allowed us to translate between an integral and differential form of Faraday’s law). Areas of study such as fluid dynamics, electromagnetism, and quantum mechanics have equations that describe the conservation of mass, momentum, or energy, and the divergence theorem allows us to give these equations in both integral and differential forms.

One of the most common applications of the divergence theorem is to electrostatic fields. An important result in this subject is Gauss’ law. This law states that if S is a closed surface in electrostatic field E, then the flux of E across S is the total charge enclosed by S (divided by an electric constant). We now use the divergence theorem to justify the special case of this law in which the electrostatic field is generated by a stationary point charge at the origin.

If (x,y,z) is a point in space, then the distance from the point to the origin is r=x2+y2+z2. Let Fr denote radial vector field Fr=1r2xy,yr,zr. The vector at a given position in space points in the direction of unit radial vector xy,yr,zr and is scaled by the quantity 1/r2. Therefore, the magnitude of a vector at a given point is inversely proportional to the square of the vector’s distance from the origin. Suppose we have a stationary charge of q Coulombs at the origin, existing in a vacuum. The charge generates electrostatic field E given by

E=q4πε0Fr,

where the approximation ε=8.854×1012 farad (F)/m is an electric constant. (The constant ε0 is a measure of the resistance encountered when forming an electric field in a vacuum.) Notice that E is a radial vector field similar to the gravitational field described in Example “A Unit Vector Field”. The difference is that this field points outward whereas the gravitational field points inward. Because

E=q4πε0Fr=q4πε0(1r1xy,yr,zr),

we say that electrostatic fields obey an inverse-square law. That is, the electrostatic force at a given point is inversely proportional to the square of the distance from the source of the charge (which in this case is at the origin). Given this vector field, we show that the flux across closed surface S is zero if the charge is outside of S, and that the flux is q/ε0 if the charge is inside of S. In other words, the flux across S is the charge inside the surface divided by constant ε0. This is a special case of Gauss’ law, and here we use the divergence theorem to justify this special case.

To show that the flux across S is the charge inside the surface divided by constant ε0, we need two intermediate steps. First we show that the divergence of Fr is zero and then we show that the flux of Fr across any smooth surface S is either zero or 4π. We can then justify this special case of Gauss’ law.

Example: the divergence of Fr is Zero

Verify that the divergence of Fr is zero where Fr is defined (away from the origin).

Notice that since the divergence of Fr is zero and E is Fr scaled by a constant, the divergence of electrostatic field E is also zero (except at the origin).

theorem: flux across a smooth surface

Let S be a connected, piecewise smooth closed surface and let Fr=1r2xr,yr,zr. Then,

SFdS={0if S does not encompass the origin4πif S encompasses the origin.

In other words, this theorem says that the flux of Fr across any piecewise smooth closed surface S depends only on whether the origin is inside of S.

Proof

The logic of this proof follows the logic of Example “Using Green’s Theorem on a Region with Holes”, only we use the divergence theorem rather than Green’s theorem.

First, suppose that S does not encompass the origin. In this case, the solid enclosed by S is in the domain of Fr, and since the divergence of Fr is zero, we can immediately apply the divergence theorem and find that SFdS is zero.

Now suppose that S does encompass the origin. We cannot just use the divergence theorem to calculate the flux, because the field is not defined at the origin. Let Sa be a sphere of radius a inside of S centered at the origin. The outward normal vector field on the sphere, in spherical coordinates, is

tϕ×tθ=a2cosθsin2ϕ,a2sinθsin2ϕ,a2sinϕcosϕ

(see Example “Calculating Surface Area”). Therefore, on the surface of the sphere, the dot product FrN (in spherical coordinates) is

FrN=sinϕcosθa2,sinϕsinθa2,cosϕa2a2cosθsin2ϕ,a2sinθsin2ϕ,a2sinϕcosϕ=sinϕ(sinϕcosθ,sinϕsinθ,cosϕsinϕcosθ,sinϕsinθ,cosϕ)=sinϕ.

The flux of Fr across Sa is

SaFrNdS=2π0π0sinϕdϕdθ=4π.

Now, remember that we are interested in the flux across S, not necessarily the flux across Sa. To calculate the flux across S, let E be the solid between surfaces Sa and S. Then, the boundary of E consists of Sa and S. Denote this boundary by SSa to indicate that S is oriented outward but now Sa is oriented inward. We would like to apply the divergence theorem to solid E. Notice that the divergence theorem, as stated, can’t handle a solid such as E because E has a hole. However, the divergence theorem can be extended to handle solids with holes, just as Green’s theorem can be extended to handle regions with holes. This allows us to use the divergence theorem in the following way. By the divergence theorem,

SSaFrNdS=SFrNdSSaFrNdS=Ediv FrdV=E0 dV=0.

Therefore,

SFrNdS=SaFr\cdotdS=4π,

and we have our desired result.

◼

Now we return to calculating the flux across a smooth surface in the context of electrostatic field E=q4πε0Fr of a point charge at the origin. Let S be a piecewise smooth closed surface that encompasses the origin. Then

SEdS=Sq4πε0FrdS=q4πε0SFrdS=qε0.

If S does not encompass the origin, then

SEdS=q4πε0SFrdS=0.

Therefore, we have justified the claim that we set out to justify: the flux across closed surface S is zero if the charge is outside of S, and the flux is q/ε0 if the charge is inside of S.

This analysis works only if there is a single point charge at the origin. In this case, Gauss’ law says that the flux of E across S is the total charge enclosed by S. Gauss’ law can be extended to handle multiple charged solids in space, not just a single point charge at the origin. The logic is similar to the previous analysis, but beyond the scope of this text. In full generality, Gauss’ law states that if S is a piecewise smooth closed surface and Q is the total amount of charge inside of S, then the flux of E across S is Q/ε0.

Example: using Gauss’ Law

Suppose we have four stationary point charges in space, all with a charge of 0.002 Coulombs (C). The charges are located at (0,1,1), (1,1,4), (1,0,0), and (2,2,2). Let E denote the electrostatic field generated by these point charges. If S is the sphere of radius 2 oriented outward and centered at the origin, then find SEdS.

try it

Work the previous example for surface S that is a sphere of radius 4 centered at the origin, oriented outward.