MapleVolFill.mws

Volume

of a region in space

This worksheet investigates the volume of the region of space under the graph of   f(x,y) = 9-x^2-y^2

and above the graph of z = 0 with x between -2.5 and 2.5 and y between -0.5 and 1.5.

Here is a picture of the region of space (or solid) whose volume we are going to approximate.

>    with(plots):plot3d(9-x^2-y^2,x=-2.5..2.5,y=-0.5..1.5,view=0..10,axes=boxed,orientation=[100,60],filled=true);

[Maple Plot]

>   

Here we are drawing the top surface over the region of the xy-coordinate plane described above and filling it in with 10 boxes.

>    part1:=plot3d(4,x=1.5..2.5,y=0.5..1.5,axes=boxed,orientation=[100,60],filled=true):

>    part2:=plot3d(7,x=0.5..1.5,y=0.5..1.5,axes=boxed,orientation=[100,60],filled=true):

>    part3:=plot3d(8,x=-0.5..0.5,y=0.5..1.5,axes=boxed,orientation=[100,60],filled=true):

>    part4:=plot3d(7,x=-1.5..-0.5,y=0.5..1.5,axes=boxed,orientation=[100,60],filled=true):

>    part5:=plot3d(4,x=-2.5..-1.5,y=0.5..1.5,axes=boxed,orientation=[100,60],filled=true):

>    part6:=plot3d(5,x=1.5..2.5,y=-0.5..0.5,axes=boxed,orientation=[100,60],filled=true):

>    part7:=plot3d(8,x=0.5..1.5,y=-0.5..0.5,axes=boxed,orientation=[100,60],filled=true):

>    part8:=plot3d(9,x=-0.5..0.5,y=-0.5..0.5,axes=boxed,orientation=[100,60],filled=true):

>    part9:=plot3d(8,x=-1.5..-0.5,y=-0.5..0.5,axes=boxed,orientation=[100,60],filled=true):

>    part10:=plot3d(5,x=-2.5..-1.5,y=-0.5..0.5,axes=boxed,orientation=[100,60],filled=true):

>    surface:=plot3d(9-y^2-x^2,x=-2.5..2.5,y=-0.5..1.5,view=0..10,axes=boxed,orientation=[100,60]):

>    display(part1,part2,part3,part4,part5,part6,part7,part8,part9,part10,surface);

[Maple Plot]

Here is the code for generating all the pictures in the animation.  I kept adding more elements to the "display" command at the bottom to generate each successive picture in the animated giff and then I used the mouse to change the viewing angle to generate more pictures to use in the animation.

>    B1:=spacecurve([2.5,-0.5+t,0,t=0..2],color=blue,thickness=3):

>    B2:=spacecurve([1.5,-0.5+t,0,t=0..2],color=blue,thickness=3):

>    B3:=spacecurve([0.5,-0.5+t,0,t=0..2],color=blue,thickness=3):

>    B4:=spacecurve([-0.5,-0.5+t,0,t=0..2],color=blue,thickness=3):

>    B5:=spacecurve([-1.5,-0.5+t,0,t=0..2],color=blue,thickness=3):

>    B6:=spacecurve([-2.5,-0.5+t,0,t=0..2],color=blue,thickness=3):

>    B7:=spacecurve([-2.5+t,-0.5,0,t=0..5],color=blue,thickness=3):

>    B8:=spacecurve([-2.5+t,0.5,0,t=0..5],color=blue,thickness=3):

>    B9:=spacecurve([-2.5+t,1.5,0,t=0..5],color=blue,thickness=3):

>    H6:=spacecurve([2,1,t,t=0..4],color=red,thickness=3):

>    H7:=spacecurve([1,1,t,t=0..7],color=red,thickness=3):

>    H8:=spacecurve([0,1,t,t=0..8],color=red,thickness=3):

>    H9:=spacecurve([-1,1,t,t=0..7],color=red,thickness=3):

>    H10:=spacecurve([-2,1,t,t=0..4],color=red,thickness=3):

>    H11:=spacecurve([2,0,t,t=0..5],color=red,thickness=3):

>    H12:=spacecurve([1,0,t,t=0..8],color=red,thickness=3):

>    H13:=spacecurve([0,0,t,t=0..9],color=red,thickness=3):

