Integrals in higher dimensions

Double integrals

Proposition 1. Let $R = [a, b] \times [c, d] \subseteq \R^2$, and suppose $f \colon R \to \R$ is continuous. Then \begin{equation}\tag{I}\label{e:fubini} \int_{y = c}^d \paren[\Big]{ \int_{x = a}^b f(x, y) \, dx } \, dy = \int_{x = a}^b \paren[\Big]{ \int_{y = c}^d f(x, y) \, dy } \, dx \,. \end{equation}

Remark 2. Let $F(x) = \int_c^d f(x, y) \, dy$, and $G(y) = \int_a^b f(x, y) \, dx$ and note that both $F$ and $G$ are continuous. So both the integrals above are defined.

Proof sketch. Let $\epsilon > 0$, and find $\delta > 0$ such that $|z - z’| < \delta \implies |f(z) - f(z’)| < \epsilon$. Choose partitions $P = (x_0 = a, \dots, x_M = b)$, $Q = (y_0 = c, \dots, y_N = d)$ such that $\norm{P}, \norm{Q} < \delta$ and show \begin{gather} \sum_{i, j} m_{i,j} (x_{i+1} - x_i) (y_{j+1} - y_j) \leq \int_c^d G(y) \, dy \leq \sum_{i, j} M_{i,j} (x_{i+1} - x_i) (y_{j+1} - y_j) \,\\ \sum_{i, j} m_{i,j} (x_{i+1} - x_i) (y_{j+1} - y_j) \leq \int_a^b F(x) \, dx \leq \sum_{i, j} M_{i,j} (x_{i+1} - x_i) (y_{j+1} - y_j) \,. \end{gather} Since the right and left hand sides differ by at most $\epsilon (b - a) (d - c)$, this implies \begin{equation} \abs[\Big]{ \int_a^b F(x) \, dx - \int_c^d G(y) \, dy } < \epsilon \,. \end{equation} Since $\epsilon > 0$ is arbitrary, this concludes the proof.

Definition 3. Let $R = [a, b] \times [c, d] \subseteq \R^2$, and suppose $f \colon R \to \R$ is continuous. Define \begin{equation} \int_R f(x, y) \, dx \, dy = \int_{y = c}^d \paren[\Big]{ \int_{x = a}^b f(x, y) \, dx } \, dy \end{equation}

Remark 4. This is called the double integral (or area integral) and it is often denoted by \begin{equation} \int_R f(x, y) \, dx \, dy = \iint_R f(x, y) \, dx \, dy = \iint_R f \, dA \,. \end{equation} (where the $dA$ is often called an area element). When writing $x = (x_1, x_2) \in \R^2$, another notation for the double integral is \begin{equation} \int_R f \, dA = \int_R f(x) \, dx\,. \end{equation}

Iterated integrals in $\R^d$

One can similarly define integrals in higher dimension by taking iterated integrals (in any order).

Definition 5. Let $a, b \in \R^d$ be such that $a_i \leq b_i$, and define the cell \begin{equation} I \defeq \set{ x \in \R^d \st a_i \leq x_i \leq b_i \quad \forall i \in \set{1, \dots, d}} \,. \end{equation} If $f \colon I \to \R$ is continuous, define $\int_I f \, dx$ to be the iterated integral \begin{equation} \int_I f \, dx = \int_{x_1 = a_1}^{b_1} \dots \int_{a_d}^{b_d} f(x) \, dx_d \, dx_{d-1} \dots \, dx_1 \,. \end{equation}

Remark 6. Using induction and Proposition 1 we see that the iterated integrals above can be done in any order.

Remark 7. When $d = 3$, $I \subseteq \R^3$ is a cube, and $\int_I f \, dx$ is the triple integral or volume integral, which is often denoted by \begin{equation} \int_R f(x, y, z) \, dx \, dy \, dz = \iiint_R f(x, y, z) \, dx \, dy \, dz = \iint_R f \, dV \,. \end{equation} (Here the $dV$ is often called an volume element.)

Proposition 1 shows the iterated integrals are equal if $f$ is continuous. It is true in more generality, and the general version of it is called Fubini’s theorem.

Theorem 8 (Fubini’s theorem). If $f$ is jointly measurable and either \begin{equation}\label{e:finiteness}\tag{F} \int_{y = c}^d \paren[\Big]{ \int_{x = a}^b \abs{f(x, y)} \, dx } \, dy < \infty \quad\text{or}\quad \int_{x = a}^b \paren[\Big]{ \int_{y = c}^d \abs{f(x, y)} \, dy } \, dx < \infty \end{equation} then \eqref{e:fubini} holds for Lebesgue integrals.

