If you're seeing this message, it means we're having trouble loading external resources on our website.

If you're behind a web filter, please make sure that the domains *.kastatic.org and *.kasandbox.org are unblocked.

## Multivariable calculus

### Course: Multivariable calculus>Unit 4

Lesson 7: Triple integrals

# Triple integrals

Triple integrals are the analog of double integrals for three dimensions.  They are a tool for adding up infinitely many infinitesimal quantities associated with points in a three-dimensional region.

## Background

Make sure you have a solid grasp of double integrals before reading through this. The main difficulty in understanding multiple integrals is going from the concept of single integration, to that of double integration. After that, as in the case of triple integrals, most of the mental effort goes towards applying the same principles to situations which are a bit trickier to visualize.

## What we're building to

• At the risk of sounding obvious, triple integrals are just like double integrals, but in three dimensions. They are written abstractly as
$\begin{array}{r}{\iiint }_{R}f\phantom{\rule{0.167em}{0ex}}dV\end{array}$
where
• $R$ is some region in three-dimensional space.
• $f\left(x,y,z\right)$ is some scalar-valued function which takes points in three-dimensional space as its input.
• $dV$ is a tiny unit of volume. In cartesian coordinates, this is expanded as $dV=dx\phantom{\rule{0.167em}{0ex}}dy\phantom{\rule{0.167em}{0ex}}dz$.
• Concretely, these are computed as three embedded integrals:
As with double integrals, the bounds of inner integrals might be functions of the outer variables. These bound functions are what encodes the shape of $R$.
• Use a three-dimensional integral anytime you get that sensation of wanting to chop up a three-dimensional region into infinitely many pieces, associate each piece with a value, then add them all up. One place where this is surprisingly useful is just finding the volume of three-dimensional regions by adding up all the tiny volumes $dV$.
• As with double integrals, the hard part is finding the right bounds which encode your region. This just takes some practice, and a willingness to roll up your sleeves and dive into the muck of a problem.

## Example 1: Rectangular prism with variable density