>    H14:=spacecurve([-1,0,t,t=0..8],color=red,thickness=3):

>    H15:=spacecurve([-2,0,t,t=0..5],color=red,thickness=3):

>    surface:=plot3d(9-y^2-x^2,x=-2.5..2.5,y=-0.5..1.5,view=0..10,axes=boxed,orientation=[-100,70]):

>    part1:=plot3d(4,x=1.5..2.5,y=0.5..1.5,axes=boxed,orientation=[-100,70],filled=true):

>    part2:=plot3d(7,x=0.5..1.5,y=0.5..1.5,axes=boxed,orientation=[-100,70],filled=true):

>    part3:=plot3d(8,x=-0.5..0.5,y=0.5..1.5,axes=boxed,orientation=[-100,70],filled=true):

>    part4:=plot3d(7,x=-1.5..-0.5,y=0.5..1.5,axes=boxed,orientation=[-100,70],filled=true):

>    part5:=plot3d(4,x=-2.5..-1.5,y=0.5..1.5,axes=boxed,orientation=[-100,70],filled=true):

>    part6:=plot3d(5,x=1.5..2.5,y=-0.5..0.5,axes=boxed,orientation=[-100,70],filled=true):

>    part7:=plot3d(8,x=0.5..1.5,y=-0.5..0.5,axes=boxed,orientation=[-100,70],filled=true):

>    part8:=plot3d(9,x=-0.5..0.5,y=-0.5..0.5,axes=boxed,orientation=[-100,70],filled=true):

>    part9:=plot3d(8,x=-1.5..-0.5,y=-0.5..0.5,axes=boxed,orientation=[-100,70],filled=true):

>    part10:=plot3d(5,x=-2.5..-1.5,y=-0.5..0.5,axes=boxed,orientation=[-100,70],filled=true):

>    display(B1,B2,B3,B4,B5,B6,B7,B8,B9,surface);

[Maple Plot]

>    display(B1,B2,B3,B4,B5,B6,B7,B8,B9,H6,H7,H8,H9,H10,H11,H12,H13,H14,H15,surface,part1,part2,part3,part4,part5,part6,part7,part8,part9,part10);

[Maple Plot]

Computing the volume of the region using an iterated double integral

>    int(int(9-x^2-y^2,y=-1/2..3/2),x=-5/2..5/2);

190/3

Approximating the volume of the region from 10 approximating rectangular boxes (see picture above)

In this case the area of the base of each approximating box is one.

>    Yvals:=-1:

>    Volume:=0:

>    for i from 1 to 2 do
  Yvals:=Yvals+1;
  Xvals:=-3;
  for j from 1 to 5 do
    Xvals:=Xvals+1;
    Volume:=Volume+9-Xvals^2-Yvals^2;
  end do:
end do:

>    Volume;

65

Approximating the volume of the region from 40 approximating rectangular boxes

In this case the area of the base of each approximating box is 1/4.

>    Yvals:=-0.75:

>    Volume:=0:

>    for i from 1 to 4 do
  Yvals:=Yvals+0.5;
  Xvals:=-2.75;
  for j from 1 to 10 do
    Xvals:=Xvals+0.5;
    Volume:=Volume+(9-Xvals^2-Yvals^2)/4;
  end do:
end do:

>    Volume;

63.75000000

Approximating the volume of the region from 160 approximating rectangular boxes

In this case the area of the base of each approximating box is 1/16.

>    Yvals:=-0.625:

>    Volume:=0:

>    for i from 1 to 8 do
  Yvals:=Yvals+0.25;
  Xvals:=-2.625;
  for j from 1 to 20 do
    Xvals:=Xvals+0.25;
    Volume:=Volume+(9-Xvals^2-Yvals^2)/16;
  end do:
end do:

>    Volume;

63.43750070

Approximating the volume of the region from 640 approximating rectangular boxes

In this case the area of the base of each approximating box is 1/64.

>    Yvals:=-0.5625:

>    Volume:=0:

>    for i from 1 to 16 do
  Yvals:=Yvals+0.125;
  Xvals:=-2.5625;
  for j from 1 to 40 do
    Xvals:=Xvals+0.125;
    Volume:=Volume+(9-Xvals^2-Yvals^2)/64;
  end do:
end do:

>    Volume;

63.35937429

>