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.

### Course: Multivariable calculus>Unit 4

Lesson 6: Double integrals (articles)

# Double integrals

Double integrals are a way to integrate over a two-dimensional area.  Among other things, they lets us compute the volume under a surface.

## What we're building to

• Given a two-variable function $f\left(x,y\right)$, you can find the volume between this graph and a rectangular region of the $xy$-plane by taking an integral of an integral,
This is called a double integral.
• You can compute this same volume by changing the order of integration:
The computation will look and feel very different, but it still gives the same result.

## Volume under a surface

Consider the function
$f\left(x,y\right)=x+\mathrm{sin}\left(y\right)+1$
Its graph looks like this:
Now consider the rectangle on the $xy$-plane defined by
$0
and
$-\pi
What is the volume above this rectangle, and under the graph of $f\left(x,y\right)$?

## Quick refresh of area under curve

From single variable calculus, we know that integrals let us compute the area under a curve. For example, the area under the graph of $y=\frac{1}{4}{x}^{2}+1$ between the values $x=-3$ and $x=3$ is
$\begin{array}{r}{\int }_{-3}^{3}\left(\frac{1}{4}{x}^{2}+1\right)\phantom{\rule{0.167em}{0ex}}dx\end{array}$
A nice way to think about this is to imagine adding the areas of infinitely many, infinitely thin rectangles which sweep under the curve in the specified region:
You can think of the value of the function $g\left(x\right)=\frac{1}{4}{x}^{2}+1$ as being the height of each rectangle, $dx$ as being the infinitesimal width, and $\int$ as being a pumped-up summing machine that's able to handle the idea of infinitely many infinitely small things. Written more abstractly, this looks like
$\begin{array}{r}{\int }_{{x}_{1}}^{{x}_{2}}g\left(x\right)\phantom{\rule{0.167em}{0ex}}dx\end{array}$

## Sweeping area under a volume

For our volume problem, we can do something similar. Our strategy will be to
1. Subdivide the volume into slices with two-dimensional area
2. Compute the areas of these slices
3. Combine them all together to get the volume as a whole.
Think of two-dimensional slices of the volume under the graph of $f\left(x,y\right)$. Specifically, take all the slices representing a constant value of $y$:
Consider just one of those slices, such as the one representing $y=\frac{\pi }{2}$. The area of that slice is given by the integral
$\begin{array}{rl}{\int }_{0}^{2}f\left(x,\frac{\pi }{2}\right)\phantom{\rule{0.167em}{0ex}}dx& ={\int }_{0}^{2}\left(x+\mathrm{sin}\left(\frac{\pi }{2}\right)+1\right)\phantom{\rule{0.167em}{0ex}}dx\end{array}$
Written more abstractly, for a given value of $y$, the area of that slice is
$\begin{array}{r}{\int }_{0}^{2}f\left(x,y\right)\phantom{\rule{0.167em}{0ex}}dx\end{array}$
Notice, this is an integral with respect to $x$, as indicated by the $dx$, so as far as the integral is concerned, the symbol "$y$" represents a constant.
When you perform this integral, it will be some expression of $y$.
Try it for yourself: Perform the integral to compute the area of these constant-$y$-value slices:
$\begin{array}{r}{\int }_{0}^{2}\left(x+\mathrm{sin}\left(y\right)+1\right)\phantom{\rule{0.167em}{0ex}}dx=\end{array}$

When you plug in some value of $y$ to this expression, such as $y=\frac{\pi }{2}$, you get the area of a slice of our volume representing that $y$-value.
Now if we multiply the area of each one of these slices by $dy$, a tiny change in the $y$-direction, we will get a tiny slice of volume. For example, $4+2\mathrm{sin}\left(y\right)$ might represent the area of a slice, but $\left(4+2\mathrm{sin}\left(y\right)\right)dy$ represents the infinitesimal volume of that slice.
Using yet another integral, this time with respect to $y$, we can effectively sum up all those tiny volume slices to get the total volume under the surface:
Try it yourself! What do you get when you plug in the expression for ${\int }_{0}^{2}f\left(x,y\right)\phantom{\rule{0.167em}{0ex}}dx$ that you found above, and solve the second integral?
$\begin{array}{r}{\int }_{-\pi }^{\pi }\left({\int }_{0}^{2}\left(x+\mathrm{sin}\left(y\right)+1\right)dx\right)dy=\end{array}$

## Two choices in direction