Suppose you have a block of metal in the shape of a rectangular prism with dimensions $3×2×5$. However, suppose its density is non-uniform. To be able to describe its density with a three-variable function, let's start by imagining this block in three-dimensional cartesian space.
Specifically, the block is positioned such that
• One corner is sitting at the origin.
• One of its edges of length $3$ rests on the positive $x$-axis.
• One of its edges of length $2$ rests on the positive $y$-axis.
• One of its edges of length $5$ rests on the positive $z$-axis.
Let's say its density at each point is given using the function
$\rho \left(x,y,z\right)={x}^{2}y\left(\mathrm{cos}\left(\pi z\right)+2\right)$
(The greek symbol $\rho$, pronounced "rho", is the typical variable used to represent three-dimensional density.)
Key question: What is the mass of the entire block?
As with other integration problems, we start by imagining chopping up this region into many small pieces. Unlike ordinary integrals, where you chop up a line to get tiny pieces of length $dx$, or double integrals, where you chop up a two-dimensional area to get tiny pieces of area $dA$, this time each tiny piece has some volume $dV$. Ultimately, this tiny volume will be broken down as the product of three tiny lengths, but as you set up the problem it is helpful to just think about it as a little volume.
Concretely, the way you might imagine chopping up this block into tiny pieces is by slicing it in three directions:
• Slice it with planes representing constant values of $x$.
• Slice it with planes representing constant values of $y$.
• Slice it with planes representing constant values of $z$.
Since $\rho \left(x,y,z\right)$ is a continuous function, when these tiny pieces are small enough, the density inside any one of them is pretty much constant. For example, as a particular piece shrinks around the point $\left(2,1,3\right)$, its overall density approaches $\rho \left(2,1,3\right)=\left({2}^{2}\right)\left(1\right)\left(\mathrm{cos}\left(\pi 3\right)+2\right)=\left(4\right)\left(1\right)\left(1\right)=4$. Therefore, the mass of one of these tiny pieces can be written as
$\begin{array}{r}\underset{\text{density}}{\underset{⏟}{\rho \left(x,y,z\right)}}\underset{\text{volume}}{\underset{⏟}{dV}}\end{array}$
Where $\left(x,y,z\right)$ is any point inside the piece, and $dV$ is the volume of the piece (the specifics of which are handled by the integral).
Each piece will be a tiny rectangular prism with side lengths $dx$, $dy$ and $dz$, the tiny linear changes in the $x$, $y$ and $z$-directions. Therefore, the tiny volume is
$dV=dx\phantom{\rule{0.167em}{0ex}}dy\phantom{\rule{0.167em}{0ex}}dz$
I think it's important to always think through why $dV$ can be expanded like this, thinking very concretely about the tiny rectangular prism and its edge lengths. I say this because the way to expand it in other coordinate systems, such as cylindrical and spherical coordinate systems, is not so straightforward.
Putting this together, the mass of one of our tiny pieces is
$\begin{array}{r}\\ \rho \left(x,y,z\right)\phantom{\rule{0.167em}{0ex}}dV=\underset{\text{density}}{\underset{⏟}{{x}^{2}y\left(\mathrm{cos}\left(\pi z\right)+2\right)}}\underset{\text{volume}}{\underset{⏟}{\phantom{\rule{0.167em}{0ex}}dx\phantom{\rule{0.167em}{0ex}}dy\phantom{\rule{0.167em}{0ex}}dz}}\end{array}$
To add up all of these tiny masses, we set up three embedded integrals, each one integrating in the direction of a different coordinate axis.
$\begin{array}{r}{\int }_{0}^{5}{\int }_{0}^{2}{\int }_{0}^{3}{x}^{2}y\left(\mathrm{cos}\left(\pi z\right)+2\right)\phantom{\rule{0.167em}{0ex}}dx\phantom{\rule{0.167em}{0ex}}dy\phantom{\rule{0.167em}{0ex}}dz\end{array}$
Notice, the bounds on the inner integral reflect the $x$-values, since $dx$ is written before $dy$ and $dz$. Similarly, the middle integral is bounded by $y$ values, since $dy$ is the second differential term listed, and the outer integral reflects the last term, $dz$.
Concept check: Work through this triple integral. As a tip, you can keep things relatively tidy by factoring terms out of inner integrals as much as you can.
$\begin{array}{r}{\int }_{0}^{5}{\int }_{0}^{2}{\int }_{0}^{3}{x}^{2}y\left(\mathrm{cos}\left(\pi z\right)+2\right)\phantom{\rule{0.167em}{0ex}}dx\phantom{\rule{0.167em}{0ex}}dy\phantom{\rule{0.167em}{0ex}}dz=\end{array}$

As you work through one of these computations, it's all-too easy to lose sight of what it represents.
• You can think of the inner most integral as adding up little bits of mass along lines parallel to the $x$-axis. It returns some expression of $y$ and $z$, which is a way of saying
"Depending on the choice for the $y$ and $z$ coordinates of your line, which is parallel to the $x$-axis, this is what the sum of the infinitesimal masses along that line will be."
• The next integral, with respect to $y$, adds up the infinitesimal masses of those lines in the $y$-direction, giving the infinitesimal mass of a sheet parallel to the $xy$-plane. It will return an expression purely in terms of $z$, which says
"Depending on the height of your sheet above the $xy$-plane, this is what its infinitesimal mass will be".
• Finally, the outermost integral adds up the masses of these sheets as $z$ ranges from $0$ to $5$. It returns a constant, which is the (no-longer-infinitesimal) mass of the block of metal as a whole.

### Example 2: Using a triple integral to compute volume.

