MapleVolFill4.mws

Volume

of a region in space

This worksheet investigates the volume of the region of space under the graph of f(x,y) = 2+sin((1+x*y)/3)

and above the graph of z = 0 with x between -2.5 and 2.5 and y between -1.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(2+(sin((1+x*y)/3)),x=-2.5..2.5,y=-1.5..1.5,view=0..3,axes=boxed,orientation=[-120,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 15 boxes.

>    part11:=plot3d(2+sin(-1/3),x=1.5..2.5,y=-1.5..-0.5,axes=boxed,orientation=[-130,60],filled=true):

>    part12:=plot3d(2+sin(0),x=0.5..1.5,y=-1.5..-0.5,axes=boxed,orientation=[-130,60],filled=true):

>    part13:=plot3d(2+sin(1/3),x=-0.5..0.5,y=-1.5..-0.5,axes=boxed,orientation=[-130,60],filled=true):

>    part14:=plot3d(2+sin(2/3),x=-1.5..-0.5,y=-1.5..-0.5,axes=boxed,orientation=[-130,60],filled=true):

>    part15:=plot3d(2+sin(1),x=-2.5..-1.5,y=-1.5..-0.5,axes=boxed,orientation=[-130,60],filled=true):

>    part1:=plot3d(2+sin(1),x=1.5..2.5,y=0.5..1.5,axes=boxed,orientation=[-130,60],filled=true):

>    part2:=plot3d(2+sin(2/3),x=0.5..1.5,y=0.5..1.5,axes=boxed,orientation=[-130,60],filled=true):

>    part3:=plot3d(2+sin(1/3),x=-0.5..0.5,y=0.5..1.5,axes=boxed,orientation=[-130,60],filled=true):

>    part4:=plot3d(2+sin(0),x=-1.5..-0.5,y=0.5..1.5,axes=boxed,orientation=[-130,60],filled=true):

>    part5:=plot3d(2+sin(-1/3),x=-2.5..-1.5,y=0.5..1.5,axes=boxed,orientation=[-130,60],filled=true):

>    part6:=plot3d(2+sin(1/3),x=1.5..2.5,y=-0.5..0.5,axes=boxed,orientation=[-130,60],filled=true):

>    part7:=plot3d(2+sin(1/3),x=0.5..1.5,y=-0.5..0.5,axes=boxed,orientation=[-130,60],filled=true):

>    part8:=plot3d(2+sin(1/3),x=-0.5..0.5,y=-0.5..0.5,axes=boxed,orientation=[-130,60],filled=true):

>    part9:=plot3d(2+sin(1/3),x=-1.5..-0.5,y=-0.5..0.5,axes=boxed,orientation=[-130,60],filled=true):

>    part10:=plot3d(2+sin(1/3),x=-2.5..-1.5,y=-0.5..0.5,axes=boxed,orientation=[-130,60],filled=true):

>    surface:=plot3d(2+sin((1+x*y)/3),x=-2.5..2.5,y=-1.5..1.5,view=0..3,axes=boxed,orientation=[-130,60]):

>    display(part1,part2,part3,part4,part5,part6,part7,part8,part9,part10,part11,part12,part13,part14,part15,surface);

[Maple Plot]

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

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

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

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

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

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

>    B6:=spacecurve([-2.5,-1.5+t,0,t=0..3],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):

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

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

>    H7:=spacecurve([1,1,t,t=0..2+sin((1+1)/3)],color=red,thickness=3):

>    H8:=spacecurve([0,1,t,t=0..2+sin((1+0)/3)],color=red,thickness=3):

>    H9:=spacecurve([-1,1,t,t=0..2+sin((1-1)/3)],color=red,thickness=3):

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

>    H11:=spacecurve([2,0,t,t=0..2+sin((1+0)/3)],color=red,thickness=3):

>    H12:=spacecurve([1,0,t,t=0..2+sin((1+0)/3)],color=red,thickness=3):

>    H13:=spacecurve([0,0,t,t=0..2+sin((1+0)/3)],color=red,thickness=3):

>    H14:=spacecurve([-1,0,t,t=0..2+sin((1+0)/3)],color=red,thickness=3):

>    H15:=spacecurve([-2,0,t,t=0..2+sin((1+0)/3)],color=red,thickness=3):

>    H1:=spacecurve([2,-1,t,t=0..2+sin((1-2)/3)],color=red,thickness=3):

>    H2:=spacecurve([1,-1,t,t=0..2+sin((1-1)/3)],color=red,thickness=3):

>    H3:=spacecurve([0,-1,t,t=0..2+sin((1-0)/3)],color=red,thickness=3):

>    H4:=spacecurve([-1,-1,t,t=0..2+sin((1+1)/3)],color=red,thickness=3):

>    H5:=spacecurve([-2,-1,t,t=0..2+sin((1+2)/3)],color=red,thickness=3):

Below  we see just the top surface and the partition of the xy-coordinate plane.

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

[Maple Plot]

Below we see added red line segments representing the height of each approximating rectangular box.

>    display(B1,B2,B3,B4,B5,B6,B7,B8,B9,B10,H1,H2,H3,H4,H5,H6,H7,H8,H9,H10,H11,H12,H13,H14,H15,surface);

[Maple Plot]

Below we see the final picture with all the approximating rectangular boxes drawn in.

>    display(B1,B2,B3,B4,B5,B6,B7,B8,B9,B10,H1,H2,H3,H4,H5,H6,H7,H8,H9,H10,H11,H12,H13,H14,H15,surface,part1,part2,part3,part4,part5,part6,part7,part8,part9,part10,part11,part12,part13,part14,part15);

[Maple Plot]

Here we are computing the volume of the region using an iterated double integral.

>    Int(Int(2+sin((1+x*y)/3),x=-2.5..2.5),y=-1.5..1.5);

Int(Int(2+sin(1/3+1/3*x*y),x = -2.5 .. 2.5),y = -1.5 .. 1.5)

>    evalf(%);

34.50133425

Here we are approximating the volume of the region from 15 approximating rectangular boxes (see picture above).

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

>    Yvals:=-2:

>    Volume:=0:

>    for i from 1 to 3 do
  Yvals:=Yvals+1;
  Xvals:=-3;
  for j from 1 to 5 do
    Xvals:=Xvals+1;
    Volume:=Volume+2+sin((1.0+Xvals*Yvals)/3);
  end do:
end do:

>    Volume;

34.55565506

Here we are approximating the volume of the region from 60 approximating rectangular boxes.

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

>    Yvals:=-1.75:

>    Volume:=0:

>    for i from 1 to 6 do
  Yvals:=Yvals+0.5;
  Xvals:=-2.75;
  for j from 1 to 10 do
    Xvals:=Xvals+0.5;
    Volume:=Volume+(2+sin((1.0+Xvals*Yvals)/3))/4;
  end do:
end do:

>    Volume;

34.51501938

Here we are approximating the volume of the region from 240 approximating rectangular boxes.

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

>    Yvals:=-1.625:

>    Volume:=0:

>    for i from 1 to 12 do
  Yvals:=Yvals+0.25;
  Xvals:=-2.625;
  for j from 1 to 20 do
    Xvals:=Xvals+0.25;
    Volume:=Volume+(2+sin((1.0+Xvals*Yvals)/3))/16;
  end do:
end do:

>    Volume;

34.50476137

Here we are approximating the volume of the region from 960 approximating rectangular boxes.

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

>    Yvals:=-1.5625:

>    Volume:=0:

>    for i from 1 to 24 do
  Yvals:=Yvals+0.125;
  Xvals:=-2.5625;
  for j from 1 to 40 do
    Xvals:=Xvals+0.125;
    Volume:=Volume+(2+sin((1.0+Xvals*Yvals)/3))/64;
  end do:
end do:

>    Volume;

34.50219108

>