Fubini’s theorem is not quite true for Riemann integrals, as we don’t apriori know that the left and right hand sides are Riemann integrable. The proof of the Fubini theorem (for Lebesgue integrals) is beyond the scope of this course. There are some situation where restricting to continuous functions every time is too cumbersome, so we will use without proof the more general version.

Even if we do not check Riemann integrability, the finiteness condition \eqref{e:finiteness} is necessary and must be checked.

Integrals on general domains

Technically, so far we’ve only defined double integrals where the domain is a rectangle. For general domains we can define it as follows.

Definition 9. If $U \subseteq \R^d$ is bounded, find a cell $I \supseteq U$ and define \begin{equation} \int_U f \, dx = \int_R \one_U f \, dx \,, \end{equation} provided $\one_U f$ is Riemann integrable.

Remark 10. Even if $f$ is continuous, $\one_U f$ need not be Riemann integrable! If $\partial U$ is nasty, then $\one_U f$ may not be Riemann integrable, even if $f$ is continuous.

Definition 11 (Jordan measurability). A bounded domain $U \subseteq \R^d$ is called Jordan measurable if $\one_U$ is Riemann integrable.

Proposition 12. If $\partial U$ is a $d - 1$ dimensional (piecewise) $C^1$ manifold, then $U$ is Jordan measurable.

While the proof is accessible to us, we won’t do it in the interest of time.

Example 13 (Non-Jordan measurable domain). Since $\Q^2 \cap [0, 1]^2$ is countable, enumerate it as $\Q^2 \cap [0, 1]^2 = \set{q_1, q_2, \dots}$. Let $U = \cup_{n \in \N} B(q_n, \frac{1}{\pi 2^{n}})$. Then $U$ is not Jordan measurable.

Improper Integrals

When the function or domain isn’t bounded, we need to perform a limiting procedure to define the integral. This is known as improper integrals. A thorough treatment requires some care, and several tedious cases. We only do the simplest cases here. A comprehensive and thorough treatment can be found in standard analysis books (for instance Apostol’s book “Analysis”, or Rudin’s book “Principles of Analysis”).

Definition 14. If $U \subseteq \R^d$ is unbounded and $f \colon U \to \R$ is bounded, we define \begin{equation} \int_U f \, dx = \lim_{R \to \infty} \int_{B(0, R) \cap U} f \, dx \quad\text{provided}\quad \lim_{R \to \infty} \int_{B(0, R) \cap U} \abs{f} \, dx < \infty \,. \end{equation}

Definition 15. Say $U \subseteq \R^d$ is bounded, $a \in U$, $f \colon U - \set{a} \to \R$ is such that for every $\epsilon > 0$, $f \colon U - B(a, \epsilon) \to \R$ is bounded, then define \begin{equation} \int_U f \, dx = \lim_{r \to 0} \int_{U - B(0, r)} f \, dx \quad\text{provided}\quad \lim_{r \to 0} \int_{B(0, r) \cap U} \abs{f} \, dx < \infty \,. \end{equation}

If $U$ is unbounded and $f \to \infty$ at finitely many points (but is bounded otherwise) one can use a combination of the above two definitions. The standard results (linearity, comparison, etc) can easily be extended for improper integrals. Fubini’s theorem requires a little care.

Change of variable

Theorem 16 (Change of variables). Let $U, V \subseteq \R^d$ be two domains, and $\varphi \colon U \to V$ be $C^1$ and bijective. If $f \colon V \to \R$ is integrable, then \begin{equation}\label{e:C}\tag{C} \int_V f \, dx = \int_U f \circ \varphi \abs{\det D \varphi} \, dx \,. \end{equation}

Remark 17. The above theorem is true for Lebesgue integrals. For Riemann integrals, there are a few extra restrictions: One needs to assume $U, V$ are Jordan measurable, and either Riemann integrability of $f \circ \varphi \abs{\det \varphi}$ or invertibility of $D \varphi$.

Proof sketch. The proof of Theorem 16 for Riemann integrals requires more effort than it’s worth, and will be skipped. (You can find it in Rudin’s book for instance.) There is a cleaner and better proof for Lebesgue integrals that you will see later.

The intuition is as follows: First if $R$ is any rectangle, and $T:\R^2 \to \R^2$ is a linear transformation, then we know that \begin{equation} \area(R) = \abs{\det T} \end{equation} Now, divide $U$ into many small non-overlapping regions $R_{i,j}$ and set $R_{i,j}’ = \varphi(R_{i,j})$. Since $\varphi$ is bijective, the regions $R_{i,j}’$ must also be non-overlapping and cover all of $V$. If $R_{i,j}$ are small enough, $\varphi$ can be approximated by an affine function (using $D\varphi$) and hence we expect \begin{equation} \area(R’_{i,j}) \approx \area(R_{i,j}) \abs{\det D\varphi_{\xi_{i,j}}} \,, \end{equation} where $\xi_{i,j} \in R_{i, j}$ is some arbitrary point (say the center). Multiplying by $f$, summing and taking the limit as the size of the regions $R_{i,j}$ vanishes suggests \eqref{e:C}.

