Visualizing Regions of Triple IntegrationMike May, S.J. \302\2512006 - maymk@slu.eduLUklbXJvd0c2Iy9JK21vZHVsZW5hbWVHNiJJLFR5cGVzZXR0aW5nR0koX3N5c2xpYkdGJzYjLUkjbWlHRiQ2JVEhRicvJSdpdGFsaWNHUSV0cnVlRicvJSxtYXRodmFyaWFudEdRJ2l0YWxpY0YnIn class the other day we looked at changing the order of integration on a triple integral. The problem did not work out cleanly, this is a second attempt at giving a clean explanation.We start with the technical line to load commands.with(plots):Visualizing the region of integrationTo set up visualizing a triple integral we need the order of integration and the 6 limits of integration.intorder := [z,x,y];
firsthi:= 3+x^2+2*y^2:
firstlo:= x+y:
secondhi := 2+y:
secondlo := -2-y:
thirdhi:= 5:
thirdlo:= -1:Notice that the limits for each integration are functions in the remaining variables. That means the inside limits can use the outside variables while the outside limits are constants.We then use the Int command to make sure we are asking for the integral we think we are integrating for.Int(Int(Int(f,intorder[1]=firstlo..firsthi),
intorder[2]=secondlo..secondhi), intorder[3]=thirdlo..thirdhi);Next I want some technical commands that let me parameterize the surfaces of the region of integration. (Parameterized surfaces is a topic for later in the course, so you are not expected to do this on your own. If you are interested, third0 is a particular value of the third variable of integration, while second0 is a particular value of the second variable of integration. In all cases I am parameterizing low to high for a variable of integration as going from 0 to 1.)third0 := s -> s*thirdhi+(1-s)*thirdlo:
second0 := (s,t) -> t*eval(secondhi,intorder[3]=third0(s))+
(1-t)*eval(secondlo,intorder[3]=third0(s)):
firsttop := (s,t) -> eval(firsthi,
{intorder[2]=second0(s,t), intorder[3]=third0(s)}):
firstbottom := (s,t) -> eval(firstlo,
{intorder[2]=second0(s,t), intorder[3]=third0(s)}):I also want a technical function for labels of my axes based on integration order.maplabels := x -> [convert(x[3],string),convert(x[2],string),
convert(x[1],string)]:
maplabels(intorder);
Now I am ready to plot the region of integration. I need 6 parameterized surfaces for the top and bottom, left and right, and front and back of the region.plot3d([
[third0(s), second0(s,t),firstbottom(s,t)],
[third0(s), second0(s,t),firsttop(s,t)],
[third0(s), second0(s,1),t*firsttop(s,1)+(1-t)*firstbottom(s,1)],
[third0(s), second0(s,0),t*firsttop(s,0)+(1-t)*firstbottom(s,0)],
[third0(0), second0(0,s),t*firsttop(0,s)+(1-t)*firstbottom(0,s)],
[third0(1), second0(1,s),t*firsttop(1,s)+(1-t)*firstbottom(1,s)]
],
s=0..1, t=0..1, axes=normal, style=patchcontour,
color=[red,yellow, green, blue, pink, orange],
labels=maplabels(intorder));Rotating the region, we can see that all 6 surfaces show up. Rotating the graph to look down each axis in turn, we have a single front and back surface in the z direction (our original order) and in the x direction. To look cleanly down one axis, front and back, I check orientations [0,0] and [0,180] in the first direction, [0,90] and [180,90] in the second direction, and [90,90] and [-90,90] in the third direction. If I have a "good" first direction, I only see front in one direction and only see back in the other direction. I also don't cut out anything between the front and back.For our example, orientation [0,180] shows only red with y and x visible. Orientation [0,0] shows only yellow. That means that if we integrate with respect to z first we have a single top and bottom. Looking at the red surface we see that we want to integrate with respect to x next to have a single left and right. That means y would be the third variable. Thus our chosen order works well.Orientation [180, 90] looks down the x axis and gives lots of colors. Thus y is not a good first variable for integration.Orientation [90,90] shows two colors. Thus y is not a good first variable for integration.This region only has one nice order of integration.Automating the visualization processWe want to create two functions so we can check visualizations.IntCheck := (intorder, firsthi, firstlo, secondhi, secondlo, thirdhi,thirdlo)
-> Int(Int(Int(f,intorder[1]=firstlo..firsthi),
intorder[2]=secondlo..secondhi), intorder[3]=thirdlo..thirdhi):IntVisual := proc(intorder, firsthi, firstlo,
secondhi, secondlo, thirdhi,thirdlo)
local third0, second0, firsttop, firstbottom, maplabels:
third0 := s -> s*thirdhi+(1-s)*thirdlo;
second0 := (s,t) -> t*eval(secondhi,intorder[3]=third0(s))+
(1-t)*eval(secondlo,intorder[3]=third0(s));
firsttop := (s,t) -> eval(firsthi,
{intorder[2]=second0(s,t), intorder[3]=third0(s)});
firstbottom := (s,t) -> eval(firstlo,
{intorder[2]=second0(s,t), intorder[3]=third0(s)}):
maplabels := x -> [convert(x[3],string),convert(x[2],string),
convert(x[1],string)]:
maplabels(intorder);
plot3d([
[third0(s), second0(s,t),firstbottom(s,t)],
[third0(s), second0(s,t),firsttop(s,t)],
[third0(s), second0(s,1),t*firsttop(s,1)+(1-t)*firstbottom(s,1)],
[third0(s), second0(s,0),t*firsttop(s,0)+(1-t)*firstbottom(s,0)],
[third0(0), second0(0,s),t*firsttop(0,s)+(1-t)*firstbottom(0,s)],
[third0(1), second0(1,s),t*firsttop(1,s)+(1-t)*firstbottom(1,s)]
],
s=0..1, t=0..1, axes=normal, style=patchcontour,
color=[red,yellow, green, blue, pink, orange],
labels=maplabels(intorder));
end proc:Now we can simply define the problem, then check the integral, and check the visualization.intorder := [z,x,y]:
firsthi:= 3+x^2+2*y^2:
firstlo:= x+y:
secondhi := 2+y:
secondlo := -2-y:
thirdhi:= 5:
thirdlo:= -1:IntCheck(intorder, firsthi, firstlo, secondhi, secondlo, thirdhi,thirdlo);IntVisual(intorder, firsthi, firstlo, secondhi, secondlo, thirdhi,thirdlo);Changing the order of integrationWe are now ready for the problem we looked at in class:intorder := [z,y,x]:
firsthi:= 6-x-2*y:
firstlo:= 0:
secondhi := 3-x/2:
secondlo := 0:
thirdhi:= 6:
thirdlo:= 0:IntCheck(intorder, firsthi, firstlo, secondhi, secondlo, thirdhi,thirdlo);IntVisual(intorder, firsthi, firstlo, secondhi, secondlo, thirdhi,thirdlo);This is a 4 sided region with edges x=0, y=0, z=0, and z=6-x-2y. In this case we can integrate in any order.Since we did [z,y,x], lets try [y,x,z].To integrate with respect to y first, we have top z=6-x-2y and bottom y=0. Solve for y.intorder := [y,x,z]:
firsthi:= 3-x/2-z/2:
firstlo:= 0:We pick orientation [-90,90] to look down the y axis.The edges of the triangle will be the intersections of surfaces with the front or back. We obviously get x=0 and z=0. The intersection of the back, y=0, with the front, y=3-x/2-z/2 gives 0=3-x/2-z/2.Since we next want to integrate with respect to x, we solve the top and bottom for x.secondhi := 6-z:
secondlo := 0:We then look at the shadow on the third axis (z) for the final limits.thirdhi:= 6:
thirdlo:= 0:We can now check the integral and the visualization.IntCheck(intorder, firsthi, firstlo, secondhi, secondlo, thirdhi,thirdlo);IntVisual(intorder, firsthi, firstlo, secondhi, secondlo, thirdhi,thirdlo);Exercise:Consider the region bounded by the planes y=0, z=-6, -x+y=4, and 2x+y+z=4.Visualize the region of integration. Determine all orders of integration that only need a single triple integral.Set up the integration for these orders of integration.Find the volume of the region.LUklbXJvd0c2Iy9JK21vZHVsZW5hbWVHNiJJLFR5cGVzZXR0aW5nR0koX3N5c2xpYkdGJzYjLUkjbWlHRiQ2JVEhRicvJSdpdGFsaWNHUSV0cnVlRicvJSxtYXRodmFyaWFudEdRJ2l0YWxpY0YnLUklbXJvd0c2Iy9JK21vZHVsZW5hbWVHNiJJLFR5cGVzZXR0aW5nR0koX3N5c2xpYkdGJzYjLUkjbWlHRiQ2JVEhRicvJSdpdGFsaWNHUSV0cnVlRicvJSxtYXRodmFyaWFudEdRJ2l0YWxpY0Yn