# Triple integrals

Why integrate just twice, when you could integrate three times?

### Writing it down

If $C=[a,b]\times[c,d]\times[e,f]$ is a cuboid in 3D space, then

$$\iiint_C g(x,y,z)\, dV = \int_e^f \int_c^d \int_a^b g(x,y,z) \, dx \, dy \, dz.$$

### Doing it

\begin{align} &\int_0^3 \int_0^2 \int_0^1 x y^2 z^3 \, dz \, dy \, dx = \int_0^3 \int_0^2 x y^2 \, \frac{1}{4} z^4\Big|_{z=0}^1 \, dy \, dx \\ &= \frac{1}{4} \int_0^3 \int_0^2 x y^2 \, dy \, dx = \frac{1}{4} \int_0^3 \frac{1}{3} x \, y^3\Big|_{y=0}^2 \, dx \\ &= \frac{1}{4} \int_0^3 \frac{8}{3} x \, dx = \frac{1}{4}\times\frac{8}{3}\times\frac{9}{2} = 3. \end{align}

## Interpreting it

If $E\subset \mathbb R^3$, then how can we interpret

$$\iiint_E g(x,y,z)\, dV?$$
• If $g(x,y,z)\equiv1$, then the integral represents volume of $E$
• If $g$ represents density (mass/unit volume) then the integral represents mass.

### Example

Suppose that the cuboid $C=[-3,3]\times[-2,2]\times[0,1]$ has density

$$g(x,y,z)=(16-(x^2+y^2))(z+1).$$

Use this to determine the mass of $C$

### The domain

The domain is a cuboid: $C=[-3,3]\times[-2,2]\times[0,1]$. It looks like so: ### The function

The function itself may be viewed as a density plot: $$g(x,y,z) = (16-(x^2+y^2))(z+1)$$

### The mass

The mass may be computed as a triple integral

\begin{align} & \int_{-3}^3 \int_{-2}^2 \int_0^1 (16-(x^2+y^2))(z+1) \, dz \, dy \, dx \\ &= 4 \int_0^3 \int_0^2 (16-x^2-y^2) \, \frac{3}{2} \, dy \, dx \\ &= 6 \int_0^3 \left(32 - 2x^2-\frac{8}{3}\right) \, dx \\ &= 6 \left(96 - \frac{2}{3}\times27 - 8\right) = 420. \end{align}

## Tetrahedral domains

A tetrahedron is a solid shape with 4 vertices and 4 triangular faces. The tetrahedron $T$ above has vertices at the origin, $(3,0,0)$, $(0,2,0)$, and $(0,0,1)$.

## Plane equation An equation for the plane containing the top is

$$2 x + 3 y + 6 z = 6 \text{ or } z=1-x/3-y/2.$$

### Tetrahedral integration

If we look at the tetrahedron from above, we see a triangle. To integrate with respect to $z$ first, we move from point $(x,y,0)$ in the triangle to the top face at $(x,y,1-x/3-y/2)$. That yields inner bounds of integration on $z$ of $0\leq z \leq 1-x/3-y/2$.

### Triangular integration After we've integrated with respect to $z$, we project down to the $xy$ plane and integrate over the triangle that we see. That yields further bounds of integration

$$0\leq y \leq 2-2x/3 \text{ and } 0 \leq x \leq 3.$$

### Putting it all together

Finally, to set up an iterated integral of a function $f$ over the tetrahedron $T$, we should get:

$$\iiint_T f(x,y,z) \, dV = \int_0^3 \int_0^{2-2x/3} \int_0^{1-x/3-y/2} f(x,y,z)\,dz\,dy\,dx.$$