The role of bijectivity

In one dimension, $\det(D \varphi) = \varphi’$, and we recall the substitution rule only had $\det(D \varphi)$ without an absolute value, and did not require $\varphi$ to be bijective. This works because if $\varphi$ is not bijective, $\varphi’$ changes sign and compensates correctly in the change of variable formula. In higher dimensions this can’t be done so elegantly, and one has to explicitly check bijectivity.

Here is an example where the failure of bijectivity gives a “weird” result. Consider the coordinate change \begin{equation} \colvec{x\\y} = \varphi(u, v) = \colvec{u^2 - v^2\\2 u v }, \end{equation} for which $\abs{\det \varphi} = 4(u^2 + v^2) = 4(x^2 + y^2)^{1/2}$. By making $x, y$ arbitrarily large (or small) we can do the same for $u$ and $v$. So one might hastily write \begin{equation} \int_{\R^2} f(x, y) \, dx \, dy = 4 \int_{\R^2} f \circ \varphi(u, v) \, (u^2 + v^2) \, du \, dv. \end{equation} This doesn’t yield the right answer though! Indeed, choosing \begin{equation} f(x, y) = \frac{\exp\paren{-\sqrt{x^2 + y^2}}}{\sqrt{x^2 + y^2}} = \frac{\exp\paren{-(u^2 + v^2)}}{u^2 + v^2} \end{equation} yields \begin{equation} \int_{\R^2} f(x, y) \, dx \, dy = 2\pi \quad\text{and}\quad 4 \int_{\R^2} f \circ \varphi(u, v) \, (u^2 + v^2) \, du \, dv = 4\pi. \end{equation}

What failed here is exactly bijectivity. You can explicitly solve and check that for every $(x, y) \neq (0, 0)$ there exist exactly two values of $(u, v)$ for which $\varphi(u, v) = (x, y)$. Indeed, choosing \begin{equation} H = \set{ (u, v) \st u > 0 } \quad\text{and}\quad V = \set{(x, y) \st y \neq 0 \text{ or } x > 0 }, \end{equation} we see now that $\varphi:H \to V$ is a coordinate transformation. Of course $V$ is simply $\R^2$ with a half line removed, but $H$ is “half” of $\R^2$. With these domains, we of course have the identity \begin{equation} \int_{\R^2} f(x, y) \, dx \, dy = 4 \int_H f \circ \varphi(u, v) \, (u^2 + v^2) \, du \, dv, \end{equation} and you can explicitly verify this for the specific choice of $f$ above.

Examples and Problems

The finiteness condition \eqref{e:finiteness} is necessary, as shown by the following examples.

Example 18. Define \begin{equation} f(x, y) = -\partial_x \partial_y \tan^{-1}\paren[\big]{\frac{y}{x}} = \frac{x^2 - y^2}{(x^2 + y^2)^2}. \end{equation} Then \begin{equation} \int_{x = 0}^1 \int_{y = 0}^1 f(x, y) \, dy \, dx = \frac{\pi}{4} \quad\text{and}\quad \int_{y = 0}^1 \int_{x = 0}^1 f(x, y) \, dx \, dy = -\frac{\pi}{4} \end{equation}

Example 19. Let $f(x, y) = (x - y) / (x + y)^3$ if $x, y > 0$ and $0$ otherwise, and $U = (0, 1)^2$. The iterated integrals of $f$ over $U$ both exist, but are not equal.

Example 20. Define \begin{equation} f(x, y) = \begin{cases} 1 & y \in (x, x+1) \text{ and } x \geq 0\\ -1 & y \in (x-1, x) \text{ and } x \geq 0\\ 0 & \text{otherwise}. \end{cases} \end{equation} Then the iterated integrals of $f$ on the (unbounded) rectangle $\set{(x, y) \in \R^2 \st x > 0 }$ both exist and are not equal.

Problem 21. Let $B_2 = B(0, 1) \subseteq \R^2$. Directly compute the iterated integral $\int_{B_2} 1 \, dA$ and show that it equals $\pi$.

Problem 22. Let $B_3 = B(0, 1) \subseteq \R^3$. Directly compute the iterated integral $\int_{B_3} 1 \, dV$ and show that it equals $4\pi / 3$.

