The purpose of this lab is to acquaint you with using Maple to do double integrals and to help you visualize a certain class of solids, whose volumes can be computed via double integrals.
Suppose that D is a rectangular region in the the x-y plane, and
that
is a continuous, non-negative function on D. Then the
volume of the solid above D and below
is given by the
double integral

We learned in class that such integrals can be evaluated by either of the iterated integrals

or

where the rectangle D is defined by the inequalities
and
.
Using Maple to evaluate double integrals proceeds in exactly the same fashion. For example, the following Maple session shows the computation of

for both orders of integration.
> int(int(x^2+y^2,x=-2..1),y=0..1);

> int(int(x^2+y^2,y=0..1),x=-2..1);

More complicated integrals are handled similarly. Suppose that we have
and we want to know the volume of the solid
between the region in the x-y plane bounded by the circle
and the graph of
. Then an appropriate
integral is

Using Maple, we calculate this as
> int(int(x^2+y^2,y=-sqrt(1-(x-1)^2)..sqrt(1-(x-1)^2)),x=0..2);

Maple can also help you visualize the solids of which you are
computing volumes. Here we go through several Maple commands related
to the solid of the last example. In the sample Maple session shown
below, the first
step, after loading the plots package, is to plot the region in
the x-y plane. Note that Maple can plot a function
over
a region in the plane defined by an x-interval,
and two functions
and
with a command of the
following form,
> plot3d(h(x,y),x=a..b,y=f(x)..g(x);
assuming that
forms the lower boundary of the region. Read
the help for plot3d for more details. Note the the x range,
x=a..b, must come first. Note also that we can plot
regions in the x-y plane with a similar command simply by using
.
The next two commands in the Maple session show
cross-sections of the solid for x=1 and
, and the last set of
three commands generates a plot of the lateral boundary of the solid
and plots of the top and bottom of the solid, and displays the three plots with
the display3d command.
> with(plots):
> plot3d(0,x=0..2,y=-sqrt(1-(x-1)^2)..sqrt(1-(x-1)^2));
> f := (x,y) -> x^2+y^2 ;

> plot3d([1,t,s*f(1,t)],t=-1..1,s=0..1,labels=[x,y,z]);
> p1 := plot3d([1+cos(t),sin(t),s*f(1+cos(t),sin(t))],t=0..2*Pi,s=0..1):
> p2 := plot3d(0,f(x,y),x=0..2,y=-sqrt(1-(x-1)^2)..sqrt(1-(x-1)^2)):
> display3d(p1,p2);
The display3d command may not be familiar to you, but it provides an easy way to display multiple three dimensional plots at the same time. Note especially that the commands defining p1 and p2 end in colons, (:). This is so the output of the plot3d commands doesn't clutter up your worksheet.
To help you understand where these Maple commands came from, first
consider the cross-section for
. For this value of x, we get
from the equation
the two roots
and
. So now we have the parametric description
, of the line joining these two
roots. Suppose
is a point on this line. The solid contains
a vertical line segment above this point until we run into
. We parametrize this vertical line segment by s, so
that when s=0 we are at the point
and when s=1 we are
at
.
To generate the lateral surface of the solid, we do the same sort of
thing for all the points on the boundary of the region. That is, if
the boundary of the region is described by a parametric curve
,
, then the lateral surface can be
plotted with a command of the following form.
> plot3d([x(t),y(t),s*f(x(t),y(t))],t=a..b,s=0..1);Defining
and
in your Maple session might be a good idea, since it will save some typing.
Plotting the top of the solid is a little easier. Suppose that the region is such that the volume can be computed with a one double integral, with x being the outer variable of integration. This means that the boundary can be decomposed into two curves
and
with
, where ``u'' and ``l'' stand for upper and lower. For example, for our region bounded by the circle
, the two curves are
and
, with
. Then the top of our solid is generated by a Maple command of the form
> plot3d(f(x,y),x=0..2,y=-sqrt(1-(x-1)^2)..sqrt(1-(x-1)^2));



and the function
.
and
and the function
.
and
. Also, generate a
three-dimensional plot of the surface of the solid.