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 2

Using a triple integral to find the mass of a volume of variable density. Created by Sal Khan.

Want to join the conversation?

  • blobby green style avatar for user roxxi217
    Why is the function of x,y,z considered the density? How does the 3 variable function map density?
    (11 votes)
    Default Khan Academy avatar avatar for user
    • blobby green style avatar for user cmiddleman8
      He just chose the density function arbitrarily, it could have been any function, but the point is that depending where in the rectangular prism you are the density is always changing. For example at the origin the density is 0 Kg/m^3 meaning it's essentially massless at that point, but if you were to move to far corner it would be f(3,4,2)=3*4*2 = 24Kg/m^3. Remember these densities only hold for that infinitely small region it is necessary to integrate in all three direction to get the total mass of the block. Sal's density function is pretty unrealistic and you would never encounter a block that has no density at one end and a lot at the other, but the idea was to give a simple starter example.
      (28 votes)
  • blobby green style avatar for user RoadReginarRunner
    So we can find the mass of any cube or block by figuring out the triple integral of xyz (with the correct integral parameters)?
    (4 votes)
    Default Khan Academy avatar avatar for user
    • mr pants teal style avatar for user Tristan
      Extending Jordan's answer:

      xyz was a function Sal used purely to show how it works.

      Generally, for any three dimensional region of space R, with an arbitrary density function p, the total mass will be the integral of p*dV=p*dxdydz over the entire region R.
      (9 votes)
  • blobby green style avatar for user Festavarian
    I don't understand how we can end up with a mass of 72Kg, when we are given only the outer dimensions. Sal states that the cube is "variable density". We are not given any known density values, much less density values that vary from region to region.
    How can we derive a specific density of 72Kg?
    What am I missing?
    (5 votes)
    Default Khan Academy avatar avatar for user
    • blobby green style avatar for user Fabien Ma
      When he says "variable density" what that means is that the density is a function d(x, y, z) that changes depending on your position. What that means, is, basically, at each point the density is different, but it is defined.

      For example, if density is d(x,y,z) =xyz, then d(1, 1, 1) = 1, d(1, 1, 2) = 2, d(1, 2, 2) = 4, and so on and so forth.

      When you take the triple integral, you are basically summing up all of these different values of densities over the three-dimensional region.

      Hope that helped!
      (8 votes)
  • blobby green style avatar for user Adriel Claro de Faria
    Double integrals and triple integrals are used to calculate the volume. right? What is the difference between them then?
    (6 votes)
    Default Khan Academy avatar avatar for user
    • blobby green style avatar for user LHS
      Double integrals will have the height of the function as the integrand.
      Triple integrals will have 1 as the integrand, and the first integral you evaluate will give you the height of the function, which becomes the integrand for the remaining double integral.
      (5 votes)
  • female robot grace style avatar for user Barisha Towhid
    So we used double integrals when we found the volume under a "surface", and now we're use triple integrals in finding the volume of a "solid"? Can you explain to me how the two relate?
    (4 votes)
    Default Khan Academy avatar avatar for user
    • leaf green style avatar for user Lucas Van Meter
      Great question Barisha,

      I would also add that the first time you ever learned about integrals it was with one variable. In this case you thought of an integral of a function f(x) as the "area" under the curve. As you point out, a double integral can give us the "volume" under a function f(x,y). But let's think about a very special case, when f(x,y)=1 is the constant function. Then the "volume" under the curve is just the area of the base region, i.e. the area you are integrating over. Similarly, in the one variable case, if you integrate the function f(x)=1, the area under the curve will just be the length you are integrating over.

      So when you say we can use triple integrals to find the volume of a solid what you are really doing is integrating the function f(x,y,z)=1 with a triple integral. The computation is still complicated because you have to find the bound of integration correctly. The next thing you will do is probably integrate more interesting functions of three variables. Sometimes we think about these as density functions because it is hard to imagine that fourth dimension where the function takes its values.
      (3 votes)
  • leaf green style avatar for user Benjamin.S.Kjaer
    Sal mentions "scalar field", what is this? Thanks
    (1 vote)
    Default Khan Academy avatar avatar for user
  • aqualine ultimate style avatar for user Evan Moore
    How would you approach an indefinite triple integral? What happens to the plus c?
    (2 votes)
    Default Khan Academy avatar avatar for user
    • leaf red style avatar for user danny15002
      In my experience you wouldnt really have such a thing. The closest scenario of this type I can picture is a partial differential equation. However, I will still pose an explanation to satisfy your curiosity. Lets say you integrate a triple integral with respect to x, then y, then z. If you had no limits, after integrating with respect to x you would have to add a C term, but it would not be a constant. It would be a function of y and z. i.e f(x,y,z) + C(y,z). This is because when you differentiate with respect to x you lose any y and z terms. This term would then be integratable when integrating for y and z, but you would not be able to actually integrate it since, without starting conditions you do not know what it is. Also, when you integrate with respect to y and z you would have to add similar terms, D(x,z), and E(x,y) ,which you also cannot integrate. You can group these extra terms all into one function defined by x, y, and z. In the end you would have the function you integrated F(x,y,z) plus some function you lost in the process of partial differentiation, C(x,y,z) which you cannot determine without starting conditions. Your final answer would be something like F(x,y,z) + C(x,y,z).
      (1 vote)
  • aqualine tree style avatar for user Drew Holt
    Why is a density function used? Why is it a function of density not volume?
    (1 vote)
    Default Khan Academy avatar avatar for user
    • primosaur ultimate style avatar for user Derek M.
      You only use a density function (for triple integrals) if you want to calculate the mass of a solid, with a specific variable density. The triple integral takes infinitely many infinitely small boxes, and evaluates their densities at various locations, whilst multiplying by the infinitesimal volume dV of the box, then summing up all of these dV*density. In terms of units, you can see that dV (units of m^3 for example), times density (units of kg/m^3 for example) would give an answer in kg, or mass in general (technically dimensionless units is what gets spat out of the triple integral).
      (3 votes)
  • blobby green style avatar for user Scott
    How does one do dimensional analysis on double and triple integrals? There was some hand waving after Sal calculates the integral and he wrote the units down, but he never explained how those units cancel or are created. It was a great video and I completely understand triple integrals now. I just want to make sure that I get the dimensional analysis down, so the units come out correctly.
    (1 vote)
    Default Khan Academy avatar avatar for user
    • male robot hal style avatar for user Yamanqui García Rosales
      The differentials have the same units as their non-infinitesimal counterparts. So for example, if your x-axis is measured in meters, then the differential dx will also be in meters; or if your volume is in cubic meters, then your volume differential dV will also be in cubic meters.

      So when he was calculating the volume he had 3 differentials in meters dx, dy and dz, all multiplying each other, so the result would be in cubic meters.

      For the mass, the density function should be in Kg/m³ (mass over volume), so when multiplied by the volume differential dV in cubic meters, the result would be in Kg.
      (3 votes)
  • blobby green style avatar for user malhar jajoo
    could someone please explain a proper difference between double and triple integral ?? if both r used to calculate volume then wats the difference !
    (2 votes)
    Default Khan Academy avatar avatar for user

