MapleVolFill3.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 -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(2+(sin((1+x*y)/3)),x=-2.5..2.5,y=-0.5..1.5,view=0..3,axes=boxed,orientation=[100,60],filled=true);

Warning, the name changecoords has been redefined

[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(2+sin(1),x=1.5..2.5,y=0.5..1.5,axes=boxed,orientation=[100,60],filled=true):

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

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

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

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

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

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

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

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

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

>    surface:=plot3d(2+sin((1+x*y)/3),x=-2.5..2.5,y=-0.5..1.5,view=0..3,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 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,-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..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):

>    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(2+sin((1+x*y)/3),x=-2.5..2.5),y=-0.5..1.5);

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

>    evalf(%);

23.06080530

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+2+sin((1.0+Xvals*Yvals)/3);
  end do:
end do:

>    Volume;

23.09581427

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+(2+sin((1.0+Xvals*Yvals)/3))/4;
  end do:
end do:

>    Volume;

23.06965087

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+(2+sin((1.0+Xvals*Yvals)/3))/16;
  end do:
end do:

>    Volume;

23.06302205

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+(2+sin((1.0+Xvals*Yvals)/3))/64;
  end do:
end do:

>    Volume;

23.06135979

>