L12-IntTheorems.mws

Calculus IV with Maple
Copyright 2002, Dr. Jack Wagner
j.wagner@intelligentsearch.com

Lesson 12: The Integral Theorems of Green, Stokes and Gauss

Topics:   Orientation of volumes, surfaces and closed curves.  The classical theorems of Green, Stokes and Gauss  are presented and demonstrated.
Maple commands introduced:
animatecurve

Int(P,x)+Int(Q,y)  = Int(Int(diff(Q,x)-diff(P,y),x),y)

Int(curlX*n,A)  = Int(X,s)  

Int(divX,V)  = Int(X*n,A)  

The orientability of surfaces has previously been discussed in the context of surface integrals.  Because the integral theorems relate integrals over closed sets to integrals over their boundaries we must now be concerned with the orientation of the boundaries of closed sets relative to the sets.  

Recall that a closed curve, gamma(t) , is positively oriented if increasing values of t result in counterclockwise movement around the curve.  Alternatively, a closed curve, gamma(t) , which is the boundary of a subset, D, of   R^2 , is positively oriented if D is on the left as you move around the curve with increasing values of t.

Green's Theorem

Let D be a closed subset of R   with boundary   gamma .  Let P and Q be functions,   R x R -> R , defined and continuous on D with continuous derivatives.  Then,     Int(P,x)+Int(Q,y)  = Int(Int(diff(Q,x)-diff(P,y),x),y)  .   Alternatively, if X  is a vector field on D and n  the unit normal on gamma , we have the geometric, coordinate free formulation,     Int(X*n,s)  = Int(divX,A)  

Example 11.1

 Find the area of an ellipse of semi-major axis a and semi-minor axis b.

As in most cases of closed curves, we will use polar coordinates to define the curve gamma  that encloses the elliptic area in the plane.  Notice that this curve is positively oriented with respect to the enclosed area.

>    restart: with(LinearAlgebra):with(VectorCalculus):

Parametrization of the ellipse

>    e := <a*cos(theta), b*sin(theta)>;

e := Vector(%id = 2706308)

Now we define a carefully selected vector field.

>    X := VectorField(<x/2, y/2>, 'cartesian'[x, y]);

X := Vector(%id = 3033332)

>    Divergence(X, [x, y]);

1

Therefore, from the alternative form of Green's theorem, Int(X*n,s)  = Int(``,A)  = A

>    de := diff(e, theta);

de := Vector(%id = 2707148)

>    nds := <de[2], -de[1]>;

nds := Vector(%id = 3075980)

Now reparametrize X in polar coordinates.

>    X := evalVF(X, e);

X := Vector(%id = 3156392)

>    dA := X.nds;

dA := 1/2*a*cos(theta)^2*b+1/2*b*sin(theta)^2*a

>    int(dA, theta=0..2*Pi);

a*b*Pi

 In the same vein, setting P=-y and Q=x,   

Int(P,y)-Int(Q,x)  = Int(Int(diff(P,x)-diff(Q,y),x),y)  = 2 A

This formula is useful for working with parameterized curves, but working with curves  parameterized by trigonometric functions can be tricky.

Example 11.2

Find the area enclosed by the y axis and the curve, gamma(theta) = [cos(x)^2, sin(x)^3] ,   theta  = 0.. 2*Pi  

>    restart: with(plots): with(LinearAlgebra): with(VectorCalculus):

>    C := <cos(theta)^2, sin(theta)^3>;

C := Vector(%id = 19005432)

>    plot([C[1], C[2], theta=0..2*Pi]);

[Maple Plot]

>    X := C[1]:Y := C[2]:

>    dX := diff(C[1], theta); dY := diff(C[2], theta);

dX := -2*cos(theta)*sin(theta)

dY := 3*sin(theta)^2*cos(theta)

>    int(X*dY-Y*dX, theta=0..2*Pi);

0

         So we try the top half.

>    plot([C[1], C[2], theta=0..Pi]);

[Maple Plot]

>    int(X*dY-Y*dX, theta=0..Pi);

0