You have seen how double integrals can compute the volume under the graph of a two-variable function. Indeed, for most of the regions you might be able to think up, if you are clever enough you can probably figure a way to compute the volume using some kind of double integral.
Remember, the reason double integrals could compute volume is because they took tiny pieces on the $xy$-plane, with area $dA$, and multiplied each one by the height of the function above that point, $f\left(x,y\right)$, which gave the infinitesimal volume of a column above the piece with area $dA$ and below the graph.
With triple integrals, we have a stronger tool which can scan through an entire region and add up tiny units of volume as it goes. If for no other reason, doing this can be very good practice for putting bounds on a triple integral without getting bogged down by the function inside.
For example, consider the region $R$ bounded by the following two surfaces:
• The paraboloid $z={x}^{2}+{y}^{2}$
• The plane $z=2\left(x+y+1\right)$
Here's what those two surfaces look like:
And here's what the three-dimensional region $R$ bound between them looks like:
To find its volume, we start by setting up a deceptively simple looking integral which will add up the volume of all the little pieces you might cut this region into.
$\begin{array}{r}{\iiint }_{R}dV\end{array}$
All of the difficulty lies in setting up the right bounds of these three integrals to accurately encode the region $R$.
From definition of $R$, we get the bounds of $z$ for free:
${x}^{2}+{y}^{2}\le z\le 2\left(x+y+1\right)$
Since the bounds of $z$ are given as functions of $x$ and $y$, this suggests that the inner-most integral of our triple integral should be with respect to $z$. We might start writing the triple integral as follows:
But what do we put for the bounds of the outer two integrals? How far out can $x$ and $y$ go? For this, we must analyze where the two surfaces defining $R$ intersect. This intersection is a closed loop in three-dimensional space, pictured as a red line below.
Now imagine projecting the entire region $R$ onto the $xy$-plane, which is a way of just focussing on which values of $x$ and $y$ matter.
The red loop marking the intersection between $z={x}^{2}+{y}^{2}$ and $z=2\left(x+y+1\right)$ becomes the boundary of the region in the $xy$-plane that we care about.
This is all visual, but to find the analytic description of this curve, set the equations defining each of our two surfaces equal to each other:
$\begin{array}{r}{x}^{2}+{y}^{2}=2\left(x+y+1\right)\end{array}$
By completing the square for both $x$ and $y$, we can get an expression which is easier to geometrically interpret.
$\begin{array}{r}{x}^{2}+{y}^{2}=2\left(x+y+1\right)\\ \\ {x}^{2}-2x+{y}^{2}-2y=2\\ \\ \underset{\text{perfect square}}{\underset{⏟}{{x}^{2}-2x+1}}+\underset{\text{perfect square}}{\underset{⏟}{{y}^{2}-2y+1}}=2+2\\ \\ \underset{\text{equation for a circle}}{\underset{⏟}{\left(x-1{\right)}^{2}+\left(y-1{\right)}^{2}=4}}\end{array}$
Concept check: What shape does this equation describe?

To describe how $x$ and $y$ range over this region, you can either break it up into vertical stripes or horizontal stripes. For no particular reason, I'll choose horizontal stripes.
We encode the fact that the vertical position of the stripes. ranges from $-1$ to $3$ by making these the bounds of $y$.
$\begin{array}{r}{\int }_{-1}^{3}{\int }_{?}^{?}{\int }_{{x}^{2}+{y}^{2}}^{2\left(x+y+1\right)}\phantom{\rule{0.167em}{0ex}}dz\phantom{\rule{0.167em}{0ex}}dx\phantom{\rule{0.167em}{0ex}}dy\end{array}$
The bounds for $x$, which describe the left and right ends of each horizontal stripe in our circle, are the two solutions for $x$ in the equation defining the circle:
$\begin{array}{r}\left(x-1{\right)}^{2}+\left(y-1{\right)}^{2}=4\\ \\ \left(x-1{\right)}^{2}=4-\left(y-1{\right)}^{2}\\ \\ \left(x-1\right)=±\sqrt{4-\left(y-1{\right)}^{2}}\\ \\ x=1±\sqrt{4-\left(y-1{\right)}^{2}}\\ \end{array}$
This means our final integral looks like this:
$\begin{array}{r}{\int }_{-1}^{3}{\int }_{1-\sqrt{4-\left(y-1{\right)}^{2}}}^{1+\sqrt{4-\left(y-1{\right)}^{2}}}{\int }_{{x}^{2}+{y}^{2}}^{2\left(x+y+1\right)}\phantom{\rule{0.167em}{0ex}}dz\phantom{\rule{0.167em}{0ex}}dx\phantom{\rule{0.167em}{0ex}}dy\end{array}$
Isn't that absurd? Welcome to the world of triple integrals.
As a reminder, it's super important to write the differential terms in the right order, in this case, the order is $dz\phantom{\rule{0.167em}{0ex}}dx\phantom{\rule{0.167em}{0ex}}dy$. The bounds of inner integral describe $z$-values, so $dz$ is listed first, the next integral runs over $x$-values, so $dx$ is listed second, etc.
The main skill to practice here is setting up the integral, as we have now done. From there, a computer can handle it. But if you want to practice computing one of these triple integrals, by all means, go for it. This particular integral gets out of hand rather quickly.

