Triple IntegralsWorksheet by Mike May, S. J.- maymk@slu.eduRevised by Russell Blyth - blythrd@slu.edurestart:with(Student[MultivariateCalculus]):Setting limits of integration and evaluating triple integralsThe problems of triple integrals are very much like the problems of double integrals, only with three steps rather than two. The first step is to set up the limits of integration.When we do double integrals, the limits on the inside integral are functions of the outside variable. A double integral region can be set up in two ways, with the two possible orders of the variables.With triple integrals we now have an integral inside two other integrals, with limits on the innermost integral that are functions of the outer two variables of integration. There are now 6 ways to order the variables.If we set up the integral to integrate f(x,y,z) with respect to z first, then with respect to y, then with respect to x, the general form is NiMtJSRpbnRHNiQtRiQ2JC1GJDYkLSUiZkc2JSUieEclInlHJSJ6Ry9GLzstJSJnRzYkRi1GLi0lImhHRjQvRi47LSUic0c2I0YtLSUidEdGOy9GLTslImFHJSJiRw==, where, over a particular (x,y), the variable z is restricted between g(x,y) and h(x,y) and, for a particular x, the variable y is restricted between s(x) and t(x).We can use Maple to check triple integrals, using the int command three times. For example, if we want to integrate the function f(x,y,z) = x + y^2 + z^3 over the cube bounded by the planes x=1, x=3, y=-1, y=2, z=0, and z=1, we evaluate NiMtJSRpbnRHNiQtRiQ2JC1GJDYkLCglInhHIiIiKiQpJSJ5RyIiI0YsRiwqJCklInpHIiIkRixGLC9GKztGLEY0L0YvOywkRiwhIiJGMC9GMzsiIiFGLA== by simply executing the command:Int(Int(Int(x+y^2+z^3, x=1..3), y=-1..2),z=0..1)=
int(int(int(x+y^2+z^3, x=1..3), y=-1..2),z=0..1);Note that we use the Int command (upper case I) to be able to show the integral that is being evaluated. At times it is useful to see the intermediate steps.Int(Int(Int(x+y^2+z^3, x=1..3), y=-1..2),z=0..1)=
Int(Int(int(x+y^2+z^3, x=1..3), y=-1..2),z=0..1);
Int(Int(int(x+y^2+z^3, x=1..3), y=-1..2),z=0..1)=
Int(int(int(x+y^2+z^3, x=1..3), y=-1..2),z=0..1);
Int(int(int(x+y^2+z^3, x=1..3), y=-1..2),z=0..1)=
int(int(int(x+y^2+z^3, x=1..3), y=-1..2),z=0..1);We can perform a similar check using the MultiInt command from the Student[MultivariateCalculus] packageanswer = MultiInt(x+y^2+z^3,x=1..3,y=-1..2, z=0..1,output = value);
setup = MultiInt(x+y^2+z^3,x=1..3,y=-1..2, z=0..1,output = integral);
# The second of the following two lines does not work in Maple 9.5,
# since the "output=steps" option is new in Maple 10 (the penalty
# in Maple 9.5 is only two lines of error messages).
print("A worked solution");
MultiInt(x+y^2+z^3,x=1..3,y=-1..2, z=0..1,output = steps);Exercise1. Evaluate triple integrals of the following functions over the indicated regions W. Follow the model used above so that you show both the unevaluated integral and the evaluated expression together.(a) f(x, y, z) = x^2 +5*y^2 - z. W is the rectangular box 0 \342\211\244 x \342\211\244 2, -1 \342\211\244 y \342\211\244 1, 2 \342\211\244 z \342\211\244 3.(b) h(x, y, z) = a*x + b*y + c*z. W is the rectangular box 0 \342\211\244 x \342\211\244 1, 0 \342\211\244 y \342\211\244 1, 0 \342\211\244 z \342\211\244 2.(c) f(x, y, z) = exp(-x-y-z). W is the rectangular box 0 \342\211\244 x \342\211\244 a, 0 \342\211\244 y \342\211\244 b, 0 \342\211\244 z \342\211\244 c.Visualizing the region of integrationThe real challenge with multiple integrals is setting the limits of integration when the region is more complicated. Then the order of integration becomes important.Consider the volume of the region bounded by the upper half cone NiMvJSJ6Ry0lJXNxcnRHNiMsJiokKSUieEciIiMiIiJGLSokKSUieUdGLEYtRi0= and the plane z=5. This integral can be expressed as either NiMtJSRpbnRHNiQtRiQ2JC1GJDYkIiIiLyUiekc7LSUlc3FydEc2IywmKiQpJSJ4RyIiI0YqRioqJCklInlHRjVGKkYqIiImL0Y4OywkLUYvNiMsJiIjREYqRjIhIiJGQUY9L0Y0OywkRjlGQUY5 or NiMtJSRpbnRHNiQtRiQ2JC1GJDYkIiIiLyUieUc7LCQtJSVzcXJ0RzYjLCYqJCklInpHIiIjRipGKiokKSUieEdGNkYqISIiRjpGLy9GOTssJEY1RjpGNS9GNTsiIiEiIiY=. When we try to evaluate the integral both ways we get interesting results. Maple chokes on the first integral and can't completely evaluate it. Int(Int(Int(1, z=sqrt(x^2+y^2)..5),y=-sqrt(25-x^2)..sqrt(25-x^2)), x=-5..5)
= int(int(int(1, z=sqrt(x^2+y^2)..5),y=-sqrt(25-x^2)..sqrt(25-x^2)), x=-5..5);
Int(Int(Int(1, y=-sqrt(z^2-x^2)..sqrt(z^2-x^2)), x = -z..z), z=0..5)
= int(int(int(1, y=-sqrt(z^2-x^2)..sqrt(z^2-x^2)), x = -z..z), z=0..5);Thus even Maple finds some ways of computing an integral easier than others.This means that for a given problem we want to be able to both determine the limits of integration for the appropriate region and to be able to change the order of integration.Much like with double integrals, finding the limits of integration involves solving the boundary surfaces for the variable we are integrating with respect to. Visualizing dzdydxMaple is useful for visualizing the regions we want to integrate over. The block of code below considers a slice of the sphere centered at the origin with radius 5. It is set up for limits of integrals of the form dzdydx. (In this case the limits on z are functions of x and y, the limits on y are functions of x, and the limits on x are constants.) hizfxy:= sqrt(25-x^2-y^2):
lozfxy:= -sqrt(25-x^2-y^2):
hiyfx:= sqrt(25-x^2):
loyfx:= -sqrt(25-x^2):
hix := 4:
lox := -3:
print(`region for `,Int(Int(Int(f(x,y,z),
z=lozfxy..hizfxy), y=loyfx..hiyfx), x=lox..hix));
topgrid := [hix+u*(lox-hix),
eval(hiyfx+v*(loyfx-hiyfx),x=hix+u*(lox-hix)),
eval(hizfxy, {x=hix+u*(lox-hix),
y=subs(x=hix+u*(lox-hix), hiyfx+v*(loyfx-hiyfx))})]:
bottomgrid := [hix+u*(lox-hix),
eval(hiyfx+v*(loyfx-hiyfx),x=hix+u*(lox-hix)),
eval(lozfxy, {x=hix+u*(lox-hix),
y=subs(x=hix+u*(lox-hix), hiyfx+v*(loyfx-hiyfx))})]:
leftgrid := [hix+u*(lox-hix), eval(loyfx,x=hix+u*(lox-hix)),
eval(lozfxy+v*(hizfxy-lozfxy),
{x=hix+u*(lox-hix),y=eval(loyfx, x=hix+u*(lox-hix))})]:
rightgrid := [hix+u*(lox-hix), eval(hiyfx, x=hix+u*(lox-hix)),
eval(lozfxy+v*(hizfxy-lozfxy),
{x=hix+u*(lox-hix),y=eval(hiyfx, x=hix+u*(lox-hix))})]:
frontgrid := [hix, eval(hiyfx+u*(loyfx-hiyfx), x=hix),
eval(lozfxy+v*(hizfxy-lozfxy),
{x=hix, y=eval(hiyfx+u*(loyfx-hiyfx), x=hix)} )]:
backgrid := [lox, eval(hiyfx+u*(loyfx-hiyfx), x=lox),
eval(lozfxy+v*(hizfxy-lozfxy),
{x=lox, y=eval(hiyfx+u*(loyfx-hiyfx),x=lox)})]:
surface :=
{topgrid, bottomgrid, leftgrid, rightgrid, backgrid,frontgrid}:
plot3d(surface, u=0..1, v=0..1, axes=BOXED, grid =[12,12],scaling=constrained);Recall that by clicking on the graph you can rotate it and look at the region from various perspectives.Visualizing dzdxdySimilarly we can use Maple to visualize regions for integrals of the form dzdxdy. hizfxy:= 3+x^2+2*y^2:
lozfxy:= x+y:
hiy:= 5:
loy:= -1:
hixfy := 2+y:
loxfy := -2-y:
print(`region for `,Int(Int(Int(f(x,y,z),
z=lozfxy..hizfxy), x=loxfy..hixfy), y=loy..hiy));
topgrid := [eval(hixfy+u*(loxfy-hixfy), y=hiy+v*(loy-hiy)),
hiy+v*(loy-hiy),
eval(hizfxy, {y=hiy+v*(loy-hiy),
x=eval(hixfy+u*(loxfy-hixfy), y=hiy+v*(loy-hiy))})]:
bottomgrid := [eval(hixfy+u*(loxfy-hixfy), y=hiy+v*(loy-hiy)),
hiy+v*(loy-hiy),
eval(lozfxy, {y=hiy+v*(loy-hiy),
x=eval(hixfy+u*(loxfy-hixfy), y=hiy+v*(loy-hiy))})]:
leftgrid := [eval(hixfy+u*(loxfy-hixfy),y=loy),loy,
eval(lozfxy+v*(hizfxy-lozfxy),
{x=subs(y=loy,hixfy+u*(loxfy-hixfy)),y=loy})]:
rightgrid := [eval(hixfy+u*(loxfy-hixfy),y=hiy),hiy,
eval(lozfxy+v*(hizfxy-lozfxy),
{x=subs(y=hiy,hixfy+u*(loxfy-hixfy)),y=hiy})]:
frontgrid := [eval(hixfy, y=hiy+u*(loy-hiy)),hiy+u*(loy-hiy),
eval(lozfxy+v*(hizfxy-lozfxy),
{x=eval(hixfy, y=hiy+u*(loy-hiy)), y=hiy+u*(loy-hiy)})]:
backgrid := [eval(loxfy, y=hiy+u*(loy-hiy)),hiy+u*(loy-hiy),
eval(lozfxy+v*(hizfxy-lozfxy),
{x=eval(loxfy, y=hiy+u*(loy-hiy)), y=hiy+u*(loy-hiy)})]:
surface :=
{topgrid, bottomgrid, leftgrid, rightgrid, backgrid,frontgrid}:
plot3d(surface, u=0..1, v=0..1, axes=BOXED, grid =[12,12]);Notice the difference in lines 3-6 of the code, due to the different order of integration, compared to the previous example. In the dzdydx case the limits on y are functions of x and the limits on x are constants. In the dzdxdy case, the situation is reversed.Exercises2. Either use modifications of the code above to produce a visualization of the region integrated over for each triple integral below, or explain why the integral does not make sense. (a) NiMtSSRJbnRHNiQlKnByb3RlY3RlZEdJKF9zeXNsaWJHNiI2JC1GJDYkLUYkNiQtSSJmR0YoNiVJInhHRihJInlHRihJInpHRigvRjM7IiIhLCgiIiciIiJGMSEiIiomIiIjRjlGMkY5RjovRjI7RjYsJiIiJEY5KihGOUY5RjxGOkYxRjlGOi9GMTtGNkY4;(b) NiMtSSRJbnRHNiQlKnByb3RlY3RlZEdJKF9zeXNsaWJHNiI2JC1GJDYkLUYkNiQtSSJmR0YoNiVJInhHRihJInlHRihJInpHRigvRjM7IiIhRjEvRjI7RjZGMy9GMTtGNiIiIg==;(c) NiMtSSRJbnRHNiQlKnByb3RlY3RlZEdJKF9zeXNsaWJHNiI2JC1GJDYkLUYkNiQtSSJmR0YoNiVJInhHRihJInlHRihJInpHRigvRjM7IiIhIiIkL0YyO0Y2LCYiIiMiIiJGMSEiIi9GMTtGNkY8;3. Change the order of integration for one of the valid integrals in Exercise 2. Show (visually) that you get the same region.