Now what is the problem?  The problem is that the curve we are looking at is really two curves superimposed on one another, each oriented oppositely.  The plots from 0 to Pi/2   and from   Pi/2  to Pi  are identical but in opposite directions.  To see this use the animatecurve function in the plots package.  This function shows the actual drawing of the curve for increasing values of the parameter.

animatecurve

Right click on the plot and select play  from the animate sub-menu.

>    animatecurve([C[1], C[2], theta=0..Pi/2], color=red);

[Maple Plot]

>    animatecurve([C[1], C[2], theta=Pi/2..Pi], color=red);

[Maple Plot]

This makes very explicit the fact that the plot from 0 to Pi   traverses the curve twice; once in each direction.  The integral over this interval is therefore 0.  With this knowledge in hand we try again.

>    int(X*dY-Y*dX, theta=0..Pi/2);

4/5

What happens when you integrate from Pi/2  to Pi  ?   The critical role of orientation is clear!

>    int(X*dY-Y*dX, theta=Pi/2..Pi);

-4/5

Stokes' Theorem

Stokes theorem   Int(curlX*n,A)  =   Int(X,s)   , is a generalization of Green's theorem to non-planar surfaces. To see this, consider the projection operator Phi  onto the x-y plane. Let tau  be the unit tangent vector to gamma(t) , the projection of the boundary of the surface.  Then, = Phi   Int(X,s)  = Int([P, Q]*tau,s)  = Int([P, Q]*diff(gamma,s),s = a .. b)  = Int([P*diff(x(t),t)+Q*diff(y(t),t)],t)  =

Int(P,x)+Int(Q,y)

         Let alpha, beta, gamma   be the angles between n  and the x, y, and z axes respectively.  Note that   dA cos(gamma)  = dxdy   and

n= [cos(alpha), cos(beta), cos(gamma)]  . Considering only the projection onto the x-y plane,

Int(curlX*n,A)  = Int(Int((diff(Q,x)-diff(P,y))*cos(gamma)/cos(gamma),x),y)  = Int(Int(diff(Q,x)-diff(P,y),x),y)

Stokes theorem is therefore the result of summing the results of Green's theorem over the projections onto each of the coordinate planes.

Example 11.3

Use Stokes' theorem to find the line integral of (x+y)^3*dx-(x-y)^3*dy+z^3*dz   around the intersection of the elliptic cylinder [3*cos(theta), 2*sin(theta), z]   and the plane x+y+2*z = 2  .  

In approaching any problem of this sort, a picture is invaluable.

>    restart: with(plots): with(LinearAlgebra):with(VectorCalculus):

>    S := <3*cos(theta), 2*sin(theta), z>;

S := Vector(%id = 17694168)

>    P1 := plot3d(S, theta=0..2*Pi, z=-6..6, color=blue, style=wireframe, grid=[40,40]):

>    P := <x, y, 1-x/2-y/2>;

P := Vector(%id = 18210324)

>    P2 := plot3d(P, x=-4..4, y=-4..4, color=pink, style=patchnogrid):

>    F := VectorField(<(x+y)^3, -(x-y)^3, z^3>, 'cartesian'[x, y, z]);

F := Vector(%id = 18210644)

>    P3 := fieldplot3d(F, x=-4..4, y=-4..4, z=-6..6, color=black, arrows=SLIM, grid=[5, 5, 5]):

>    display(P1, P2, P3, axes=framed, labels=[x, y, z]);

[Maple Plot]

To apply Stokes' theorem, we will integrate curl F  over the elliptic area cut out by the cylinder on the plane.

>    curlF := Del &x F;

curlF := Vector(%id = 2749884)

Find the unit normal to the plane.

>    dP[x] := diff(P, x);

dP[x] := Vector(%id = 15536540)

>    dP[y] := diff(P, y);

dP[y] := Vector(%id = 16075856)

>    N := dP[x] &x dP[y];

N := Vector(%id = 13797336)

Normalizing...note n is consistent with the orientation of  the x-y plane

>    n := Normalize(N, 2, inplace);

n := Vector(%id = 13797336)

The dot product (curl F) . n

>    curlFn := evalVF(curlF, <x, y, z>).n;

curlFn := 1/3*(-3*(x-y)^2-3*(x+y)^2)*6^(1/2)

