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.

Main content

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

An example three-dimensional region
  • At the risk of sounding obvious, triple integrals are just like double integrals, but in three dimensions. They are written abstractly as
    RfdV
    where
    • R is some region in three-dimensional space.
    • f(x,y,z) 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=dxdydz.
  • Concretely, these are computed as three embedded integrals:
    z1z2y1(z)y2(z)x1(y,z)x2(y,z)f(x,y,z)dxThis is a function purely of y and zdyThis is a function purely of zdz
    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.
Khan Academy video wrapper
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
ρ(x,y,z)=x2y(cos(πz)+2)
(The greek symbol ρ, 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.
Khan Academy video wrapper
Since ρ(x,y,z) 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 (2,1,3), its overall density approaches ρ(2,1,3)=(22)(1)(cos(π3)+2)=(4)(1)(1)=4. Therefore, the mass of one of these tiny pieces can be written as
ρ(x,y,z)densitydVvolume
Where (x,y,z) 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=dxdydz
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
ρ(x,y,z)dV=x2y(cos(πz)+2)densitydxdydzvolume
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.
050203x2y(cos(πz)+2)dxdydz
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.
050203x2y(cos(πz)+2)dxdydz=

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(x,y), which gave the infinitesimal volume of a column above the piece with area dA and below the graph.
Khan Academy video wrapper
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=x2+y2
  • The plane z=2(x+y+1)
Here's what those two surfaces look like:
Khan Academy video wrapper
And here's what the three-dimensional region R bound between them looks like:
Khan Academy video wrapper
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.
RdV
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:
x2+y2z2(x+y+1)
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:
????x2+y22(x+y+1)dzInner integral is with respect to zdxdy
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.
Khan Academy video wrapper
The red loop marking the intersection between z=x2+y2 and z=2(x+y+1) 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:
x2+y2=2(x+y+1)
By completing the square for both x and y, we can get an expression which is easier to geometrically interpret.
x2+y2=2(x+y+1)x22x+y22y=2x22x+1perfect square+y22y+1perfect square=2+2(x1)2+(y1)2=4equation for a circle
Concept check: What shape does this equation describe?
Choose 1 answer:

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.
13??x2+y22(x+y+1)dzdxdy
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:
(x1)2+(y1)2=4(x1)2=4(y1)2(x1)=±4(y1)2x=1±4(y1)2
This means our final integral looks like this:
1314(y1)21+4(y1)2x2+y22(x+y+1)dzdxdy
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 dzdxdy. 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:
  • y0
  • y2x2+z2
Here's what this region looks like:
Khan Academy video wrapper
"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?
Choose 1 answer:

Concept check: Given the two constraints defining our region, y0 and y2x2+z2, how can you find the values of x and z within R?
Choose 1 answer:

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.
Choose 1 answer:

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

Summary

  • Triple integrals are written abstractly as
    RfdV
    where
    • R is some region in three-dimensional space.
    • f(x,y,z) 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=dxdydz.
  • Concretely, these are computed as three embedded integrals:
    z1z2y1(z)y2(z)x1(y,z)x2(y,z)f(x,y,z)dxThis is a function purely of y and zdyThis is a function purely of zdz
    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?

  • hopper cool style avatar for user obiwan kenobi
    A single integral calculates area. Double integrals calculate volume. I do not understand what triple integrals calculate.
    (5 votes)
    Default Khan Academy avatar avatar for user
    • starky ultimate style avatar for user Euly
      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.
      (12 votes)
  • leafers tree style avatar for user clara.vdw
    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?
    (6 votes)
    Default Khan Academy avatar avatar for user
    • piceratops ultimate style avatar for user patrick
      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.
      (3 votes)
  • blobby green style avatar for user Frances Mayer
    Please put some notes up on triple integrals in spherical and cylindrical coordinates if possible.
    (5 votes)
    Default Khan Academy avatar avatar for user
  • piceratops ultimate style avatar for user sedon
    in example 3, wouldn't it be easier if we do the triple integral in cylindrical coordinates?
    (4 votes)
    Default Khan Academy avatar avatar for user
  • piceratops seed style avatar for user Sam Clark
    Are there any tutorials that explain the change of variables formula?
    (3 votes)
    Default Khan Academy avatar avatar for user
  • blobby green style avatar for user Siddhant Madan
    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.
    (3 votes)
    Default Khan Academy avatar avatar for user
    • blobby green style avatar for user lakern
      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)
  • starky seedling style avatar for user Paolo Concepcion
    why can't a triple integral solve something in the fourth dimension?
    (2 votes)
    Default Khan Academy avatar avatar for user
  • blobby green style avatar for user sjps30503
    What graphing tool is used to generate regions in the videos, and, specifically, how is the region in Example 2 generated?
    (2 votes)
    Default Khan Academy avatar avatar for user
  • aqualine ultimate style avatar for user system2analytics
    Love this fine explanation. Thank you!
    (2 votes)
    Default Khan Academy avatar avatar for user
  • blobby green style avatar for user festavarian2
    Re: Example 2 where the paraboloid is obliquely intersected by a plane:
    Intuitively (to me) this seems like it would result in an elliptical region, and the video actually shows an elliptical region in R-2..... and yet the math gives a circle.How can this be?
    (1 vote)
    Default Khan Academy avatar avatar for user
    • duskpin ultimate style avatar for user Claire
      As you see in the 3-D image, the intersection is tilted with respect to the x-y plane. The equation that you get is actually for the projection of the ellipse onto the x-y plane. Think of it as if you're holding an elliptical sheet of paper or a solid with an elliptical cross-section under a light source. If you tilt the object just right, the shadow it casts will be circular. This is the effect of the z variable not being present; it flattens everything.
      To clarify, a circle actually is an ellipse: it's simply a special case of an ellipse, just as a square is a special case of a rectangle.
      Therefore, the intersection is an ellipse, and it's projection happens to be a circle. All your observations were correct! I hope this helped. If you still have questions, please ask, and best wishes for your continuing education!
      (2 votes)