Mathematica Lab 4: Triple Integrals

Math 113, Fall 2017
Dr. JohnGemmer
Wake Forest University

Plotting Regions

#33 on pg. 914

Plotting regions in Mathematica can be an incredibly useful tool for evaluating triple integrals. Here is how I would set up and solve problem #33 on pg. 914 of the text:

“Find the volume of the region between the planes x+y+2z=2 and 2x+2y+z=4 in the first octant.”

As always, it is great idea to plot what is going on:

ContourPlot3D[{x+y+2*z==2, 2*x+2*y+z==4},{x,0,2},{y,0,2},{z,0,4},AxesLabel->{"x","y","z"},AxesStyle->Directive[Black, 14],Mesh->False,ContourStyle->{Red,Blue}]

I chose to plot the first plane in red and the second in blue so that I know which plane is which, i.e. which plane is on top. Also I removed the mesh in the plots. You will have to spend some time playing around with the plot ranges to ensure that you get a decent view of what is happening in the plot.

It can also be very useful to plot the solid region in which the plot occurs. You can do this using the RegionPlot3D command:

RegionPlot3D[x≥0&& y≥0 && z≥0&&x+y+2*z≥2&& 2*x+2*y+z≤4,{x,0,2.2},{y,0,2.2},{z,-.1,4},PlotStyle->Directive[Blue,Opacity[0.5]],Mesh->None,AxesLabel->{"x","y","z"},AxesStyle->Directive[Black, 14],PlotPoints->40]

Notice that I turned all of the equalities in the first plot into inequalities. The && signs stand for “and” and imply that all of these inequalities must be satisfied simultaneously. Also, I used the first plot to determine the following inequalities: x+y+2*z≥2 and 2*x+2*y+z≤4, i.e. which plane is on top. Finally, I used opacity to make the plot transparent.

Now that I have the plots I can try to set up the integral. It seems like for this problem it is best to use a shadow in the xy plane. I still need to determine the domain of integration. I can do this by solving for y as a function of x when z=0. Here is the calculation:

Solve[x+y-2== 2*x+2*y-4,y]

Here is the plot of the shadow filled in.

Plot[2-x,{x,0,2},AxesLabel->{"x","y"},AxesStyle->Directive[Black, 14],PlotStyle->Thick,Filling->Axis]

Using all of this geometric information I can now integrate. Notice that since I am integrating between two planes, the bounds of the z-integral range from the bottom plane to the top plane.

Integrate[Integrate[Integrate[1,{z,(2-x-y)/2,4-2*x-2*y}],{y,0,2-x}],{x,0,2}]

#34 on pg. 914

Now, lets do a problem from your previous homework that I thought was incredibly tricky without graphical assistance.

“Find the volume of the region between the planes z=x, x+z=8, z=y, y=8, and z=0.”

Here is the plot of all of the planes together.

ContourPlot3D[{z==x, x+z==8,z==y, y==8, z==0},{x,0,8},{y,0,10},{z,0,4},AxesLabel->{"x","y","z"},AxesStyle->Directive[Black, 14],Mesh->False,ContourStyle->{Red,Blue,Green, Orange, Purple}]

Again, for this plot I spent some time playing with the plot-range until I got it just right. To plot the region of integration we need to think in terms of inequalities.

z==x, x+z==8,z==y, y==8, z==0

RegionPlot3D[x≥0&& y≥0 && z≥0&&z≤x&&z≤8-x&& z≤y&&y≤8,{x,0,8},{y,0,10},{z,-.1,4},PlotStyle->Directive[Blue,Opacity[0.5]],Mesh->None,AxesLabel->{"x","y","z"},AxesStyle->Directive[Black, 14],PlotPoints->40]

Now that I have the plots I can try to set up the integral. It seems like for this problem it is best to use a shadow in the xz plane. In this case we just look at the red and blue planes projections onto the zx plane.

Here is the plot of the shadow filled in.

plot1=Plot[x,{x,0,4},AxesLabel->{"x","z"},AxesStyle->Directive[Black, 14],PlotStyle->Thick,Filling->Axis,PlotRange->{{0,8},{0,4}}];
plot2=Plot[8-x,{x,4,8},AxesLabel->{"x","z"},AxesStyle->Directive[Black, 14],PlotStyle->Thick,Filling->Axis,PlotRange->{{0,8},{0,4}}];
Show[plot1,plot2]

Using all of this geometric information I can now integrate. Notice that since I am integrating in y from the bottom plane (green) to the top plane (orange). This will be a piecewise integral:

Integrate[Integrate[Integrate[1,{y,z,8}],{z,0,x}],{x,0,4}]+Integrate[Integrate[Integrate[1,{y,z,8}],{z,0,8-x}],{x,4,8}]

I could have also used symmetry to evaluate as one integral:

2*Integrate[Integrate[Integrate[1,{y,z,8}],{z,0,x}],{x,0,4}]

Mathematica Task #1:  Triple Integral 1.

Use Mathematica to find the volume of the solid bounded above by  z=4-x^2, on the side by the cylinder x^2+y^2=4, and below by the plane z=-3+x+y.

Plot the three surfaces that make up this region. One of your surfaces should be red, the other blue, and the other green and should not contain the meshes. Your plotrange should be large enough to show all features of the surface.

Using the commang RegionPlot3D plot this region. Your plot should be opaque and be meshless. Again, your plotrange should be large enough to show all features of the surface.

Use Mathematica to set up and evaluate the triple integral.

Mathematica Task #2:  Triple Integral 1I.

Use Mathematica to find the volume of the solid bounded between the graphs of x+y=4, x-y=4, and y^2+4z^2=16.

Plot the three surfaces that make up this region. One of your surfaces should be red, the other blue, and the other green and should not contain the meshes. Your plotrange should be large enough to show all features of the surface.

Using the commang RegionPlot3D plot this region. Your plot should be opaque and be meshless. Again, your plotrange should be large enough to show all features of the surface.

Use Mathematica to set up and evaluate the triple integral.