Find dA for the cross section of the cylinder

>    C := <3*r*cos(theta), 2*r*sin(theta)>;

C := Vector(%id = 14446840)

>    J := Jacobian(C, [r, theta]);

J := Matrix(%id = 13790324)

How does this compare to the Jacobian for the circular transformation `<,>`(r*cos(theta),r*sin(theta)) ?

>    dA := simplify(Determinant(J));

dA := 6*r

Reparameterize curlFn .

>    curlFn := subs({x=S[1], y=S[2], z=S[3]}, curlFn);

curlFn := 1/3*(-3*(3*cos(theta)-2*sin(theta))^2-3*(3*cos(theta)+2*sin(theta))^2)*6^(1/2)

Put it all together!

>    Int(Int(curlFn*dA, r=0..1), theta=0..2*Pi);

Int(Int(2*(-3*(3*cos(theta)-2*sin(theta))^2-3*(3*cos(theta)+2*sin(theta))^2)*6^(1/2)*r,r = 0 .. 1),theta = 0 .. 2*Pi)

>    value(%);

-78*Pi*6^(1/2)

Example 11.4

Evaluate the line integral of   F = y^2*dx+x^2*dy+z^2*dz   around the curve formed by the intersection of the elliptic paraboloid, z = 2*x^2+3*y^2  , and the plane z = 3*y+5*x+2  .
It is not always necessary to reparameterize in terms of alternative parameterizations.  Sometimes Cartesian coordinates do just as nicely.

>    restart: with(plots): with(LinearAlgebra):with(VectorCalculus):

>    S := <x, y, 2*x^2+3*y^2>;

S := Vector(%id = 17998128)

>    P := <x, y, 3*y+5*x+2>;

P := Vector(%id = 18538164)

Now we need a picture of the intersection and a computation of the limits of integration.

>    P1 := plot3d(S, x=-2..4, y=-Pi..Pi, color=blue, style=wireframe):

>    P2 := plot3d(P, x=-2..4, y=-Pi..Pi, color=pink, style=patchnogrid):

>    eq := S[3]=P[3];

eq := 2*x^2+3*y^2 = 3*y+5*x+2

Intersection of Plane and Surface

>    e1 := solve(eq, y);

e1 := 1/2+1/6*(33-24*x^2+60*x)^(1/2), 1/2-1/6*(33-24*x^2+60*x)^(1/2)

>    eq1 := 33-24*x^2+60*x=0;  

eq1 := 33-24*x^2+60*x = 0

x limits of integration

>    X := fsolve(eq1, x);       

X := -.4639136501, 2.963913650

>    e2 := solve(eq, x);

e2 := 5/4+1/4*(41-24*y^2+24*y)^(1/2), 5/4-1/4*(41-24*y^2+24*y)^(1/2)

>    eq2 := 41-24*y^2+24*y;    

eq2 := 41-24*y^2+24*y

y limits of integration

>    Y := fsolve(eq2, y)

Y := -.8994046353, 1.899404635

The equation of the curve of intersection comes in two parts.

>    E1 := subs(y=e1[1], P);

E1 := Vector(%id = 13251532)

>    E2 := subs(y=e1[2], P);

E2 := Vector(%id = 4517944)

>    P3 := spacecurve({evalm(E1), evalm(E2)}, x=-2..4, color=black, thickness=3, numpoints=1000):

>    display({P1, P2, P3}, labels=[x, y, z], axes=framed, view=[-2..4, -2..4, 0..25]);

[Maple Plot]

Now we compute the integral.

>    F := VectorField(<y^2, x^2, z^2>, 'cartesian'[x, y, z]);

F := Vector(%id = 14949324)

>    curlF := Del &x F;

curlF := Vector(%id = 14459276)

>    dP[x] := diff(P, x);

dP[x] := Vector(%id = 15364208)

>    dP[y] := diff(P, y);

dP[y] := Vector(%id = 15363888)

>    N := dP[x] &x dP[y];

N := Vector(%id = 15341384)

>    n := Normalize(N, 2, inplace);

n := Vector(%id = 15341384)

This is our unit normal to the surface enclosed by the curve.

