4.3. Iterated Integrals

$\newcommand{\R}{\mathbb R }$ $\newcommand{\N}{\mathbb N }$ $\newcommand{\Z}{\mathbb Z }$ $\newcommand{\bfa}{\mathbf a}$ $\newcommand{\bfb}{\mathbf b}$ $\newcommand{\bfc}{\mathbf c}$ $\newcommand{\bft}{\mathbf t}$ $\newcommand{\bff}{\mathbf f}$ $\newcommand{\bfF}{\mathbf F}$ $\newcommand{\bfk}{\mathbf k}$ $\newcommand{\bfg}{\mathbf g}$ $\newcommand{\bfG}{\mathbf G}$ $\newcommand{\bfh}{\mathbf h}$ $\newcommand{\bfu}{\mathbf u}$ $\newcommand{\bfv}{\mathbf v}$ $\newcommand{\bfx}{\mathbf x}$ $\newcommand{\bfp}{\mathbf p}$ $\newcommand{\bfy}{\mathbf y}$ $\newcommand{\ep}{\varepsilon}$

4.3. Iterated Integrals

  1. The basic theorem about iterated integrals
  2. Integrating over sets other than rectangles
  3. Examples
  4. Problems

The basic theorem about iterated integrals

The following is the main theorem that we tells us how to compute multi-variables integrals in practice. The point is that it reduces integration over $2$- and higher-dimensions regions to (repeated) $1$-d integrations, which we in principle know how to evaluate, at least some of the time.

Theorem 1. Assume that $R = [a,b]\times [c,d]$ is a rectangle in the $x$-$y$ plane. Let $f$ be a function on $R$, and assume that

  1. $f$ is integrable on $R$.
  2. For every $y\in [c,d]$, the function $f_y:[a,b]\to \R$ defined by $f_y(x) := f(x,y)$ is integrable on $[a,b]$.
  3. The function $g:[c,d]\to \R$ defined by $g(y) := \int_a^b f(x,y)\,dx$ is integrable on $[c,d]$.

Then \begin{equation}\label{ft} \iint_R f\, dA %= \int_c^d g(y) dy = \int_c^d \left(\int_a^b f(x,y)\,dx\right)dy \ . \end{equation}

In the above equation, $\int_a^b f(x,y)\,dx$ means that we consider $y$ to be a constant, and we integate $f(x,y) = f_y(x)$. If this seems unclear, take a look at a few of the examples presented below.

Remark 1. There are three integrals in formula \eqref{ft}: a $2$-dimensional integral $\iint \cdots dA$ on the left, and two $1$-dimensional integrals on the right. Assumptions 1 - 3 of the theorem are exactly what is needed in order to guarantee that all of these integrals make sense.

Remark 2. If the roles of $x$ and $y$ are reversed in hypotheses 2 and 3, then the conclusion \eqref{ft} also holds with the roles of $x$ and $y$ reversed. As a result, $$ \int_a^b \left(\int_c^d f(x,y)\,dy\right)dx \ = \ \iint_R f\, dA \ = \ \int_c^d \left(\int_a^b f(x,y)\,dx\right)dy \ $$ whenever all the integrals appearing in the formula make sense (that is, all the integrands are integrable).

You will prove Theorem 1 in a future homework assignment, so we will not discuss the proof in these notes.

It follows from theory developed in Sections 4.2 that all the hypotheses of the above theorem will in practice be satisfied in almost every integral we eoncounter in this class (generally, integrals of continuous functions on compact sets whose boundaries have content zero), with the exception of an example intended to demonstrate things that can go wrong if the hypotheses are not all satisfied --- see the questions at the end of this section.

Remark 3. A generalization of Theorem 1 holds for integrals in $n$ dimensions, for any $n\ge 3$. The hypotheses have the same character but are more complicated to state, and in practice are satisfied by more or less every integral we will meet in this class.

Example 1. Let $R := [0,1]\times [0,1]$, and compute $$ \iint_R x\cos(xy)\, dA. $$

Solution. According to Theorem 1, $$ \iint_R x\cos(xy)\, dA \ = \ \int_0^1\left( \int_0^1 x\cos(xy)\, dx\right)dy \ = \ \int_0^1\left( \int_0^1 x\cos(xy)\, dy\right)dx. $$ Which of these two iterated integrals is easier to evaluate? Let's try both. First, $$ \begin{aligned} \int_0^1\left( \int_0^1 x\cos(xy)\, dy\right)dx &= \int_0^1 \left( \sin(xy)\Big|_{y=0}^{y=1}\,\right) \ dx \\ &= \int_0^1 \sin(x) \ dx \\ &= 1-\cos(1) . \end{aligned} $$ Note that after we carry out the first integral $\int_0^1 x\cos(xy)\, dy$, the result, $\sin(x)$, is a function only of $x$; we have integrated out all the dependence on $y$.