Problem 23. Let $U \subseteq \R^2$ be the interior of the triangle with vertices $(0, 0)$, $(1, 1)$, and $(0, 1)$ and $f(x, y) = e^{-y^2}$. Compute $\int_U f \, dA$.

Problem 24. Compute the integral \begin{equation} \int_{x = -1}^1 \int_{y = 1}^2 \sin(x y^2) \, dy \, dx \,. \end{equation}

Problem 25. Compute the integral \begin{equation} \int_{y = 0}^1 \int_{x = -\cos^{-1} y}^{\cos^{-1} y} e^{\sin x} \, dx \, dy \,. \end{equation}

Problem 26. Compute $\int_0^\infty \frac{\sin x}{x} \, dx$.

Hint. Substitute $1/x = \int_0^\infty e^{-xy} \, dy$ above and switch the order of integration. This is one situation where the hypothesis of Fubini’s theorem won’t be satisfied directly; so you will have to work a little to justify your steps.

Problem 27. Show that the improper integral $\int_0^1 \frac{dx}{x^p} < \infty$ if and only if $p < 1$.

Problem 28. Show that the improper integral $\int_1^\infty \frac{dx}{x^p} < \infty$ if and only if $p > 1$.

Theorem 29 (Taylor’s theorem). If $f\colon [a, b] \to \R$ is $C^{n+1}$, $x \in (a, b)$ then \begin{equation} f(x) = \sum_{k=0}^n \frac{(x - a)^k}{k!} f^{(k)}(a) + \int_a^x \frac{f^{(n+1)}(t)}{n!} (x - t)^n \, dt \,. \end{equation}

Proof sketch. For $n = 2$, note \begin{equation} f’(t) - f’(a) = \int_a^t f’’ (y) \, dy \,. \end{equation} Now integrate both sides from $t = a$ to $t = x$, and use Fubini’s theorem.

Theorem 30 (Leibniz rule). If $f \colon [a, b] \times [c, d] \to \R$ is $C^1$, then \begin{equation} \partial_y \int_a^b f(x, y) \, dx = \int_a^b \partial_y f(x, y) \, dx \,. \end{equation}

Problem 31. For $t > 0$ compute $\displaystyle \frac{d}{dt} \int_1^t \frac{e^{-s^2 t}}{s} \, ds$.

Remark 32 (Polar coordinates). Let $(x, y) = \varphi(r, \theta) = (r \cos \theta, r \sin \theta)$ be the polar coordinate transformation. Using previous computations we compute $\abs{\det D\varphi} = r$ and hence when transforming area integrals to polar coordinates, we replace $dx \, dy$ with $r \, dr \, d\theta $.

Example 33. Use polar coordinates to compute the area of a circle of radius $r$.

Problem 34. Show $\int_{x^2 + y^2 > 1} \frac{1}{(x^2 + y^2)^{p/2}} \, dA < \infty$ if and only if $p > 2$.

Problem 35. Show $\int_{-\infty}^\infty e^{-x^2} \, dx = \sqrt{\pi}$.

Hint. Use polar coordinates to compute $\int_{\R^2} e^{-(x^2 + y^2)} \, dA$.

Remark 36 (Spherical coordinates). Let \begin{equation} (x, y, z) = \varphi( r, \theta, \phi) = (r \sin \phi \cos \theta, r \sin \phi \sin \theta, r \cos \phi ) \,, \end{equation} From homework we know $\abs{\det D\varphi} = r^2 \sin \phi$, and hence when transforming volume integrals into spherical coordinates we replace $dV$ with $r^2 \sin \phi \, dr \, d\phi \, d\theta$.

Example 37. Use spherical coordinates to compute the volume of a solid sphere.

Problem 38. Show $\int_{x^2 + y^2 + z^2> 1} \frac{1}{(x^2 + y^2 + z^2)^{p/2}} \, dV < \infty$ if and only if $p > 3$.

Example 39. Compute the volume of a cylinder.

Problem 40. Let $U \subseteq \R^2$ be a (bounded) oddly shaped region containing the origin. Define $C \subseteq \R^3$ to be the cone with vertex $(0, 0, h)$ and base $U$ given by \begin{equation} C = \set[\Big]{ (x, y, z) \st 0 < z < h,\; \paren[\Big]{ \frac{hx}{h - z}, \frac{hy}{h - z} } \in U} \end{equation} Find $\vol(C)$ in terms of $h$ and $\area(U)$.

Hint. Let $u = hx / (h - z)$, $v = hy / (h - z)$ and $w = z$, and transform $\int_C 1 \, dx \, dy \, dz$ into $u$, $v$, $w$ coordinates.