# Math Insight

### Double integrals as iterated integrals

#### Rectangular domain

We want to compute the double integral of $f(x,y)$ over the domain $\dlr$, where $\dlr$ is a rectangle with $a \le x \le b$ and $c \le y \le d$. Using the definition of the double integral, we could estimate the integral \begin{align*} \iint_\dlr f(x,y) dA \end{align*} with Riemann sums. We chop up the domain $\dlr$ in little rectangles.

If we pick the same $y_i$ for every rectangle in row $i$ and the same $x_j$ for every rectangle in column $j$, the Riemann sum for the integral is \begin{align} \sum_{i,j} f(x_{j}, y_{i}) \Delta x \Delta y. \label{Riemannsum} \end{align}

Now, here's the trick. We could add across the rows first, then add the rows. We would still get the same answer. In order words, for any given row $i$, we could sum across all columns $j$. If we ignore $\Delta y$ for the moment, the sum across all columns $j$ is \begin{align*} \sum_{j} f(x_{j}, y_{i}) \Delta x. \end{align*} If we let the $\Delta x$ shrink to zero (and the number of columns grow correspondingly to infinity), then this is exactly the Riemann sum for the one-dimensional integral, where we integrate $x$ from $a$ to $b$: \begin{align*} \int_{a}^{b} f(x,y_i) dx. \end{align*} We get a different value of this integral for each $y_i$, corresponding to the sum across row $i$. If we now multiply by $\Delta y$ and sum over all rows $i$ (as we need to get to the full Riemann sum of equation \eqref{Riemannsum}), we get another one-dimensional Riemann sum: \begin{align*} \sum_i \left(\int_{a}^{b} f(x,y_i) dx \right) \Delta y. \end{align*} If we let the $\Delta y$ shrink to zero (and the number of rows grow correspondingly to infinity), then the Riemann sum becomes another one-dimensional integral, where we integrate $y$ from $c$ to $d$: \begin{align*} \int_c^d \left(\int_a^b f(x,y) dx \right) dy. \end{align*}

This procedure was equivalent to summing across all of the rectangle, then letting $\Delta x$ and $\Delta y$ go to zero. So, we have just obtained another expression for the double integral: \begin{align*} \iint_\dlr f(x,y) dA = \int_c^d \left(\int_a^b f(x,y) dx \right) dy. \end{align*} We call this an iterated integral, because we simply iterate one-variable integration two times.

Of course, we could have added down the columns first, then added the columns together. This would result in an iterated integral in the reverse order: \begin{align*} \iint_\dlr f(x,y) dA = \int_a^b \left(\int_c^d f(x,y) dy \right) dx. \end{align*}

So, we now have two ways we turn the double integral \begin{align*} \iint_\dlr f(x,y) dA \end{align*} into one-variable integrals. In this way, we don't have to learn any more integration formulas to compute double integrals. This is similar to how we can compute partial derivatives by using our one-variable differentiation rules. The trick in computing partial derivatives was treating all the other variables as constant. As you'll see in the examples, we use a similar trick to compute iterated integrals.

We often drop the parentheses from iterated integrals, and write them, for example, as \begin{align*} \int_c^d \left(\int_a^b f(x,y) dx \right) dy = \int_c^d \int_a^b f(x,y) dx\, dy. \end{align*}

You can read an example of computing iterated integrals over rectangular domains.

We arbitrarily chose to sum across the rows first. We could just have easily chosen to sum across the columns first, which would have given us iterated integrals where we integrate with respect to $y$ first. One can switch between these two orders, which is referred to as changing the order of the integration.

#### Other domains

If the region $\dlr$ is not a rectangle, we can still convert the double integral into one or more iterated integrals. In this case, the limits of integration will be a little more complicated. Rather than attempt to introduce the general theory, we'll just present how to do these using examples.