If we do the integrals in the other order, we get $$ \begin{aligned} \int_0^1\left( \int_0^1 x\cos(xy)\, dx\right)dy &= \int_0^1 \left( \frac xy \sin(xy) +\frac 1{y^2}\cos(xy) \right)_{x=0}^{x=1} \ dy \\ &= \int_0^1 \frac 1 y \sin(y) + \frac 1{y^2}(\cos(y) -1) \ dy . \end{aligned} $$ One can check that it is integrable and that its integral equals $1-\cos(1)$, but neither of these claims is at all obvious. Since we have already found the answer by integrating in the other order, we are not obliged to worry about it.

But see here for more, if you are interested.

The key points are

Note also that, again, after we integrate $\int_0^1 x\cos(xy)\, dx$, the result is a function of $y$ alone; we have integrated out all of the dependence on $x$.

Integrating over sets other than rectangles

The chief difficulty one encounters, in practice, arises when integrating over a set $S$ that is not a rectangle. If $S$ has the form \begin{equation}\label{S1} S = \{(x,y)\in \R^2 : a\le x \le b, \phi(x) \le y \le \psi(x)\} \end{equation} for some continuous functions $\phi, \psi:[a,b]\to \R$ , then $$ \iint_S f\, dA = \int_a^b \left( \int_{\phi(x)}^{\psi(x)} f(x,y) dy\right)dx $$ Similarly it is straightforward to write down a suitable interated integral when the set $S$ is described as $S = \{(x,y)\in \R^2 : c\le y \le d, \phi(y) \le x \le \psi(y)\}$.