Video transcript

In the last video, we had this rectangle, and we used a triple integral to figure out it's volume. And I know you were probably thinking, well, I could have just used my basic geometry to multiply the height times the width times the depth. And that's true because this was a constant-valued function. And then even once we evaluated, once we integrated with respect to z, we ended up with a double integral, which is exactly what you would have done in the last several videos when we just learned the volume under a surface. But then we added a twist at the end of the video. We said, fine, you could have figured out the volume within this rectangular domain, I guess, very straightforward using things you already knew. But what if our goal is not to figure out the volume? Our goal was to figure out the mass of this volume, and even more, the material that we're taking the volume of-- whether it's a volume of gas or a volume of some solid-- that its density is not constant. So now the mass becomes kind of-- I don't know-- interesting to calculate. And so, what we defined, we defined a density function. And rho, this p looking thing with a curvy bottom-- that gives us the density at any given point. And at the end of the last video we said, well, what is mass? Mass is just density times volume. You could view it another way. Density is the same thing as mass divided by volume. So the mass around a very, very small point, and we called that d mass, the differential of the mass, is going equal the density at that point, or the rough density at exactly that point, times the volume differential around that point, times the volume of this little small cube. And then, as we saw it on the last video, if you're using rectangular coordinates, this volume differential could just be the x distance times the y distance times the z distance. So, the density was that our density function is defined to be x, y, and z, and we wanted to figure out the mass of this volume. And let's say that our x, y, and z coordinates-- their values, let's say they're in meters and let's say this density is in kilograms per meter cubed. So our answer is going to be in kilograms if that was the case. And those are kind of the traditional Si units. So let's figure out the mass of this variably dense volume. So all we do is we have the same integral up here. So the differential of mass is going to be this value, so let's write that down. It is x-- I want to make sure I don't run out of space. xyz times-- and I'm going to integrate with respect to dz first. But you could actually switch the order. Maybe we'll do that in the next video. We'll do dz first, then we'll do dy, then we'll do dx. Once again, this is just the mass at any small differential of volume. And if we integrate with z first we said z goes from what? The boundaries on z were 0 to 2. The boundaries on y were 0 to 4. And the boundaries on x, x went from 0 to 3. And how do we evaluate this? Well, what is the antiderivative-- we're integrating with respect to z first. So what's the antiderivative of xyz with respect to z? Well, let's see. This is just a constant so it'll be xyz squared over 2. Right? Yeah, that's right. And then we'll evaluate that from 2 to 0. And so you get-- I know I'm going to run out of space. So you're going to get 2 squared, which is 4, divided by 2, which is 2. So it's 2xy minus 0. So when you evaluate just this first we'll get 2xy, and now you have the other two integrals left. So I didn't write the other two integrals down. Maybe I'll write it down. So then you're left with two integrals. You're left with dy and dx. And y goes from 0 to 4 and x goes from 0 to 3. I'm definitely going to run out of space. And now you take the antiderivative of this with respect to y. So what's the antiderivative of this with respect to y? Let me erase some stuff just so I don't get too messy. I was given the very good suggestion of making it scroll, but, unfortunately, I didn't make it scroll enough this time. So I can delete this stuff, I think. Oops, I deleted some of that. But you know what I deleted. OK, so let's take the antiderivative with respect to y. I'll start it up here where I have space. OK, so the antiderivative of 2xy with respect to y is y squared over 2, 2's cancel out. So you get xy squared. And y goes from 0 to 4. And then we still have the outer integral to do. x goes from 0 to 3 dx. And when y is equal to 4 you get 16x. And then when y is 0 the whole thing is 0. So you have 16x integrated from 0 to 3 dx. And that is equal to what? 8x squared. And you evaluate it from 0 to 3. When it's 3, 8 times 9 is 72. And 0 times 8 is 0. So the mass of our figure-- the volume we figured out last time was 24 meters cubed. I erased it, but if you watched the last video that's what we learned. But it's mass is 72 kilograms. And we did that by integrating this 3 variable density function-- this function of 3 variables. Or in three-dimensions you can view it as a scalar field, right? At any given point, there is a value, but not really a direction. And that value is a density. But we integrated the scalar field in this volume. So that's kind of the new skill we learned with the triple integral. And in the next video I'll show you how to set up more complicated triple integrals. But the real difficulty with triple integrals is-- and I think you'll see that your calculus teacher will often do this-- when you're doing triple integrals, unless you have a very easy figure like this, the evaluation-- if you actually wanted to analytically evaluate a triple integral that has more complicated boundaries or more complicated for example, a density function. The integral gets very hairy, very fast. And it's often very difficult or very time consuming to evaluate it analytically just using your traditional calculus skills. So you'll see that on a lot of calculus exams when they start doing the triple integral, they just want you to set it up. They take your word for it that you've done so many integrals so far that you could take the antiderivative. And sometimes, if they really want to give you something more difficult they'll just say, well, switch the order. You know, this is the integral when we're dealing with respect to z, then y, then x. We want you to rewrite this integral when you switch the order. And we will do that in the next video. See you soon.