Application Center - Maplesoft

App Preview:

Setting up triple integrals

You can switch back to the summary page by clicking here.

Learn about Maple
Download Application


 

Sec15.3dzdydx.mws

Triple Integrals

Worksheet by Mike May, S. J.- maymk@slu.edu

(section 15.3)

> restart:

Setting limits of integration and evaluating

The problems of triple integrals are very much like the problems of double integrals, only with three steps rather than two. The first problem is to set up the limits of integration.

When we did double integrals, the limits on the inside variable were functions on the outside variable. A region could be set up in 2 ways with the 2 possible orders to the variables.

With triple integrals we now have a variable inside two other variables, with limits that are functions of those two variables. There are now 6 ways to order the vaiables.

>

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 will be int(int(int(f(x,y,z),z = g(x,y) .. h(x,y)),y = s(x)... , where, over a particular (x,y), z is restricted between g(x,y) and h(x,y) and, for a particular x, y is restricted between s(x) and t(x).

We can use Maple to check triple integrals, using the int command three times. 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 int(int(int(x+y^2+z^3,x = 1 .. 3),y = -1 .. 2),z = ... 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);

Int(Int(Int(x+y^2+z^3,x = 1 .. 3),y = -1 .. 2),z = ...

Note that we use the Int command (upper case I) to be able to check the integral that is being evaluated. At times it is useful to look at 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 = ...

Int(Int(Int(x+y^2+z^3,x = 1 .. 3),y = -1 .. 2),z = ...

Exercise:

1) Evaluate a triple integrals of the following functions over the indicated regions. Follow the model used above so that I see 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 x 2, -1 y 1, 2 z 3.

>

(b) h(x, y, z) = a*x + b*y + c*z. W is the rectangular box 0 x 1, 0 y 1, 0 z 2.

>

(c) f(x, y, z) = exp(-x-y-z). W is the rectangular box 0 x a, 0 y b, 0 z c.

>

Visualizing the region of integration

The real problem with multiple integrals is setting the limits of integration when the region is more complicated. Then the order of integration is important.

Consider the region bounded by the upper half cone z = sqrt(x^2+y^2) and the plane z=5. This integral can be expressed as either int(int(int(1,z = sqrt(x^2+y^2) .. 5),y = -sqrt(25-... or int(int(int(1,y = -sqrt(z^2-x^2) .. sqrt(z^2-x^2)),... . When we try to evaluate the integral both ways we get interesting results. Maple chokes on the first integral and can't evaluate it. (The second integral works easily in version 4. In revsion 5 of Maple we need to let Maple know that z is a real number.)

> interface(showassumed=0): assume(z,real):
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);

Int(Int(Int(1,z = sqrt(x^2+y^2) .. 5),y = -sqrt(25-...

Int(Int(Int(1,y = -sqrt(z^2-x^2) .. sqrt(z^2-x^2)),...

Thus even Maple finds some ways of doing the integral easier than others.

This means that for a given integral we want to be able to figure out the limits of integration for a problem 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 dzdydx

What Maple is useful for is trying to visualize the regions we want to integrate. The block of code below looks at a slice of the sphere centered at the origin with radius 5. It is set up for limits to integrals of the form dzdydx. (In that case 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),
subs(x=hix+u*(lox-hix),hiyfx+v*(loyfx-hiyfx)),
subs({x=hix+u*(lox-hix),
y=subs(x=hix+u*(lox-hix), hiyfx+v*(loyfx-hiyfx))}, hizfxy)]:
bottomgrid := [hix+u*(lox-hix),
subs(x=hix+u*(lox-hix),hiyfx+v*(loyfx-hiyfx)),
subs({x=hix+u*(lox-hix),
y=subs(x=hix+u*(lox-hix), hiyfx+v*(loyfx-hiyfx))}, lozfxy)]:
leftgrid := [hix+u*(lox-hix), subs(x=hix+u*(lox-hix),loyfx),
subs({x=hix+u*(lox-hix),y=subs(x=hix+u*(lox-hix), loyfx)},
lozfxy+v*(hizfxy-lozfxy))]:
rightgrid := [hix+u*(lox-hix), subs(x=hix+u*(lox-hix),hiyfx),
subs({x=hix+u*(lox-hix),y=subs(x=hix+u*(lox-hix), hiyfx)},
lozfxy+v*(hizfxy-lozfxy))]:
frontgrid := [hix, subs(x=hix,hiyfx+u*(loyfx-hiyfx)),
subs({x=hix, y=subs(x=hix,hiyfx+u*(loyfx-hiyfx))},
lozfxy+v*(hizfxy-lozfxy))]:
backgrid := [lox, subs(x=lox,hiyfx+u*(loyfx-hiyfx)),
subs({x=lox, y=subs(x=lox,hiyfx+u*(loyfx-hiyfx))},
lozfxy+v*(hizfxy-lozfxy))]:
surface :=
{topgrid, bottomgrid, leftgrid, rightgrid, backgrid,frontgrid}:
plot3d(surface, u=0..1, v=0..1, axes=BOXED, grid =[30,30]);

`region for `, Int(Int(Int(f(x,y,z),z = -sqrt(25-x^...

[Maple Plot]

Recall that by clicking on the graph you can rotate it and look at the region from another perspective.

Visualizing dzdxdy

Similarly we can use Maple to viualize a region for 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 := [subs(y=hiy+v*(loy-hiy),hixfy+u*(loxfy-hixfy)),
hiy+v*(loy-hiy),
subs({y=hiy+v*(loy-hiy),
x=subs(y=hiy+v*(loy-hiy),hixfy+u*(loxfy-hixfy))}, hizfxy)]:
bottomgrid := [subs(y=hiy+v*(loy-hiy),hixfy+u*(loxfy-hixfy)),
hiy+v*(loy-hiy),
subs({y=hiy+v*(loy-hiy),
x=subs(y=hiy+v*(loy-hiy),hixfy+u*(loxfy-hixfy))}, lozfxy)]:
leftgrid := [subs(y=loy,hixfy+u*(loxfy-hixfy)),loy,
subs({x=subs(y=loy,hixfy+u*(loxfy-hixfy)),y=loy},
lozfxy+v*(hizfxy-lozfxy))]:
rightgrid := [subs(y=hiy,hixfy+u*(loxfy-hixfy)),hiy,
subs({x=subs(y=hiy,hixfy+u*(loxfy-hixfy)),y=hiy},
lozfxy+v*(hizfxy-lozfxy))]:
frontgrid := [subs(y=hiy+u*(loy-hiy),hixfy),hiy+u*(loy-hiy),
subs({x=subs(y=hiy+u*(loy-hiy),hixfy), y=hiy+u*(loy-hiy)},
lozfxy+v*(hizfxy-lozfxy))]:
backgrid := [subs(y=hiy+u*(loy-hiy),loxfy),hiy+u*(loy-hiy),
subs({x=subs(y=hiy+u*(loy-hiy),loxfy), y=hiy+u*(loy-hiy)},
lozfxy+v*(hizfxy-lozfxy))]:
surface :=
{topgrid, bottomgrid, leftgrid, rightgrid, backgrid,frontgrid}:
plot3d(surface, u=0..1, v=0..1, axes=BOXED, grid =[50,50]);

`region for `, Int(Int(Int(f(x,y,z),z = x+y .. 3+x^...

[Maple Plot]

Noice the difference in lines 3-6. 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.

>

Exercises:

2) Either use modifications of the code above to produce a visualization of the regions integrated over below or explain why the integral does not make sense.

(a) Int(Int(Int(f(x,y,z),z = 0 .. 6-x-2*y),y = 0 .. 3-x...

Int(Int(Int(f(x,y,z),z = 0 .. 6-x-2*y),y = 0 .. 3-1...

>

(b) Int(Int(Int(f(x,y,z),z = 0 .. x),y = 0 .. z),x = 0 ...

Int(Int(Int(f(x,y,z),z = 0 .. x),y = 0 .. z),x = 0 ...

>

(c) Int(Int(Int(f(x,y,z),z = 0 .. 3),y = 0 .. 2-x),x = ...

Int(Int(Int(f(x,y,z),z = 0 .. 3),y = 0 .. 2-x),x = ...

>

3) Change the order of integration on one of the problems you did in number 2. Show that you get the same region.

>

>