You could also dissect the volume we are trying to find a different way. Take slices which represent constant $x$ values, instead of constant $y$ values, and add up the volume slices.
Concept check: Which of the following integrals represents the area of a constant-$x$-value slice?

Now imagine multiplying each of these areas by $dx$, a tiny step in the $x$-direction, which is perpendicular to the slice. This will give some kind of infinitesimal volume. By adding up all those infinitesimal volumes as $x$ ranges from $0$ to $2$, we will get the volume under the surface.
Concept check: Which of the following double-integrals represents the volume under the graph of our function
$f\left(x,y\right)=x+\mathrm{sin}\left(y\right)+1$
in the region where
$0\le x\le 2\phantom{\rule{0.278em}{0ex}}$ and $\phantom{\rule{0.278em}{0ex}}-\pi \le y\le \pi$?

Try it yourself!: Perform the double integral to compute the volume under the surface. (Of course, you already found the volume in the previous section, but it is edifying to see how it can be computed a second way).
$\begin{array}{r}{\int }_{0}^{2}\left({\int }_{-\pi }^{\pi }\left(x+\mathrm{sin}\left(y\right)+1\right)dy\right)dx=\end{array}$

Thankfully, this computation gives the same volume that we found in the previous section. Something would have to be wrong with our reasoning if it didn't.
In short, the order of integration does not matter. On the one hand, this might seem obvious, since either way you are computing the same volume. However, these are two genuinely different computations, so the fact that they equal each other turns out to be a useful mathematical trick.
For example, several proofs in probability theory involve showing that two quantities are equal by showing that both result from the same double integral, just computed in a different order.

## Another example

Consider the function
$f\left(x,y\right)=\mathrm{cos}\left(y\right){x}^{2}+1$
What is the volume under the graph of this function in the region where
$-1\le x\le 1$
and
$-\pi \le y\le \pi$?
Here what this volume looks like:
Concept check: Imagine cutting this volume under $f\left(x,y\right)=\mathrm{cos}\left(y\right){x}^{2}+1$ along the plane representing $y=1$. Which of the following integrals represents the area of that slice?

Practice: What do you get when you compute this integral for a general value of $y$, not just $y=1$?
$\begin{array}{r}{\int }_{-1}^{1}\left(\mathrm{cos}\left(y\right){x}^{2}+1\right)\phantom{\rule{0.167em}{0ex}}dx=\end{array}$

More practice: The expression you just found represents the area of slices of our volume representing constant $y$-values. Using this expression, set up an integral to find the volume under the surface, and solve the integral.
Final volume: $\phantom{\rule{1em}{0ex}}$

## Summary

• Given a two-variable function $f\left(x,y\right)$, you can find the volume between its graph and a rectangular region of the $xy$-plane by taking an integral of an integral,
This is called a double integral.
• You can compute this same volume by changing the order of integration:
The computation will look and feel very different, but it still gives the same result.

## Want to join the conversation?

• In the second question I really wish they had written the function like this:
x^2cos(y) to reduce the ambiguity of what is being passed to the cosine function!
• What is the main advantge of double integrals
• It's an extension of single variable integral to multi-variable integral, letting us compute volume in 3D under some function f(x,y) over some surface in the xy plane, which does not even have to be rectangular or square.
• Is integrate x^2/(x^2+y^2) with respect to x and y an example of non-exchangeable double integral? What is Fubini's rule mainly talk about?
• for Fubini's theorem, is this mainly, say, the y and x are dependent on each other? Thus we can't change
• Nope, It is that if the function is continuous in a certain region then the x and y can swap in the integration ;)

Come to the Hong Kong University and learn Dr. Ching Tak Wing's multivariable Calculus and you will get it!
(1 vote)
• How do we know this limit : "Since our volume is defined in the region where −π≤y≤π"
(1 vote)
• It is given below the picture with the red slice.
(1 vote)
• A tank was modeled in a pyramid shape of heght 4 using four different planes -4/3x-4y+z=-4 , 2x-4y+z=-4 ,2x+y+z=-4 and -4/3x+y+z=-4.can help me find how much water can tank afford using double integration?
(1 vote)
• integrate integrate (2 + 2y) dy from chi ^ 2 to 2 dx from 1 to 0
(1 vote)
• ...they lets or they let?
Which one is correct?
(1 vote)
• I'm little confused in changing the order of integration of double integral.
What are the steps to change the order of integration?
(1 vote)
• when is a double integral not an iterated integral

e.g why is the example below not an iterated integral

integral of ( integral of (x^2y)dx )dy with limits y=-x to y=1 and x=y to x=y^2