Subsection 4.3 Calculating double integrals
To understand how to calculate a double integral, we'll take a deep dive into an example. Let \(\mathcal{R}\) be the region in \(\R^2\) above \(y = 0\text{,}\) below \(y = \ln x\text{,}\) and to the left of \(x = e^2\text{;}\) here's a sketch of the region:
We'd like to understand how to evaluate \(\displaystyle \iint_{\mathcal{R}} f(x, y)\,dA\) for an arbitrary 2-variable function \(f\text{.}\) The key is that this double integral can be rewritten in terms of single integrals. To understand why this is, let's go back to the definition of double integrals, which says \(\displaystyle \iint_{\mathcal{R}} f(x, y)\,dA\) is the result of a process:
We first slice the region \(\mathcal{R}\) into small pieces; here, we'll use rectangles of width \(\Delta x\) and height \(\Delta y\text{:}\) 4
On each slice, we pick a point \((x, y)\) and calculate \(f(x, y) \Delta A\) where \(\Delta A\) is the area of the slice. Since most of the pieces are rectangles of width \(\Delta x\) and height \(\Delta y\text{,}\) they have \(\Delta A = \Delta x \Delta y\text{;}\) even for the pieces that are not complete rectangles, it's reasonable to approximate \(\Delta A\) by \(\Delta x \Delta y\text{,}\) as this approximation will become more accurate once we take the limit as \(\Delta x \to 0\) and \(\Delta y \to 0\text{.}\)
We sum these values of \(f(x, y) \Delta A\text{,}\) one value per slice, and \(\displaystyle \iint_{\mathcal{R}} f(x, y)\,dA\) is the limit of these sums as \(\Delta x \to 0\) and \(\Delta y \to 0\text{.}\) That is,
\begin{equation}
\iint_{\mathcal{R}} f(x, y)\,dA = \lim_{\Delta x \to 0} \lim_{\Delta y
\to 0} \mathop{\sum \sum}_{\text{one } (x, y) \text{ per slice}} f(x,
y) \Delta x \Delta y\label{xml-eq-double-integral-handout-generic}\tag{4.1}
\end{equation}
The key insight is that, in the double Riemann sum, we can add up the values \(f(x, y) \Delta x \Delta y\) in any order we want. So, for instance, we could add up the values in each column first, get one result per column, and add up those results. So, we can rewrite (4.1) as
\begin{equation}
\iint_{\mathcal{R}} f(x, y)\,dA = \lim_{\Delta x \to 0}
\lim_{\Delta y \to 0} \sum_{\text{one } x \text{ per column}}
\left( \sum_{\text{one } y \text{ per slice in column of } x}
f(x, y) \Delta y \right) \Delta x\label{xml-eq-double-integral-handout-one-column}\tag{4.2}
\end{equation}
Let's think about the inner sum, where we've fixed a value of \(x\) and are summing \(f(x, y) \Delta y\) for one \(y\) per slice in the column. Here's a picture of one such column:
The sum \(\displaystyle \sum_{\text{one } y \text{ per slice in column of } x} f(x,
y) \Delta y\) is a Riemann sum in \(y\text{,}\) so when we take the limit of this Riemann sum as \(\Delta y \to 0\text{,}\) we'll get a definite integral of the form \(\displaystyle \int_?^? f(x, y)\,dy\text{.}\) What are the bounds of the integral? From the picture, we see that we've sliced \(y\)-values from \(y = 0\) to \(y = \ln x\) (remember that we're looking at a fixed \(x\)), so these are the bounds. That is,
\begin{equation*}
\lim_{\Delta y \to 0} \sum_{\text{one } y \text{ per slice in column of
} x} f(x, y) \Delta y = \int_0^{\ln x} f(x, y)\,dy.
\end{equation*}
Plugging this into (4.2),
\begin{equation}
\iint_{\mathcal{R}} f(x, y)\,dA = \lim_{\Delta x \to 0} \sum_{\text{one
} x \text{ per column}} \left( \int_0^{\ln x} f(x, y)\,dy \right)
\Delta x\label{xml-eq-double-integral-handout-outer}\tag{4.3}
\end{equation}
But notice that this is now the limit of a Riemann sum in \(x\text{,}\) so it can be rewritten as an integral in \(x\text{!}\) What are the bounds of \(x\text{?}\) We're summing over one \(x\) per column, and the columns go from \(x = 1\) to \(x = e^2\text{,}\) so (4.3) becomes
\begin{equation}
\iint_{\mathcal{R}} f(x, y)\,dA = \int_1^{e^2} \left( \int_0^{\ln x}
f(x, y)\,dy \right)\,dx \label{xml-eq-double-integral-handout-iterated1}\tag{4.4}
\end{equation}
Thus, we've rewritten \(\displaystyle \iint_{\mathcal{R}} f(x, y)\,dA\) in terms of single integrals. Let's see an example of how to use this.
Example 4.1
Let's calculate \(\displaystyle \iint_{\mathcal{R}} (x^2 + e^y)\,dA\) for the region \(\mathcal{R}\) we've been looking at.
Solution
By (4.4),
\begin{align*}
\iint_{\mathcal{R}} (x^2 + e^y)\,dA \amp = \int_1^{e^2} \left(
\int_0^{\ln
x} (x^2 + e^y)\,dy \right) dx \\
\end{align*}
As we said already, in the inner integral, \(x\) should be thought of as constant (because we're integrating over a column of the region, where \(x\) is constant) and \(y\) is the variable:
\begin{align*}
\amp = \int_1^{e^2} \left( x^2 y + e^y \Big|_{y=0}^{y=\ln x} \right) dx \\
\amp = \int_1^{e^2} \left( x^2 \ln x + x - 1 \right)\,dx \\
\end{align*}
Using integration by parts to integrate \(x^2 \ln x\text{,}\) this evaluates to:
\begin{align*}
\amp = \frac{5 e^6}{9}+\frac{e^4}{2}-e^2+\frac{11}{18}
\end{align*}
The expression \(\displaystyle \int_1^{e^2} \left( \int_0^{\ln x} f(x, y)\,dy \right)\,dx\) is called an iterated integral, and we can also write it without parentheses as \(\displaystyle \int_1^{e^2} \int_0^{\ln x} f(x, y)\,dy \,dx\text{.}\)
If you look back at how we rewrote \(\displaystyle \iint_{\mathcal{R}} f(x, y)\,dA\) as an iterated integral, you'll remember that it came from adding up the values \(f(x, y) \Delta A\) in a particular order: columns first. Of course, we could have instead chosen to add rows first. Let's see what would happen if we had made that choice. Then, instead of (4.2), we could have written
\begin{equation}
\iint_{\mathcal{R}} f(x, y)\,dA = \lim_{\Delta x \to 0}
\lim_{\Delta y \to 0} \sum_{\text{one } y \text{ per row}}
\left( \sum_{\text{one } x \text{ per slice in row of } y}
f(x, y) \Delta x \right) \Delta y\label{xml-eq-double-integral-handout-one-row}\tag{4.5}
\end{equation}
Here's a picture of one row (with a fixed \(y\)):
From the picture, we can see that this row involves \(x\)-values from \(e^y\) (because the left end of the row is on \(y = \ln x\text{,}\) which can be rewritten as \(x = e^y\)) to \(e^2\text{,}\) so when we take the limit as \(\Delta x \to 0\) of the inner Riemann sum, we get the definite integral \(\displaystyle \int_{e^y}^{e^2} f(x, y)\,dx\text{.}\) When we sum over all rows, \(y\) varies from \(0\) to \(2\text{,}\) so we end up rewriting
\begin{equation}
\iint_{\mathcal{R}} f(x, y)\,dA = \int_0^2 \int_{e^y}^{e^2} f(x,
y)\,dx\,dy\label{xml-eq-double-integral-handout-iterated2}\tag{4.6}
\end{equation}
Example 4.2
Let's calculate \(\displaystyle \iint_{\mathcal{R}} (x^2 + e^y)\,dA\) again using (4.6).
Solution
(4.6) says
\begin{align*}
\iint_{\mathcal{R}} (x^2 + e^y)\,dA \amp = \int_0^2 \int_{e^y}^{e^2}
(x^2
+ e^y)\,dx\,dy \\
\end{align*}
This time, in the inner integral, \(y\) is thought of as constant and \(x\) is the variable:
\begin{align*}
\amp = \int_0^2 \left( \left. \frac{x^3}{3} + x e^y
\right|_{x=e^y}^{x=e^2}
\right) dy \\
\amp = \int_0^2 \left( \frac{e^6}{3} + e^2 e^y - \frac{e^{3y}}{3} -
e^{2y}
\right)\,dy \\
\amp = \left. \frac{e^6}{3} y + e^2
e^y - \frac{e^{3y}}{9} - \frac{e^{2y}}{2} \right|_{y=0}^{y=2} \\
\amp = \frac{5e^6}{9} + \frac{e^4}{2} - e^2 + \frac{11}{18}
\end{align*}
This is of course the same answer that we got in Example 4.1, but notice that this time we didn't need integration by parts. This illustrates one reason it can be useful to have multiple ways to convert a double integral to an iterated integral; sometimes, one iterated integral is easier to evaluate than another.