The difficulty is that $S$ is ususally not described in a convenient form such as \eqref{S1}. So the challenge one often ecounters is, given a set $S$, translate its description into a set of inequalities, such as $$ (x,y)\in S \qquad\qquad \iff \qquad \qquad \left\{ \begin{array}{c} a\le x\le b\\ \phi(x)\le y \le \psi(x) \end{array} \right. $$ or maybe $$ (x,y)\in S \qquad\qquad \iff \qquad \qquad \left\{ \begin{array}{c} c\le y\le d\\ \phi(y)\le x \le \psi(y) . \end{array} \right. $$ It may be necessary to split a set $S$ into mutiple pieces, each one of which is expressed by inequalities of the above form.

The same issues arise in higher dimensions, except that they become more difficult. For example, given a set $S \subset \R^3$, to write iterated integrals over $S$, it is necessary to translate description of $S$ into inequalities $$ (x,y,z)\in S \qquad\qquad \iff \qquad \qquad \left\{ \begin{array}{c} a\le x\le b\\ \phi(x)\le y \le \psi(x)\\ \Phi(x,y)\le z \le \Psi(x,y) \end{array} \right. $$ or similar inequalities with the roles of $x,y,z$ permuted in some way.

The rest of this section consists of examples. Many of them will focus on how to set up integrals, rather than how to carry them out (which in some examples we will omit entirely), since setting them up is the new element here.

Examples

Example 2.

Let $S$ be the subset of $\R^2$ that is bounded by the curves $y=\frac 12 x^2$ and $y=x^2-2$, and let $f:S\to \R$ be continuous. Express $\iint_S f \, dA$ as an interated integral in two different ways.

It is often helpful to draw a picture:

Ex4.3.2$\qquad\qquad$

$S$ is the region between the two parabolas. First, we have to determine the points where the curves intersect. Both equations $y=x^2-2$ and $y=\frac 12 x^2$ are satisfied at these points, so clearly $x^2-2 = y = \frac 12x^2$. We solve to find that $(x,y) =(\pm 2, 2)$. (We can see this in the picture, but had we drawn by hand, we would not know where to put the intersection points without reasoning as above.)

For $-2\le x\le 2$, we can see that $x^2-2 \le \frac 12 x^2$, so between the two curves means above $ x^2-2$ and below $\frac 12 x^2$. We conclude that $$ (x,y)\in S \quad \iff \quad \left\{ \begin{array}{c} -2\le x\le 2 \\ x^2-2\le y \le \frac 12 x^2 \end{array} \right. $$

and thus $$ \iint_S f(\bfx)\, dA = \int_{-2}^{2} \int_{x^2-2}^{\frac 12 x^2} f(x,y)\, dy\,dx. $$ Note that, if you start by drawing a careful sketch, you can probably figure this out from looking at your picture.

Writing the $\iint_S\, dA$ as an interated integal in the opposite order is more complicated. (So if you are just asked to evaluate the integral you should probably write it as above, unless there is a very good reason for doing otherwise.)

First, we have express the curves that comprise $\partial S$ in the form $x = f(y)$. This is straightforward:

$$ y = x^2 - 2 \quad \iff \quad x = \pm \sqrt{y+2} \qquad \qquad\mbox{(and }y\ge -2\mbox{),} $$ $$ y = \frac 12 x^2 \quad \iff \quad x = \pm \sqrt{2y} \qquad \qquad\mbox{(and }y\ge 0\mbox{),} $$

Next, it is convenient to split $S$ into 3 sub-regions --- the part below the $x$-axis, and the parts in the first and the second quadrants --- since in each of these regions, the range of $x$ (as a function of $y$) has a different description.

1. Below the $x$-axis:

$$ (x,y)\in S\mbox{ and }y\le 0 \qquad \iff \qquad \quad \left\{ \begin{array}{c} -2\le y\le 0 \\ -\sqrt{y+2} \le x \le\sqrt{y+2} . \end{array} \right. $$

2. Second quadrant:

$$ (x,y)\in S \cap \mbox{second quadrant} \qquad \iff \qquad \quad \left\{ \begin{array}{c} 0\le y \le 2 \\ -\sqrt{y+2} \le x \le -\sqrt{2y}\ . \end{array} \right. $$

3. First quadrant:

$$ (x,y)\in S \cap \mbox{first quadrant} \qquad \iff \qquad \quad \left\{ \begin{array}{c} 0\le y \le 2 \\ \sqrt{2y} \le x \le \sqrt{y+2}\ . \end{array} \right. $$

Putting these together, we conclude that $ \iint_S f(\bfx)\, dA $ can be written as $$ \int_{-2}^0 \int_{-\sqrt{y+2}}^{\sqrt{y+2}} f(x,y)\, dx\,dy+ \int_0^2 \int_{-\sqrt{y+2}}^{-\sqrt{2y}} f(x,y)\, dx\, dy + \int_0^2 \int_{\sqrt{2y}}^{\sqrt{y+2}} f(x,y)\, dx\, dy . $$

Example 3

Consider the integral $$ \int_1^4 \int_2^{8/y} f(x,y)\, dx\, dy.
$$

Rewrite this in the forms $\iint_S f\, dA$ (that is, determine the region $S$) and $\int_a^b \int_{\phi(x)}^{\psi(x)} f(x,y) \, dy\, dx$.

From looking at the limits of integration, we can see that $$ (x,y)\in S \qquad \iff \qquad \quad \left\{ \begin{array}{c} 1\le y \le 4 \\ 2 \le x \le 8/y . \end{array} \right. $$

In other words, the integral can be written as $$ \iint_S f\ dA, \quad\mbox{ where } S :=\{(x,y) : 1\le y \le 4, \ 2\le x \le 8/y\}. $$ The easiest way to change the order of integration is to draw a picture and stare at it. (To understand the problem, you should do this.) But by just looking at the inequalities, it is also possible to figure out that $$ (x,y)\in S \qquad \iff \qquad \quad \left\{ \begin{array}{c} 2\le x \le 8 \\ 1 \le y \le 8/x . \end{array} \right. $$ Thus we can also write the integral as $$ \int_2^8 \int_1^{8/x} f(x,y)\, dy\, dx.
$$

Example 4

An interesting class of examples involves iterated integrals that look impossible as written, but that become possible once one exchanges the order of integration. Consider $$ \int_0^1 \int_y^1 e^{x^2} dx \, dy. $$ The antiderivative of $e^{x^2}$ is not an elementary function. However, from looking at the limits of integration, we can see that we are asked to integrate over a region --- call it $S$ --- defined by the inequalities $$ (x,y)\in S \qquad \iff \qquad \left\{ \begin{array}{c} 0\le y \le 1\\ y \le x \le 1 \end{array} \right. $$ and this is the same as $$ (x,y)\in S \qquad \iff \qquad \left\{ \begin{array}{c} 0\le x \le 1\\ 0 \le y \le x \ . \end{array} \right. $$ This can be seen either by sketching $S$ or else just by manipulating the inequalities, as in the previous example. It follows that $$ \int_0^1 \int_y^1 e^{x^2} dx \, dy = \int_0^1 \int_0^x e^{x^2}\, dy\, dx. $$ Now the iterated integral on the right can be computed easily: $$ \int_0^1\int_0^x e^{x^2}\, dy\, dx = \int_0^1 x e^{x^2} dx = \frac 12 \int_0^1 e^u\, du = \frac 12 (e-1). $$

For more examples of this sort, see the exercises.

Example 5

Compute the integral of $f(x,y,z) = 1$ over the (closed) $3$-dimensional ball of radius $R$, that is, the set $$ S = \overline B(R, {\bf 0}) = \{ (x,y,z)\in \R^3 : x^2+y^2+z^2 \le R^2\}. $$ (It does not matter whether we consider the open ball or the closed ball, since the boundary is a set of zero content, but I am used to writing the inequalities as $\le$ rather than $<$, so I have a mild preference for closed.)

First we have to set up the integral. Since $x,y,z$ appear appear in a symmetrical way in both $f$ and $S$, the order of integration should not matter. So we can choose (arbitrarily) to write $$ (x,y,z)\in S \qquad\qquad \iff \qquad \qquad \left\{ \begin{array}{c} a\le z\le b\\ \phi(z)\le y \le \psi(z)\\ \Phi(y,z)\le x \le \Psi(y,z) \end{array} \right. $$ First we consider the range of $z$. Clearly, the smallest and largest possible values of $z$ in the set $S$ are $z = -R$ and $z=R$ respectively. We can see this either from drawing a picture, or from noting that $z^2 \le R^2 - x^2 - y^2 \le R^2$, and that points where $x,y$ both equal $0$ (hence $z^2=R^2$) belong to $S$. Thus \begin{equation}\label{zrange1} -R\le z \le R \end{equation} About the range of $y$, we know that $y^2 \le R^2 - z^2 - x^2$. If we know the value of $z$ but not that of $x$, then the extreme case occurs when $x=0$, leading to $z^2 = R^2-y^2$, hence \begin{equation}\label{yrange1} -\sqrt{R^2-z^2}\le y \le \sqrt{R^2-z^2} \end{equation} Finally, it is then easy to see that \begin{equation}\label{xrange1} -\sqrt{R^2-y^2-z^2}\le x \le \sqrt{R^2-y^2-z^2} \end{equation} Thus $$ \iiint_S 1\, dV = \int_{-R}^R \int_{-\sqrt{R^2-z^2}}^{\sqrt{R^2-z^2}} \int_{-\sqrt{R^2-z^2-y^2}}^{\sqrt{R^2-z^2-y^2}}1 \ dx\,dy\,dz. $$ We now carry out the integration. The innermost intergral is easy, leading to $$ \iiint_S 1\, dV =2 \int_{-R}^R \int_{-\sqrt{R^2-z^2}}^{\sqrt{R^2-z^2}}\sqrt{R^2-z^2-y^2}\, dy\,dz. $$ To evaluate this, we remember that in general $ \int_{-\alpha}^\alpha \sqrt{\alpha^2- t^2}\, dt $ can be evaluated by the substitution $t = \alpha\sin \theta$, with $-\pi/2\le \theta \le \pi/2$, leading to

$$ \int_{-\alpha}^\alpha \sqrt{\alpha^2- t^2}\, dt = \alpha^2 \int_{-\pi/2}^{\pi/2} \cos^2 \theta \, d\theta = \frac\pi 2 \alpha^2. $$ Substituting this into our above computation of $\iiint_S 1\, dV$ (with $\alpha = \sqrt{R^2-z^2}$ it is easy to complete the integral and find that $$ \iiint_S 1\, dV \ = \ \frac 43\pi R^3 . $$

Problems

Basic skills

  1. For the following sets $S$, write down an iterated integral that corresponds to $\iint_S f\, dA$. For some of these, it may be necessary to divide $S$ into two or more pieces, as in Example 2.

  2. For the following iterated integrals, determine the set $S\subset\R^2$ corresponding to the region of integration, and rewrite the integral after changing the order of integration. For some of these, it may be necessary to divide $S$ into two or more pieces.

  3. Evaluate the following integrals. It may be necessary to change the order of integration in order to do so.

Other questions

  1. For $x,y\ge 0$, define $$ f(x,y) := \begin{cases}y^{-2}&\mbox{ if }y>x>0 \\ -x^{-2} &\mbox{ if } x>y>0 \\ 0 &\mbox{ if }x=y\mbox{ or }xy=0. \end{cases} $$ Compute
    $$ \int_0^1 \int_0^1 f(x,y) \, dx\, dy \qquad\mbox{ and } \qquad \int_0^1 \int_0^1 f(x,y) \, dy\, dx. $$ (In the process of doing this, you will see that these iterated integrals are well-defined, in the sense that every function you have to integrate is in fact integrable.) Are they equal?

  2. Prove Theorem 1. (You will do this in Homework 2.2, with the proof being divided into several smaller questions.)

    $\Leftarrow$  $\Uparrow$  $\Rightarrow$