The Divergence Theorem

Let S be a solid with boundary surface delta*S  that is embedded in a vector field F ( x,y,z ).   

[Maple Plot]

(commands used to produce figure above)

Then the Divergence Theorem  implies that

[Maple OLE 2.0 Object]

A proof of the Divergence Theorem is included in the text.  Let's use Maple to verify the Divergence theorem for a couple of different examples.

In this first example, let's consider the unit sphere inserted into a vector field  F ( x,y,z ) = <. y, -x, 1 -z  >. (which is converted to spherical coordinates as F_spherical)

>    SetCoordinates(cartesian[x,y,z]):
F:=VectorField(<y,-x,2*z>);
SetCoordinates(spherical[rho,phi,theta]):
F_spherical:=MapToBasis(F,spherical[rho,phi,theta]);
S_boundary:=<1,phi,theta>,phi=0..Pi,theta=0..2*Pi;

>   

Before we explore the divergence theorem, let's graph the sphere inside the vector field:

>    p1:=fieldplot3d(F,x=-1.1..1.1,y=-1.1..1.1,z=-1.1..1.1,color=red,arrows=THICK,grid=[7,7,7]):
p2:=plot3d(S_boundary,color=cyan,coords=spherical):
display(p1,p2,scaling=constrained);

>   

Let's calculate the flux of the curl using the Flux  command.  

>    Flux_F1:=Flux(F_spherical,Surface(S_boundary),'inert');
Flux_F1:=value(%);

>   

Next, let's evaluate the flux using the divergence theorem:  should be the same in both cases. That is, we should have Work = Flux_Curl .  

>    div_F:=Divergence(F);
Flux_F2:=int(div_F,[rho,phi,theta]=Sphere( <0,0,0>, 1 ),'inert');
Flux_F2:=value(%);

>   

The results should be the same in both cases.

The Divergence theorem is a quite useful theorem.  For example, if F ( x,y,z ) = < ax,by,cz >, then div ( F ) = a+b+c, so that the divergence theorem implies that

[Maple OLE 2.0 Object]

for a sufficiently nice solid S .  Thus, the volume of the solid is given by Flux / ( a+b+c ):

[Maple OLE 2.0 Object]

Let's look at an example.  Let's consider the surface

r ( u, v ) = < a  cos( v ) cos( u ),  a  cos( v ) sin( u ),   b  sin( v ) >

where u  is in [0,2 Pi ] and v  is in [ -Pi /2, Pi /2].  First, let's show that it parameterizes an ellipsoid.  

>    SetCoordinates(cartesian[x,y,z]):
r:=<a*cos(v)*cos(u),a*cos(v)*sin(u),b*sin(v)>;
eliminate({x=r[1],y=r[2],z=r[3]},u);
eliminate(%[2],v);
expand(%[2][1]/a^2/b^2)+1=1;

>   

The result is the equation of an ellipsoid.  Let's look at the solid when a= 1 and b =2.  

>    plot3d(subs(a=1,b=2,r),u=0..2*Pi,v=-Pi/2..Pi/2,scaling=constrained);

>   

Now let's use the divergence theorem to find the volume of the ellipsiod. To do so, let's use the vector field F ( x,y,z ) = <0,0, z > since it has a divergence of 1.

>    FF:=VectorField(<0,0,z>):
Flux_F:=Flux(FF,Surface(r,u=0..2*Pi,v=-Pi/2..Pi/2),'inert');
Volume_of_ellipsoid:=value(Flux_F);

>