__Answers to Test 3__

This sheet provides the answers to Problems 5 and 6 in Test 3. This illustrates some of the vector calculus tools that Maple includes in its linear algebra package. If also underscores the importance of problem formulation, since most of the integrals are duck soup for Maple.

**Problem 5**

Let be the boundary of the ellipse , and consider the vector field .

Calculate the work encountered in moving around the ellipse with this field by eva,luating the contour integral where parameterizes the ellipse.

Then apply Green's Theorem to obtain an area integral over the interior of the ellipse, and evaluate this area integral.

`> `
**restart; with(linalg):**

Warning, new definition for norm

Warning, new definition for trace

`> `
**F := [x-y,x+y];**

**Work from the contour integral**

Since the ellipse is defined by , we can parameterize it with

`> `
**R := [cos(t),(1/2)*sin(t)];**

Thus we get

`> `
**FdotR := dotprod(F,diff(R,t),orthogonal);**

Then by substituting the parameterization into we get the integrand

`> `
**integrand := subs(x=cos(t), y=(1/2)*sin(t), FdotR);**

and the Work is given by

`> `
**Work := Int(integrand,t=0..2*Pi);**

`> `
**Work :=int(integrand,t=0..2*Pi);**

**Work from the area integral**

By Green's Theorem, if , then where the first integral is over a simple closed curve in a domain where and and their partials are continuous, and where the second integral is an area integral over the region bounded by the curve. But in this case we have which is just

`> `
**(diff((x+y),x)-diff((x-y),y));**

Thus the work is also given by which is just 2 times the area of the ellipse, or

`> `
**Work := 4*int(int((diff((x+y),x)-diff((x-y),y)),y=0..(sqrt(1-x^2)/2)),x=0..1);**

**Problem 6**

Let be the surface of the cylinder defined by and and .

Find the flux of the vector field across this surface.

Apply Gauss's theorem to obtain a volume integral in terms of teh divergence of and evaluate this integral.

`> `
**F := [x*y^2, y*z^2, z*x^2];**

**Flux from the surface integral**

The critical step is to parameterize the surface of the cylinder and to determine the normals to the surface.

The normal for the top surface is simply and we can use the parameterizations , , and .

Thus we have the integrand

`> `
**FdotN1 := dotprod(F,[0,0,1]);**

`> `
**integrand := subs(x=r*cos(theta),y=r*sin(theta),z=5,FdotN1);**

`> `
**Flux[1] := Int(Int(integrand*r,r=0..2),theta=0..2*Pi);**

`> `
**Flux[1] := int(int(integrand*r,r=0..2),theta=0..2*Pi);**

The normal for the bottom surface is simply and we can use the parameterizations , , and .

But since , the integrand will be identically zero. Thus this term does not contribute.

The normal for the sides is simply and we can use the parameterizations , , and .

Thus we have the integrand

`> `
**FdotN3 := dotprod(F,[x/2,y/2,0],orthogonal);**

`> `
**integrand := subs(x=2*cos(theta),y=2*sin(theta),z=zeta,FdotN3);**

`> `
**Flux[3] := Int(Int(integrand,zeta=0..5)*2,theta=0..2*Pi);**

`> `
**Flux[3] := int(int(integrand,zeta=0..5)*2,theta=0..2*Pi);**

Thus the total flux across the surface is

`> `
**Flux := Flux[1] + 0 + Flux[3];**

**Flux from the volume integral**

By Gauss's Theorem, if ,is a vector field and is the outward pointing unit normal, then

where the first integral is over a piecewise smooth surface and the second integral the is over the interior bounded by the surface.

`> `
**divF := diverge(F,[x,y,z]);**

The integral is most naturally evaluated in terms of cylindrical coordinates: , , and .

`> `
**integrand := subs(x=r*cos(theta),y=r*sin(theta),z=zeta,divF);**

`> `
**Flux := Int(Int(Int(integrand*r,theta=0..2*Pi),r=0..2),zeta=0..5);**

`> `
**Flux := int(int(int(integrand*r,theta=0..2*Pi),r=0..2),zeta=0..5);**