## Example 3: Volume of a conical region

Problem: Setup a triple integral which will find the volume of a region $R$ defined by the following properties:
• $y\ge 0$
• $y\le 2-\sqrt{{x}^{2}+{z}^{2}}$
Here's what this region looks like:
"But wait,"
I hear you say,
"I already know how to compute the volume of a cone!"
That's fine, but seeing how to find that volume with a triple integral will be a good way to stretch our triple integral muscles.
Concept check: The region $R$ is defined using bounds for $y$, so which of the following is a valid way to start setting up the integral?

Concept check: Given the two constraints defining our region, $y\ge 0$ and $y\le 2-\sqrt{{x}^{2}+{z}^{2}}$, how can you find the values of $x$ and $z$ within $R$?

Concept check: Based on the answer to the previous question, which of the following describes the region on the $xz$-plane that captures all values of $x$ and $z$ that our triple integral needs to cover.

Concept check: Which of the following shows the right way to set up our volume integral?

## Summary

• Triple integrals are written abstractly as
$\begin{array}{r}{\iiint }_{R}f\phantom{\rule{0.167em}{0ex}}dV\end{array}$
where
• $R$ is some region in three-dimensional space.
• $f\left(x,y,z\right)$ is some scalar-valued function which takes points in three-dimensional space as its input.
• $dV$ is a tiny unit of volume. In cartesian coordinates, this is expanded as $dV=dx\phantom{\rule{0.167em}{0ex}}dy\phantom{\rule{0.167em}{0ex}}dz$.
• Concretely, these are computed as three embedded integrals:
As with double integrals, the bounds of inner integrals might be functions of the outer variables.
• Use a three-dimensional integral anytime you get that sensation of wanting to chop up a three-dimensional region into infinitely many pieces, associate each piece with a value, then add them all up. One place where this is surprisingly useful is just finding the volume of three-dimensional regions by adding up all the tiny volumes $dV$.
• As with double integrals, the hard part is finding the right bounds which encode your region. This just takes some practice, and a willingness to roll up your sleeves and dive into the muck of a problem.

## Want to join the conversation?

• A single integral calculates area. Double integrals calculate volume. I do not understand what triple integrals calculate.
• Single integrals can also be used to find the mass of a straight line given density (and you can find center of mass). Double integrals can also be used to find the mass of a thin plate given density (and you can find center of mass, too). This can be extended to triple integrals to find the mass of a solid, or the center of mass of it. But an extension to the area/volume perspective: triple integrals will give the 4D equivalent of volume.
• In example 3, why does our constraint change from y ≤ 2 sqrt(​x^​2+z^​2) to y ≤ 2 sqrt(​x^​2+y^​2) starting from the second concept check?
• That is a typo. It should still be sqrt(x^2+z^2). As you can see, it is the correct statement in the solutions provided (although only one solution is correct) and it is fixed for the rest of the problem. This needs to be flagged as an error.
• Please put some notes up on triple integrals in spherical and cylindrical coordinates if possible.
• Yes, and also some implicit differentiation, both definition and proof, that'd be great. Also there is exists for the moment not an article/video on continuity and differentiation. That's as far as I know atleast.
• in example 3, wouldn't it be easier if we do the triple integral in cylindrical coordinates?
• Are there any tutorials that explain the change of variables formula?
• In the first concept check, wouldn't the term outside the parentheses be multiplied with the ones inside it. Which would mean that we are not able to separate the terms into expressions of x, y, and z?
x^2*y*(cos(πz)+2)dxdydz is what I am talking about.
• You can separate terms in double/triple integrals whenever they are pure functions of a variable that's not getting integrated over. For example,

\int \int xy dx dy = \int y \int x dx dy

This makes sense, because an integral will only change if the variable it's getting integrated over changes. The x in the example above is getting integrated over by the outer integral, so it doesn't matter whether it's placed inside or outside of the dy integral, as long as it's still in the dx integral.

I hope this helps.
(1 vote)
• why can't a triple integral solve something in the fourth dimension?