>    J := Jacobian(S, [x, y, z]);

J := Matrix(%id = 15848544)

>    J := DeleteColumn(J, [3]);

J := Matrix(%id = 14070920)

>    dA := simplify(sqrt(Determinant(Transpose(J).J)));

dA := (1+36*y^2+16*x^2)^(1/2)

>    curlFn := evalVF(curlF, <x, y, z>).n;

curlFn := 1/35*(2*x-2*y)*35^(1/2)

>    Int(Int(curlFn*dA, x=X[1]..X[2]), y=Y[1]..Y[2]);

Int(Int(1/35*(2*x-2*y)*35^(1/2)*(1+36*y^2+16*x^2)^(1/2),x = -.4639136501 .. 2.963913650),y = -.8994046353 .. 1.899404635)

>    evalf(%);

22.65615614

 If you try this with some trigonometric parameterization you will find that it is not only more complicated, but Maple will not produce a numerical answer even after a much longer processing time.

  

Divergence Theorem

Green's theorem also generalizes to volumes. Let V be a closed subset of R^3   with a boundary consisting of surfaces oriented by outward pointing normals.  Then,    Int(divX,V) = Int(X*n,S)   The idea is to slice the volume into thin slices.  On each slice, Green's theorem holds in the form, Int(X*n,s) = Int(divX,A)  .  By summing over the slices and taking limits we obtain the divergence theorem.

Example 11.5

Find the flux, through the surface of a sphere of radius R , of the vector field F=[x, y, z] .  

>    restart: with(plots): with(LinearAlgebra): with(VectorCalculus):

The sphere is parameterized with geographic coordinates.

>    V := <r*cos(phi)*cos(theta), r*cos(phi)*sin(theta), r*sin(phi)>;

V := Vector(%id = 19597808)

>    F := VectorField(<x, y, z>, 'cartesian'[x, y, z]);

F := Vector(%id = 19597848)

Here is a picture of what we are talking about.

>    S := subs(r=2, V);

S := Vector(%id = 19597928)

>    P1 := fieldplot3d(F, x=-2..2, y=0..2, z=0..2, color=red, grid=[4, 4, 4], arrows=SLIM):

>    P2 := plot3d(S, theta=0..Pi, phi=0..Pi/2, color=blue, style=wireframe):

>    display(P1, P2, scaling=constrained, axes=framed);

[Maple Plot]

>    J := Jacobian(V, [r, phi, theta]);

J := Matrix(%id = 19621400)

>    dV := simplify(sqrt(Determinant(Transpose(J).J))) assuming real;

dV := r^2*abs(cos(phi))

>    divF := Divergence(F, [x, y, z]);

divF := 3

Integrate over the positive quadrant.

>    Int(Int(Int(divF*dV, r=0..R), phi=0..Pi/2), theta=0..Pi);

Int(Int(Int(3*r^2*abs(cos(phi)),r = 0 .. R),phi = 0 .. 1/2*Pi),theta = 0 .. Pi)

>    simplify(4*value(%), symbolic);

4*R^3*Pi

Practice

1. Given the ellipsoid,   98*x^2+4*y^2+36*z^2 = 36  , find the flux through the surface of the vector fields defined by:

     a)     [x/sqrt(x^2+y^2+z^2), y/sqrt(x^2+y^2+z^2), z/sqrt(x^2+y^2+z^2)]

     b)    [x^2/sqrt(x^2+y^2+z^2), y^2/sqrt(x^2+y^2+z^2), z^2/sqrt(x^2+y^2+z^2)]   

2. Integrate 3*x*y^3*dx+4*y^2*x*dy   counterclockwise around the square formed by the lines,  y=1, y=3, x=1, x=3.

3. Consider the curve formed by the intersection of the surface z = ln(x+y)   and the cylinder of radius 1 centered at the point (2, 2). Find the integral of    5*x*y^2*dx+3*x*y^2*dy  around this curve.

5. Integrate x*dx-z^2*dy+y^2*dz   around the curve formed by the intersection of
the cylinder of radius 2 whose long axis is the x axis, and the surface,
z+4 = 2*x^2  , 0 <= x  .