6  Integrating Functions of Several Variables

Up till now we have considered integrals of functions of one variable, such as \[\int_{0}^{2} x^2 \odif{x}.\] We will now begin to study integrals in multiple variables. Before getting into the formalities, let’s begin with an example.

💪 Try it out
Consider the function \[f(x,y) = 2x^{2}y^{3}+2y.\] If we want to compute the integral of \(f(x,y)\) with respect to the variable \(y\), between the limits \(y = 0\) and \(y = 2\), then we can treat all any occurrence of \(x\) as a constant (with respect to \(y\)) and thus obtain \[\int_{0}^{2}(2x^{2}y^{3}+2y)\odif{y} = \left[\frac{x^{2}y^{4}}{2}+y^{2}\right]_{y=0}^{y=2} = 8x^{2}+4.\] Observe that the outcome of this integration is a function of \(x\) alone (because we have “integrated out” \(y\)). This can, in turn, be integrated with respect to \(x\), say between the limits \(x = 0\) and \(x = 1\), to obtain \[\int_{0}^{1}(8x^{2}+4)\odif{x} = \left[8\frac{x^{3}}{3}+4x\right]_{x=0}^{x=1} = \frac{8}{3}+4\,=\,\frac{20}{3}.\] This is an example of a repeated (or double) integral and can be written as a single expression \[\int_{0}^{1}\int_{0}^{2}(2x^{2}y^{3}+2y)\,\odif{y}\,\odif{x}=\frac{20}{3}\,,\] with the convention that the ordering of \(\odif{y}\odif{x}\) tells us to do the \(y\)-integral – i.e. the innermost integral – first. As we shall see, the integral can be interpreted to be the “volume under the surface described by \(f(x,y)\) which lies over the rectangular region \(\{(x,y) \in \mathbb{R}^2 \mid 0 \leq x \leq 1, \, 0 \leq y \leq 2 \}\).”

We can even allow the limits on the first integration (with respect to \(y\) in this case) to depend on the other variable (in this case, \(x\)), so that we can integrate over more complicated regions in \(\mathbb{R}^2\).

💪 Try it out
Compute the double integral \[\int_{0}^{1}\int_{0}^{x}(2x^{2}y^{3}+2y)\,\odif{y}\,\odif{x}.\] Notice, in particular, that the \(y\)-limits are now \(0 \leq y \leq x\).

Answer:

Integration with respect to \(y\) gives \[\int_{0}^{x}(2x^{2}y^{3}+2y) \, \odif{y} = \left[\frac{x^{2}y^{4}}{2}+y^{2}\right]_{y =0}^{y=x} = \frac{x^{6}}{2}+x^{2},\] and then integration with respect to \(x\), with limits \(0 \leq x \leq 1\), gives \[\int_{0}^{1} \left(\frac{x^{6}}{2}+x^{2} \right)\odif{x} = \left[\frac{x^{7}}{14}+\frac{x^{3}}{3} \right]_{x=0}^{x=1} = \frac{1}{14}+\frac{1}{3}\,=\,\frac{17}{42} \,.\] In this case, the region of integration is a (right-angled) triangle with base the interval \([0,1]\) and hypotenuse along the line \(y=x\).

What we have just done is the basic idea of integration in multiple dimensions! But what does it mean?

6.1 Interpretation as volume under a surface

Recap of the one-dimensional (Riemann) integration

Recall that the area under a curve \(f(x)\) between \(x=a\) and \(x=b\) is given by \[S=\int_{a}^{b}f(x)\odif{x}.\] To approximate this area, we partition the interval \([a,b]\) into \(N\) subintervals of length \(\delta x_{1},\delta x_{2}, \ldots, \delta x_{N}\), respectively, and let \(x_{i}\) be the point midway along the \(i^\text{th}\) subinterval. Then the area is approximately given by the sum of the area of all the rectangles of height \(f(x_{i})\) and width \(\delta x_{i}\): \[S\approx\sum_{i=1}^{N}f(x_{i}) \, \delta x_{i}.\] To find the integral we take the limit as \(N\rightarrow\infty\) \[S=\lim_{N\rightarrow\infty}\left(\sum_{i=1}^{N}f(x_{i}) \, \delta x_{i}\right) =\int_{a}^{b}f(x)\odif{x}.\]

Extension to two-dimensional (Riemann) integration

Suppose we want to calculate the volume under a surface whose height is given by \(f(x,y)\). Let the region in the \(xy\)-plane that we want to integrate over be \(R\) so that we might guess that \[V=\iint_{R}f(x,y)\,\odif{A}.\] To see that this is indeed the volume, approximate the volume by dividing the integration region into \(N\) subregions of area \(\delta A_{1},\delta A_{2}\ldots\delta A_{N}\), respectively. Let \((x_{i},y_{i})\) be the point “in the middle” of the \(i^\text{th}\) subregion. Then the volume is approximately given by the sum of the volumes of all the columns of height \(f(x_{i},y_{i})\) and base area \(\delta A_{i}\): \[V\approx\sum_{i=1}^{N}f(x_{i},y_{i}) \, \delta A_{i}.\] The double integral is defined as the limit of this sum as \(N\rightarrow\infty\); that is, so that \[\begin{aligned} V = \lim_{N\rightarrow\infty}\left(\sum_{i=1}^{N}f(x_{i},y_{i}) \, \delta A_{i} \right) = \iint _{R}f(x,y)\,\odif{A}. \end{aligned}\]

Figure 6.1: A visualisation of a surface, broken up into \(n=6\) and \(n=64\) blocks. From active calculus.

6.1.1 Integration over rectangular regions

So far, so formal. How do we see that the limit above is the same thing as the earlier double integrations?

Consider the rectangular region \(R\) from a previous example that was given by \(0\leq x\leq1\) and \(0\leq y\leq2\). We’d like to integrate a function \(f(x,y)\) over this rectangular region \(R\) (as in the previous example) and we claim that this double integral should give the volume under the surface of height \(z = f(x,y)\). Let’s investigate why this is the case.

We can partition the rectangular region \(R\) into \(N=mn\) sub-rectangles by partitioning the interval \(0 \leq x \leq 1\) into \(m\) subintervals of length \(\delta x_{1},\delta x_{2}, \ldots, \delta x_{m}\), respectively, and the interval \(0 \leq y \leq 2\) into \(n\) subintervals of length \(\delta y_{1},\delta y_{2}, \ldots, \delta y_{n}\), respectively. Then there are \(N=mn\) sub-rectangles indexed by pairs \((i,j)\) (i.e. the \(i^\text{th}\) \(x\)-subinterval and the \(j^\text{th}\) \(y\)-subinterval combine to give the \((i,j)^\text{th}\) sub-rectangle), and the area of the \((i,j)^\text{th}\) sub-rectangle is \(\delta A_{ij} = \delta x_i \delta y_j\).

Then the volume under the surface \(z = f(x,y)\) over the rectangular region \(R\) is approximated by the double sum \[V \approx \sum_{i=1}^{m} \left( \sum_{j=1}^n f(x_{i},y_{j}) \, \delta y_{j} \right) \delta x_i \,,\] where \((x_i, y_j)\) is some chosen of point in the \((i,j)^\text{th}\) sub-rectangle and where we sum over the \(y\)-direction first only to ensure that our final double integration will do the \(y\)-integration first. As before, the idea is to take the limit of each summation as \(m\) and \(n\) go to infinity and, hence, to obtain \[V = \lim_{m \to \infty} \sum_{i=1}^{m} \left( \lim_{n \to \infty} \sum_{j=1}^n f(x_{i},y_{j}) \, \delta y_{j} \right) \delta x_i = \int_0^1 \int_0^2 f(x,y) \, \odif{y} \odif{x} \,.\]

Another way to think of this is that, for each \(x_i\), we compute the area under the curve \(f(x_{i},y)\) at \(x=x_{i}\), which is given by the single integration limit \[\begin{aligned} A(x_{i}) = \lim_{n\rightarrow\infty}\sum_{j = 1}^{n} f(x_{i},y_{j}) \, \delta y_{j} = \int_{0}^{2} f(x_{i},y) \, \odif{y}\,. \end{aligned}\] Since \(x_i\) lies in a subinterval of thickness \(\delta x_i\), we obtain a slice of volume \(A(x_i) \, \delta x_i\) of our desired total volume, and we add up (via the index \(i\)) the volumes of all \(m\) such slices. Now taking the limit of this sum as \(m\) goes to infinity, we obtain \[\begin{aligned} V &= \lim_{m \rightarrow\infty}\sum_{i=1}^{m}A(x_{i}) \, \delta x_{i} \\ &= \int_{0}^{1} A(x) \, \odif{x}\\ &= \int_{0}^{1}\int_{0}^{2}f(x,y) \, \odif{y}\odif{x} \,. \end{aligned}\] Note that, in this particular case, we can do the integration in either order (by swapping the roles of \(x\) and \(y\) in the argument above). For double integrals over more complicated areas (i.e. not rectangles), you have to be careful with the limits.

An important example of double integration over a region \(R\) is when we have the constant function \(f(x,y) \equiv 1\). In this case, the “volume” under this surface is clearly just the area of the region of integration \(R\); that is, \[\iint_{R}\odif{A}= \text{Area}(R).\]

💪 Try it out
Compute the double integral \[\begin{aligned} \iint_{R}\frac{1}{(x+y+1)^{2}}\, \odif{A} \,, \end{aligned}\] where \(R\) is the square defined by \(0 \leq x \leq 1\) and \(0 \leq y \leq1\).

Answer:

Since the order of integration doesn’t matter, let’s integrate with respect to \(x\) first. We have \[\begin{aligned} \int_{0}^{1}\int_{0}^{1}\frac{1}{(x+y+1)^{2}}\, \odif{x}\odif{y} &= \int_{0}^{1}\left[-\frac{1}{(x+y+1)}\right]_{x=0}^{x=1} \, \odif{y}\\[1mm] &= \int_{0}^{1}\left(\frac{1}{(y+1)}-\frac{1}{(y+2)}\right) \, \odif{y}\\[1mm] &= \left[\log\left(\frac{y+1}{y+2}\right)\right]_{y=0}^{y=1}\\[1mm] &= \log\frac{2}{3} - \log \frac{1}{2}=\log\frac{4}{3}. \end{aligned}\]

6.2 Double integrals and limits of integration

Most regions of integration \(R\) of interest to us could, perhaps, be described most naturally in a coordinate system (e.g. polar) other than the Cartesian coordinate system \((x,y)\). Nevertheless, we can often still describe the region \(R\) in Cartesian coordinates. With this in mind, suppose that the region \(R\) is described by the limits \[ a \leq x \leq b \quad \text{ and } \quad u(x) \leq y \leq v(x), \tag{6.1}\] where \(u(x)\) and \(v(x)\) are some functions of \(x\). This is saying that, as \(x\) varies between \(x=a\) and \(x=b\), the region \(R\) is bounded above by the curve \(y=v(x)\) and below by the curve \(y=u(x)\). Integration over the region \(R\) then becomes \[\iint_{R}f(x,y) \, \odif{A}=\int_{a}^{b}\int_{u(x)}^{v(x)}f(x,y) \, \odif{y}\odif{x}.\] Note that the interpretation as the limit of sums is unchanged from earlier, but that now we cannot just blindly switch the order of integration, because the internal limits are explicitly dependent on the variable \(x\).

If we wish to change the order of integration, we need to (carefully) rewrite the limits appearing in Equation 6.1 so that they’re of the form \[c \leq y \leq d \quad \text{ and } \quad r(y) \leq x \leq s(y),\] for some functions \(r(y)\) and \(s(y)\) of \(y\). We can do this either algebraically or, often much easier, by drawing out the region of integration and reading off the limits.

💪 Try it out
Evaluate \(\iint_{R}xy\,\odif{A}\) where \(R\) is the finite region enclosed by the line \(y=x\) and the curve \(y=x^{2}\).

Answer:

The first thing that we should do is sketch the region of integration \(R\). In particular, observe that the two curves intersect at the points \((x,y)=(0,0)\) and \((x,y)=(1,1)\).

Method 1: Integrate with respect to \(y\) first:

If we want to integrate with respect to \(y\) first, then we should have numerical values for the (outer) \(x\)-limits. Our sketch shows us that, in the region \(R\), the variable \(x\) can vary between \(x=0\) and \(x=1\), so we should have \(0 \leq x \leq 1\). To determine the \(y\)-limits, imagine a (vertical) line parallel to the \(y\)-axis sliding sideways from \(x=0\) to \(x=1\). For any given value of \(x\) in the interval \([0,1]\), we see that our imaginary line intersects the region \(R\) for values of \(y\) between \(y=x^2\) (lower bound) and \(y=x\) (upper bound) [Careful: the fact that \(x^2 \leq x\) in the region \(R\) is perhaps contrary to our expectations!]. Therefore, the region of integration \(R\) is described by \[0 \leq x\,\leq\,1 \quad \text{ and } \quad x^{2} \leq y \leq x.\] Then we can evaluate the integral as follows: \[\begin{aligned} \iint_{R}xy\,\odif{A} &= \int_{0}^{1}\int_{x^{2}}^{x}xy \,\odif{y}\odif{x} \\ &= \int_{0}^{1}\left[\frac{1}{2}xy^{2}\right]_{y=x^{2}}^{y=x}\odif{x}\\ &= \int_{0}^{1}\left(\frac{x^{3}}{2}-\frac{x^{5}}{2}\right)\odif{x}\\ &= \frac{1}{2}\left[\frac{x^{4}}{4}-\frac{x^{6}}{6}\right]_{0}^{1}\\ &= \frac{1}{24} \,. \end{aligned}\]

Method 2: Integrate with respect to \(x\) first:

On the other hand, if we want to integrate with respect to \(x\) first, then we should have numerical values for the (outer) \(y\)-limits. Our sketch shows us that, in the region \(R\), the variable \(y\) can vary between \(y=0\) and \(y=1\), so we should have \(0 \leq y \leq 1\). To determine the \(x\)-limits, imagine a (horizontal) line parallel to the \(x\)-axis sliding up from \(y=0\) to \(y=1\). For any given value of \(y\) in the interval \([0,1]\), we see that our imaginary line intersects the region \(R\) for values of \(x\) between \(x=y\) (lower bound) and \(x=\sqrt{y}\) (upper bound) [Careful with upper/lower bounds: the curve \(y = x^2\) was a lower bound above, but here the curve \(x = \sqrt y\) is an upper bound.]. Therefore, we have the alternative description of the region of integration \(R\) by \[0 \leq y\,\leq\,1 \quad \text{ and } \quad y \leq x \leq \sqrt{y}\,,\] and we can evaluate the integral as follows: \[\begin{aligned} \iint_{R}xy\,\odif{A} &= \int_{0}^{1}\int_{y}^{\sqrt{y}}xy\,\odif{x}\odif{y} \\ &= \int_{0}^{1}\left[\frac{1}{2}yx^{2}\right]_{x=y}^{x=\sqrt{y}}\odif{y}\\ &= \int_{0}^{1}\left(\frac{y^{2}}{2}-\frac{y^{3}}{2}\right)\odif{y}\\ &= \frac{1}{2}\left[\frac{y^{3}}{3}-\frac{y^{4}}{4}\right]_{0}^{1}\\ &= \frac{1}{24} \,. \end{aligned}\]

Recall that the area of a region \(R\) in the \(xy\)-plane is given by \[\text{Area}(R) = \iint_{R}\odif{A}.\]

💪 Try it out
Find the area of the finite region \(R\) in the plane enclosed by the line \(x=y^{2}\) and the lines \(x=3\) and \(y=\pm1\).

Answer:

By inspecting a sketch of the region \(R\), we see that is will be easiest to do the \(x\)-integration first (because, as we’ll see below, we would otherwise have to split the \(x\)-integration into two regions). Following this choice, the region \(R\) can, therefore, be described by \[y^{2} \leq x \leq 3 \quad \text{ and } \quad -1 \leq y \leq 1.\] Hence, the area of \(R\) is given by

\[\begin{aligned} \mathrm{Area}(R) = \iint_R \, dA &= \int_{-1}^{1}\int_{y^{2}}^{3}\,\odif{x}\odif{y} \\ &= \int_{-1}^{1}\big[x\big]_{x=y^{2}}^{x=3} \,\odif{y}\\ &= \int_{-1}^{1}\left(3-y^{2}\right) \, \odif{y}\\ &= \left[3y-\frac{1}{3}y^{3}\right]_{-1}^{1}\\ &= \frac{16}{3} \,. \end{aligned}\]

For comparison, suppose we want to do the \(y\)-integration first. From the sketch of our region \(R\), we observe that the upper and lower boundary curves of \(R\) change as we move from left to right along the \(x\)-axis. The point of intersection of the curves \(x=y^2\) and \(y=1\) is \((x,y) = (1,1)\), while the point of intersection of the curves \(x=y^2\) and \(y=-1\) is \((x,y) = (1,-1)\). Then we split \(R\) into two regions, one described by \[0 \leq x \leq 1 \quad \text{ and } \quad -\sqrt x \leq y \leq \sqrt x\] and the other described by (the rectangle) \[1 \leq x \leq 3 \quad \text{ and } \quad -1 \leq y \leq 1.\] Hence, the area of \(R\) is given by \[\mathrm{Area}(R) = \iint_R \, dA = \int_{0}^{1}\int_{-\sqrt x}^{\sqrt x}\,\odif{y}\odif{x} + \int_{1}^{3}\int_{-1}^{1}\,\odif{y}\odif{x}\] and it is easy to verify that this yields the same outcome as before.

💪 Try it out
Find the area of the bounded region \(R\) determined by the curves \(y=x^{2}/4\) and \(2y-x-4=0\).

Answer:

By inspecting a sketch of the region \(R\), we observe that, if we want to do the \(y\)-integration first, the region \(R\) is bounded above by the line \(2y-x-4=0\) and below by the parabola \(y=x^{2}/4\). The two curves intersect whenever \[x^{2} = 2x+8,\] which has solutions at \(x=-2\) and \(x=4\), so the points of intersection are \((x,y) = (-2,1)\) and \((x,y) = (4,4)\). Therefore, the region \(R\) can be described by \[-2 \leq x \leq 4 \quad \text{ and } \quad \frac{x^{2}}{4} \leq y \leq \frac{1}{2}(x+4).\] Hence, the area of \(R\) is given by \[\begin{aligned} \mathrm{Area}(R) = \iint_R \, \odif A &= \int_{-2}^{4}\int_{x^{2}/4}^{(x+4)/2}\,\odif{y}\odif{x} \\ & = \int_{-2}^{4}\big[y\big]_{y=x^{2}/4}^{y=(x+4)/2} \, \odif{x}\\ & = \int_{-2}^{4}\frac{1}{4}\left(2x+8-x^{2}\right) \, \odif{x}\\ & = \frac{1}{4}\left[x^{2}+8x-\frac{1}{3}x^{3}\right]_{-2}^{4}\\ & = 9. \end{aligned}\]

6.2.1 Making difficult integrals easier by changing the order of integration

Sometimes it is difficult to evaluate double integrals in the form in which they first appear, but switching the order of integration results in a much easier computation. However, as always, we need to be very careful with the limits.

💪 Try it out
Evaluate the integral \[\int_{0}^{1}\int_{y}^{1}\cos\left(\frac{\pi}{2}x^{2}\right)\,\odif{x}\odif{y}.\]

Answer:

It is very difficult to integrate the function \(\cos\left(\frac{\pi}{2}x^{2}\right)\) with respect to \(x\) (it gives something called the Fresnel integral) and, hence, to evaluate the double integral in the form given. Thus, let’s try to switch the order of integration and see if we can make progress. From the limits above, we see that the region of integration is described by \[y \leq x \leq 1 \quad \text{ and } \quad 0 \leq y \leq 1.\] We can then sketch this region and, since we want to integrate with respect to \(y\) first, rewrite it as \[0 \leq x \leq 1 \quad \text{ and } \quad 0 \leq y \leq x.\] Hence, our integral becomes \[\begin{aligned} \int_{0}^{1}\int_{y}^{1}\cos\left(\frac{\pi}{2}x^{2}\right)\,\odif{x}\odif{y} &= \int_{0}^{1}\int_{0}^{x}\,\cos \left(\frac{\pi}{2}x^{2} \right) \, \odif{y}\odif{x} \\ &= \int_{0}^{1}\left[y\,\cos \left( \frac{\pi}{2}x^{2} \right) \right]_{y=0}^{y=x} \, \odif{x}\\ &= \int_{0}^{1}\left(x\,\cos \left( \frac{\pi}{2}x^{2} \right) \right) \, \odif{x}\\ &= \left[\frac{1}{\pi}\sin \left( \frac{\pi}{2}x^{2} \right) \right]_{0}^{1}\\ &= \frac{1}{\pi}. \end{aligned}\]

💪 Try it out
Evaluate the integral \[\int_{0}^{1}\int_{\sqrt{y}}^{1}\exp(x^{3})\,\odif{x}\odif{y}.\]

Answer:

Similarly to the previous example, it is very difficult to integrate the function \(\exp(x^3)\) with respect to \(x\) (it gives something depending on what are called incomplete Gamma functions). The easiest route may be to do the \(y\) integral first, so let’s switch the order of integration. From the limits \[\sqrt y \leq x \leq 1 \quad \text{ and } \quad 0 \leq y \leq 1\] it is easy to sketch the region of integration. To switch the order of integration, we rewrite this region as \[0 \leq x \leq 1 \quad \text{ and } \quad 0 \leq y \leq x^2.\] Therefore, our integral becomes

\[\begin{aligned} \int_{0}^{1}\int_{\sqrt{y}}^{1} \exp(x^{3}) \, \odif{x}\odif{y} &= \int_{0}^{1}\int_{0}^{x^{2}} \exp(x^{3}) \, \odif{y}\odif{x} \\ &= \int_{0}^{1}\left[y\,\exp(x^{3})\right]_{y=0}^{y=x^{2}} \, \odif{x} \\ &= \int_{0}^{1}\left(x^{2}\,\exp(x^{3})\right) \, \odif{x} \\ &= \left[\frac{1}{3}\exp(x^{3})\right]_{0}^{1} \\ &= \frac{(e-1)}{3}. \end{aligned}\]

Let’s return to probability for a moment. Recall from Equation 1.1 in (ch-prob?) that we can compute the probability that continuous random variables \(X\) and \(Y\) take values in a region \(R\) of the \(xy\)-plane by evaluating a double integral of their joint probability density function \(f_{X,Y}\) over the region \(R\). We now have the machinery to elaborate upon this.

💪 Try it out
Let \(X\) and \(Y\) be (continuous) random variables with joint probability density function \[f_{X,Y}(x,y) = \begin{cases} 3x+1, & \text{ if } x \geq 0, y \geq 0, x+y < 1, \\ 0, & \text{ otherwise.} \end{cases}\] Find \(\mathbb P(Y \leq 2X)\), the probability that \(Y\) takes a value less than twice the value of \(X\).

Answer:

Recall that the variable \(x\) represents the values taken by the random variable \(X\), and the variable \(y\) represents the values taken by the random variable \(Y\). Thus, we are interested in the region \(R\) of the \(xy\)-plane given by \[R = \{(x,y) \in \mathbb R^2 \mid y \leq 2x \}.\] We need to compute \[\mathbb{P}(Y \leq 2X) = \iint_R f_{X,Y}(x,y) \, \odif A.\] We can divide the region \(R\) into two subregions, \(B = \{(x,y) \in R \mid x \geq 0, 0 \leq y \leq 2x, x+y < 1\}\) and \(C = R \backslash B\), such that the function \(f_{X,Y}\) is given by \(3x+1\) on the subregion \(B\) and is constant zero on the subregion \(C\). In particular, observe that the lines \(x+y=1\) and \(y=2x\) intersect at the point \((\frac{1}{3}, \frac{2}{3})\), so we can describe the region \(B\) by \[\frac{y}{2} \leq x \leq 1-y, \quad 0 \leq y \leq \frac{2}{3}\,.\] Therefore, we find that \[\begin{aligned} \mathbb{P}(Y \leq 2X) = \iint_R f_{X,Y}(x,y) \, \odif A &= \iint_B 3x+1 \, \odif A \\ &= \int_0^{\frac{2}{3}} \int_{\frac{y}{2}}^{1-y} 3x+1 \, \odif x \odif y \\ &= \int_0^{\frac{2}{3}} \left[\frac{3x^2}{2} + x \right]_{x=\frac{y}{2}}^{x=1-y} \, \odif y \\ &= \int_0^{\frac{2}{3}} \left( \frac{5}{2} - \frac{9y}{2} + \frac{9y^2}{8} \right) \, \odif y \\ &= \left[ \frac{5y}{2} - \frac{9y^2}{4} + \frac{3y^3}{8} \right]_0^{\frac{2}{3}} \\ &= \frac{7}{9}\,. \end{aligned}\]

6.2.2 Integration in polar coordinates

For some double integrals, where the region of integration displays rotational symmetry, it is easier to use polar coordinates. We cover the \(xy\)-plane with a polar grid and our area elements \(\delta A\) become wedges at \((r,\theta)\) as shown below:

Note that for the Cartesian coordinate system \((x,y)\) we had \[\odif{A} = \odif{x} \odif{y}\] and we need to modify this for polar coordinates. It is not as simple as swapping \(x\) and \(y\) with \(r\) and \(\theta\), however. We need to understand the area elements of the wedges mentioned above (which are not quite rectangular): the area of such a wedge of length \(\delta{r}\) and width \(r \delta \theta\) is given by \(\delta{A}=r \delta{r} \delta \theta\). Thus, when we are integrating with respect to polar coordinates we have \[\odif A = r \, \odif r \odif \theta.\] Moreover, the function \(f(x,y)\) to be integrated also needs to be rewritten in terms of polar coordinates using \(x = r \cos \theta\), \(y = r \sin \theta\); that is, \(f(x,y)\) becomes \(f(r\cos\theta,r\sin\theta)\). Therefore, we get the “theorem”

🔑 Key idea
\[\iint_{R}f(x,y)\odif{A}= \iint_{R} f(x,y) \, \odif{x} \odif{y} = \iint_{R}f(r\cos\theta,r\sin\theta) \ r \, \odif{r} \odif{\theta}.\]

It is crucial to note that what we have just seen is that the “integration measure” – i.e. the \(\odif{A}\) at the end – is different in different coordinates. We will derive a general formula for this later on, but for now let’s look at some examples.

💪 Try it out
Evaluate the integral \(\iint_{R} \sin(x^{2}+y^{2}) \,\odif{A}\), where \(R\) is the circular disc \(x^{2}+y^{2} \leq \pi\).

Answer:

Clearly, in this case, there is a circular symmetry which can be exploited. In polar coordinates, the region of integration \(R\) defined above is given by \[0 \leq r \leq \sqrt{\pi} \quad \text{ and } \quad 0 \leq \theta \leq 2\pi.\] Using the theorem above we obtain (integrating with respect to \(\theta\) first) \[\begin{aligned} \iint_{R} \sin(x^{2}+y^{2}) \,\odif{A} &= \int_{0}^{\sqrt{\pi}}\int_{0}^{2\pi}\sin(r^{2})\ r \,\odif{\theta} \odif{r} \\ &= 2\pi\int_{0}^{\sqrt{\pi}}\sin(r^{2})\ r \,\odif{r}\\ &= \left[-\pi\cos(r^{2})\right]_{0}^{\sqrt{\pi}}\\ &= \pi(1-\cos(\pi)) \\ &=2\pi. \end{aligned}\]

💪 Try it out
Evaluate the integral \(\iint_{R}3xy^{2}\,\odif{A}\), where \(R\) region described by \(1 \leq x^{2}+y^{2} \leq 2\) and \(x \geq 0\).

Answer:

First note that the half-plane \(x \geq 0\) is swept out in polar coordinates by the angles \(- \frac{\pi}{2} \leq \theta \leq \frac{\pi}{2}\). The region of integration \(R\) above is then given by \[1 \leq r \leq \sqrt{2} \quad \text{ and } \quad -\frac{\pi}{2} \leq \theta \leq \frac{\pi}{2}.\] Thus, our integral becomes (integrating with respect to \(\theta\) first) \[\begin{aligned} \iint_{R}3xy^{2}\,\odif{A} &= \int_{1}^{\sqrt 2}\int_{-\frac{\pi}{2}}^{\frac{\pi}{2}}3r^{3}\cos\theta\sin^{2}\theta \ r \, \odif{\theta} \odif{r}\\ &= \int_{1}^{\sqrt 2}\int_{-1}^{1}3r^{4}u ^2 \, \odif u \odif{r} \qquad (\text{substituting } u = \sin \theta) \\ &= \int_{1}^{\sqrt 2} 2 r^{4}\, \odif{r}\\ &= \left[\frac{2}{5}r^{5}\right]_{1}^{\sqrt 2}\\ &= \frac{8\sqrt 2 - 2}{5} \,. \end{aligned}\]

The following example is a famous and clever use of double integrals to evaluate a difficult integral in one variable.

💪 Try it out
Evaluate the Gaussian integral \(I=\int_{-\infty}^{\infty}e^{-x^{2}}\,\odif{x}\).

Answer:

You might know that this famous integral evaluates to \(\sqrt{\pi}\), but let’s prove this. To do so, consider the square of the integral.

\[\begin{aligned} I^{2} &= \left( \int_{-\infty}^{\infty}e^{-x^{2}}\, \odif{x}\right) \left( \int_{-\infty}^{\infty}e^{-y^{2}}\,\odif{y} \right) \\ &= \int_{-\infty}^{\infty} \int_{-\infty}^{\infty} e^{-(x^{2}+y^{2})} \, \odif{x} \odif{y}. \end{aligned}\] The region of integration for this integral is the the entire \(xy\)-plane. Switching to polar coordinates, we find that

\[\begin{aligned} I^{2} &= \int_{0}^{\infty}\int_{0}^{2\pi} e^{-r^{2}}\ r \, \odif{\theta} \odif{r} \\ &= 2\pi \int_{0}^{\infty}e^{-r^{2}}\ r \, \odif{r}\\ &= \left[-\pi e^{-r^{2}}\right]_{0}^{\infty} \\ &= \pi, \end{aligned}\] and, hence, we may conclude that \(I=\sqrt{\pi}\).

6.3 Triple integrals

Many problems require the evaluation of a “bulk” property, such as the mass of a three-dimensional object, by integrating over the entire volume. For example, suppose we want to find the mass of a star of density \(\rho(x,y,z)\). Recall that mass is given by volume times density. Thus, the mass \(\delta M\) of a small region with volume \(\delta V\) (e.g. a small cube with sides \(\delta {x}\), \(\delta {y}\), \(\delta z\)) and density \(\rho(x,y,z)\) will be \[\delta M = \rho(x,y,z) \, \delta V.\] Now, given a three-dimensional object \(R \subseteq \mathbb R^3\) of density \(\rho(x,y,z)\), we can subdivide \(R\) into \(N\) small subregions, compute the mass \(\delta M_i\) of each subregion, and then approximate the total mass \(M\) of \(R\) by adding up the masses \(\delta M_i\). Letting \(N\) tend to infinity, we find that the total mass of \(R\) can be written as as the triple integral \[M = \iiint_{R}\rho(x,y,z) \, \odif{V} = \iiint_{R}\rho(x,y,z) \, \odif{x}\odif{y}\odif{z}.\] Moreover, if the density function is the constant function \(\rho(x,y,z) \equiv 1\), observe that the volume of the (three-dimensional) region is given by \[\mathrm{Vol}(R) = \iiint_R \, \odif V.\]

💪 Try it out
A wedge occupies the region \(R\) given by \(0\leq x\leq2\), \(0\leq y\leq1\) and \(0\leq z\leq1-y\). If the wedge is made of material of density \(\rho(x,y,z) = 12xy\,g/cm^{3}\), what is its mass?

Answer:

We have \[\begin{aligned} M &= \iiint_{R} \rho(x,y,z) \,\odif{x}\odif{y}\odif{z}\\ &= 12\int_{0}^{2}\int_{0}^{1}\int_{0}^{1-y}xy\,\,\odif{z}\odif{y}\odif{x}\\ &= 12\int_{0}^{2}\int_{0}^{1}xy \left[z\right]_{z=0}^{z=1-y}\,\,\odif{y}\odif{x}\\ &= 12\int_{0}^{2}\int_{0}^{1}xy(1-y)\,\,\odif{y}\odif{x}\\ &= 12\int_{0}^{2}x\left[\frac{y^{2}}{2}-\frac{y^{3}}{3}\right]_{y=0}^{y=1}\odif{x}\\ &= 2\int_{0}^{2}x\odif{x}=[x^{2}]_{x=0}^{x=2}=4 \, g \end{aligned}\] (In this example, it was implicit that we were to use centimetres as the units of length in the limits, i.e. 2cm, \((1-y)\)cm, etc.)

6.3.1 Cylindrical polar coordinates

As with double integration, there are often cases where different coordinate systems are preferable. Cylindrical polar coordinates are useful in cases with axial symmetry, usually involving pipes, cylinders, annuli, and so on. They are an extension to two-dimensional polar coordinates, where we essentially just “add a \(z-\)coordinate”. To tie in with convention, we’ll now call the angular coordinate \(\phi\), rather than \(\theta\), although in practice you can use whichever symbol you like. The description of an arbitrary point \((x,y,z)\) in terms of cylindrical polar coordinates \((r,\phi, z)\) is illustrated in the figure, as is how to visualise the surfaces obtained by taking one of the coordinates \((r,\phi, z)\) to be constant.

A point \(r,\phi,z\)

Surfaces of constant \(r, \phi, z\)
Figure 6.2

We describe \((x,y,z)\) in terms of \((r, \phi, z)\) by extending the coordinate transformation for (planar) polar coordinates; that is, \[x = r \cos \phi, \qquad y = r \sin \phi , \qquad z = z.\] To write the volume element \(\odif V\) in terms of the cylindrical polar coordinates \((r,\phi, z)\), we extend the ideas from the case of (planar) polar coordinates into three dimensions (i.e. we find the volume of a small, approximately cubular region of sidelengths \(\delta {r}\), \(r \delta {\phi}\) and \(\delta {z}\)) to obtain \[\odif V = r \, \odif r \odif \phi \odif z\] and, hence, \[\iiint_{R}f(x,y,z) \, \odif V = \iiint_{R}f(x,y,z) \,\odif{x}\odif{y}\odif{z} = \iiint_{R}f(r\cos\phi,r\sin\phi,z)\,r\odif{r}\odif{\phi} \odif{z}.\]

💪 Try it out
Find the volume \(V\) of the finite region \(R\) bounded by the cylinder \(x^{2}+y^{2}=1\) and the planes \(z=0\) and \(z=x+3\).

Answer:

We have to find the volume \(V=\iiint_{R}\,\odif{x}\odif{y}\odif{z}\) for the region \(R\). Given that the region of integration is rotationally symmetric about the \(z\)-axis, it makes sense to use cylindrical polar coordinates. Clearly, the most tricky bit to understand is the \(z\)-limits, which become \[0\leq z\leq r\cos\phi+3.\] As the \(z\)-limits depend on the other two variables, we should integrate with respect to the \(z\) variable first. Therefore, \[\begin{aligned} V = \iiint_R \, \odif V &= \int_{0}^{1}\int_{0}^{2\pi}\int_{0}^{r\cos\phi+3}r \, \odif{z}\odif{\phi} \odif{r} \\ &= \int_{0}^{1}\int_{0}^{2\pi}\,r\left[z\right]_{z=0}^{z=r\cos\phi+3}\, \odif{\phi} \odif{r}\\ &= \int_{0}^{1}\int_{0}^{2\pi}\,r(r\cos\phi+3) \, \odif{\phi} \odif{r}\\ &= \int_{0}^{1}\,r\left[r\sin\phi+3\phi\right]_{\phi = 0}^{\phi = 2\pi} \, \odif{r}\\ &= \int_{0}^{1}\,6\pi r \, \odif{r}\\ &= 3\pi[r^{2}]_{r=0}^{r=1} \\ &= 3\pi. \end{aligned}\]

💪 Try it out
Find the volume \(V\) of the finite region \(R\) bounded below by the paraboloid \(z=x^{2}+y^{2}\) and above by the sphere \(x^{2}+y^{2}+z^{2}=6\).

Answer:

The region of integration \(R\) is clearly rotationally symmetric about the \(z\)-axis, so again we’ll use cylindrical polar coordinates. In order to determine the limits of integration, we first need to find where the two surfaces meet. This is given in cylindrical coordinates by \[r^{2} = z =\sqrt{6-r^{2}},\] which, since \(r > 0\) and \(r^2 > 0\), yields \(r=\sqrt{2}\). For each \(r \in (0, \sqrt 2]\), we need to integrate \(z\) in the range \[r^{2}\leq z\leq\sqrt{6-r^{2}}.\] Other than observing that it runs through the entire interval \([0, 2\pi)\), the \(\phi\) variable doesn’t really play much role here, as it doesn’t appear in the limits of the other variables. Thus, we can integrate it first (or whenever we want), and we find that have \[\begin{aligned} V = \iiint_R \, \odif V &= \int_{0}^{\sqrt{2}}\int_{r^{2}}^{\sqrt{6-r^{2}}} \int_{0}^{2\pi} r \, \odif{\phi} \odif{z}\odif{r}\\ &= 2\pi \int_{0}^{\sqrt{2}}\,r \Big[z \Big]_{z = r^{2}}^{z= \sqrt{6-r^{2}}} \, \odif{r}\\ &= 2\pi \int_{0}^{\sqrt{2}}\,r\left(\sqrt{6-r^{2}}-r^{2}\right) \, \odif{r}\\ &= 2\pi \left[-\frac{1}{3} (6-r^{2})^{\frac{3}{2}} -\frac{r^{4}}{4} \right]_{r=0}^{r=\sqrt{2}}\\ &= 2\pi\left(-\frac{1}{3}\cdot 8-\frac{4}{4}+\frac{1}{3}6^{\frac{3}{2}}\right)\\ &= 2\pi\left(2\sqrt{6}-\frac{11}{3}\right). \end{aligned}\]

6.3.2 Spherical polar coordinates

Spherical polar coordinates are useful in cases with radial symmetry: for example, cases involving central charges, gravitating stars, black holes, bubbles, explosions, etc. In spherical polar coordinates, a point \((x,y,z) \in \mathbb R^3\) is described by the radius \(r = \sqrt{x^2 + y^2 + z^2}\) (the distance from the origin) and two angles, one altidudinal angle \(\theta \in [0, \pi]\) measured from the positive \(z\)-axis (essentially giving “latitude”) and one “azimuthal” angle \(\phi \in [0, 2\pi)\) measured in the \(xy\)-plane from the positive \(x\)-axis (essentially giving “longitude”), as illustrated in the diagram below.

The volume of a tiny bit of a sphere

It is important to remark that the \(r\) appearing in spherical polar coordinates (in this section) is not the same as the \(r\) appearing in cylindrical polar coordinates (in the last section).

Observe that the given ranges of values for the coordinates \(r\), \(\theta\) and \(\phi\) allow for points \((0,0,z) \in \mathbb R^3\) along the \(z\)-axis to have multiple representations in spherical polar coordinates: for example, the origin \((x,y,z) = (0,0,0)\) is given by \((0,\theta, \phi)\), where \(\theta \in [0, \pi]\) and \(\phi \in [0, 2\pi)\) are arbitrary, while the point \((0,0,z)\) is given in spherical polar coordinates by \((z,0, \phi)\), if \(z > 0\), and by \((-z, \pi, \phi)\), if \(z < 0\), with \(\phi \in [0, 2\pi)\) arbitrary in each case. Thus, if we want our spherical polar coordinate system to give a unique description of every point in \(\mathbb R^3\), then we need to decide upon a convention for points along the \(z\)-axis (e.g. we could agree to always describe the origin as \((r, \theta, \phi) = (0,0,0)\) and other points on the \(z\)-axis by \((r, \theta, \phi) = (z, 0, 0)\), if \(z > 0\), or by \((r, \theta, \phi) = (-z, \pi, 0)\), if \(z < 0\)). However, in practice, we typically ignore these issues with points along the \(z\)-axis when doing integration, as they don’t have any impact on the outcome.

Some elementary trigonometry yields that the coordinates \((x,y,z)\) can be written in terms of the spherical polar coordinates \((r, \theta, \phi)\) via the coordinate transformation \[ x = r \sin \theta \cos \phi, \quad y = r \sin \theta \sin \phi, \quad z = r \cos \theta. \tag{6.2}\] To write the volume element \(\odif V\) in terms of the spherical polar coordinates \((r,, \theta, \phi)\), we again extend the ideas from the case of (planar) polar coordinates into three dimensions (i.e. we find the volume of a small, approximately cubular region of sidelengths \(\delta {r}\), \(r \delta \theta\) and \(r \sin \theta \delta \phi\)) to obtain \[\odif V = r^2 \sin \theta \, \odif r \odif \theta \odif \phi\] and, hence, \[\iiint_{R}f(x,y,z) \, \odif V = \iiint_{R} f(r\sin\theta\cos\phi,r\sin\theta\sin\phi,z\cos\theta)\,r^{2} \sin\theta \, \odif{r} \odif{\theta} \odif{\phi}.\]

💪 Try it out
Find the volume of the region \(R\) bounded above by the sphere \(x^2 + y^2 + z^2 = a^2\) of radius \(a\) and below by the cone \(cz = \sqrt{x^2 + y^2}\), where \(c > 0\).

Answer:

We will use spherical polar coordinates to describe the region \(R\). As this region is contained within the sphere \(x^2 + y^2 + z^2 = a^2\), and as the cone \(cz = \sqrt{x^2 + y^2}\) is rotationally symmetric about the \(z\)-axis, it is clear that we must have \(0 \leq r \leq a\), \(0 \leq \phi \leq 2\pi\) and \(0 \leq \theta\). The non-obvious part is the upper limit for \(\theta\): we need to determine the angle \(\theta\) which corresponds to the cone \(cz = \sqrt{x^2 + y^2}\) (i.e. \(\theta\) is the half-angle of the cone). Converting to spherical polar coordinates, we have \[cr \cos \theta = cz = \sqrt{x^2 + y^2} = r \sin \theta\] and, hence, \(\tan \theta = c > 0\). In other words, the upper limit for the \(\theta\) coordinate is \(\theta = \tan^{-1} c \in (0, \frac{\pi}{2})\). Therefore, the region \(R\) is described in spherical polar coordinates by \[0 \leq r \leq a, \quad 0 \leq \phi \leq 2\pi \quad \text{ and } \quad 0 \leq \theta \leq \tan^{-1} c\,.\] Hence, we compute the volume to be \[\begin{aligned} \mathrm{Vol}(R) &= \int_{0}^{\tan^{-1} c} \int_{0}^{a} \int_{0}^{2\pi} r^{2} \sin \theta \, \odif{\phi} \odif{r} \odif{\theta} \\ &= 2\pi\int_{0}^{\tan^{-1} c} \left[ \frac{r^3}{3} \, \sin \theta \right]_{r=0}^{r=a} \,\odif{\theta}\\ &= \frac{2\pi a^3}{3} \int_{0}^{\tan^{-1} c} \sin \theta \, \odif{\theta}\\ &= \frac{2\pi a^{3}}{3} \left[ -\cos \theta \right]_{\theta = 0}^{\theta = \tan^{-1} c} \\ &= \frac{2\pi a^{3}}{3} \left(1 - \cos \left( \tan^{-1} c \right) \right) \\ &= \frac{2\pi a^{3}}{3} \left(1 - \frac{1}{\sqrt{1+c^2}} \right), \end{aligned}\] where we derive \(\cos \left( \tan^{-1} c \right) = \frac{1}{\sqrt{1+c^2}}\) from the basic trigonometry of right-angled triangles. Finally, observe that if we let \(c\) tend to infinity, then the half-angle of the cone tends to \(\frac{\pi}{2}\) and, hence, the region \(R\) becomes the upper hemisphere of the sphere of radius \(a\), which is well known to have volume \(\frac{2 \pi a^3}{3}\) (Exercise: Compute the volume of a sphere using triple integration!).

💪 Try it out
Evaluate the integral \[\iiint_{R} \frac{\sin(x^{2}+y^{2}+z^{2})}{\sqrt{x^{2}+y^{2}}} \, \odif{V},\] where \(R\) is the region in \(\mathbb R^3\) given by \[R = \{ (x, y, z) \in \mathbb R^3 \mid x^{2}+y^{2}+z^{2}=9, x \geq 0, y \geq 0, z \geq 0 \}.\] In other words, \(R\) is the region in the “positive octant” enclosed by the sphere \(x^{2}+y^{2}+z^{2}=9\) and the planes \(x=0\), \(y=0\) and \(z=0\).

Answer:

In spherical polar coordinates, the region \(R\) is described by \[0 \leq \phi \leq \frac{\pi}{2}, \quad 0 \leq \theta \leq \frac{\pi}{2} \quad \text{ and } \quad 0 \leq r \leq 3.\] Since \(x^{2}+y^{2}=r^{2}\sin^{2}\theta(\sin^{2}\phi+\cos^{2}\phi) = r^{2} \sin^{2}\theta\), we have that \[\begin{aligned} \iiint_{R}\frac{\sin(x^{2}+y^{2}+z^{2})}{\sqrt{x^{2}+y^{2}}} \, \odif{V} &= \int_{0}^{3}\int_{0}^{\frac{\pi}{2}}\int_{0}^{\frac{\pi}{2}} \frac{\sin(r^{2})}{r\sin\theta} \, r^{2} \sin \theta \, \odif{\phi} \odif{\theta} \odif{r} \\ &= \int_{0}^{3} \int_{0}^{\frac{\pi}{2}} \int_{0}^{\frac{\pi}{2}} r \sin(r^{2}) \, \odif{\phi} \odif{\theta} \odif{r}\\ &= \frac{\pi^{2}}{4} \int_{0}^{3} r\sin(r^{2}) \, \odif{r}\\ &= \frac{\pi^{2}}{4} \left[-\frac{1}{2}\cos(r^{2})\right]_{0}^{3}\\ &= \frac{\pi^{2}}{8}(1-\cos(9)). \end{aligned}\]

6.4 The Jacobian

We have seen that whenever we perform a change of coordinates in order to compute an integral, we pay the price of introducing an additional factor in the integrand. Up to now, we have determined this additional factor by drawing an ad-hoc diagram of a small region determined by a small change in each of the new coordinates and computing its area or volume. There is a simple and important general formula for this additional factor which avoids the need to test our artistic skills. To understand it, suppose first that we are doing an integral over one variable: \[\begin{aligned} \int f(x) \odif{x}. \end{aligned}\] Now imagine we want to change our variable \(x\) into a variable \(u = u(x)\) (similarly to doing an integration by substitution). How does the integral change? We can re-express the function \(f(x)\) in terms of the variable \(u\) as \(f(x(u))\) (by inverting \(u=u(x)\) to find \(x\) in terms of \(u\), i.e. \(x = x(u)\)), but we also need to introduce an additional factor, so that \[\int f(x) \odif{x} = \int f(x(u)) \, \odv{x}{u} \, \odif{u}.\] That is, we transformed the variable from \(x\) to \(u\), at the cost of picking up an extra factor of \(\odv{x}{u}\). As we know from doing integration by substitution, we can write \[ \odif{x} = \odv{x}{u} \, \odif{u} \quad \text{ and } \quad \odif{u} = \odv{u}{x} \odif{x}. \tag{6.3}\]

Now, as usual, we care about the \(n\)-dimensional version of this. Suppose that we need to evaluate an \(n\)-dimensional integral \[\iint...\int f(x_{1},..x_{n}) \, \odif{x_{1}}...\odif{x_{n}}\] and that we can do this by transforming to a new coordinate system \((u_1, u_2, \dots, u_n)\). The old coordinates \((x_1, x_2, \dots, x_n)\) can be written in terms of the new ones (like we did for the various instances of polar coordinates we discussed), so that \[x_j = x_j(u_1, u_2, \dots, u_n),\] for all \(j \in \{1, 2, \dots, n\}\). Then we can write the multiple-dimensional analogue of Equation 6.3 is expressed as \[\odif{x_1} \odif{x_2} \dots \odif{x_n} = | J(u_1, u_2, \dots, u_n) | \, \odif{u_1} \odif{u_2} \dots \odif{u_n},\] where \(| J(u_1, u_2, \dots, u_n) |\) is the absolute value of the determinant \[J(u_1, u_2, \dots, u_n) = \det \begin{pmatrix} \pdv{x_1}{u_1} & \pdv{x_1}{u_2} & \cdots & \pdv{x_1}{u_n} \\ \pdv{x_2}{u_1} & \pdv{x_2}{u_2} & \cdots & \pdv{x_2}{u_n} \\ \vdots & \vdots & \ddots & \vdots\\ \pdv{x_n}{u_1} & \pdv{x_n}{u_2} & \cdots & \pdv{x_n}{u_n} \end{pmatrix} \] The function \(J(u_1, u_2, \dots, u_2)\) is called the Jacobian and the matrix of partial derivatives is called the Jacobian matrix.

As an example, consider the transformation to polar coordinates in two dimensions. Here we have \(x=r\cos\theta\) and \(y=r\sin\theta\), so that \[\begin{aligned} J(r, \theta) &= \det \begin{pmatrix} \pdv{x}{r} & \pdv{x}{\theta} \\ \pdv{y}{r} & \pdv{y}{\theta} \end{pmatrix} \\ &=\det \begin{pmatrix} \cos\theta & -r\sin\theta\\ \sin\theta & r\cos\theta \end{pmatrix} = r. \end{aligned}\] Hence, we obtain \(\odif{x}\odif{y}= | J(r, \theta) | \, \odif{r}\odif{\theta}= r \, \odif{r}\odif{\theta}\), in agreement with the area element previously computed using pictures.

As a further example, consider the transformation to spherical polar coordinates in three dimensions. From the expressions in Equation 6.2, we have \[\begin{aligned} J(r, \theta, \phi) & =\det \begin{pmatrix} \pdv{x}{r} & \pdv{x}{\theta} & \pdv{x}{\phi} \\ \pdv{y}{r} & \pdv{y}{\theta} & \pdv{y}{\phi} \\ \pdv{z}{r} & \pdv{z}{\theta} & \pdv{z}{\phi} \\ \end{pmatrix} \\ &=\det \begin{pmatrix} \sin\theta\cos\phi & r\cos\theta\cos\phi & -r\sin\theta\sin\phi\\ \sin\theta\sin\phi & r\cos\theta\sin\phi & r\sin\theta\cos\phi\\ \cos\theta & -r\sin\theta & 0 \end{pmatrix} \\ &= \cos\theta(r^{2}[\cos^{2}\phi+\sin^{2}\phi]\,\cos\theta\sin\theta)+r^{2}\sin^{3}\theta[\cos^{2}\phi+\sin^{2}\phi]\\ &= r^{2}\cos^{2}\theta\sin\theta+r^{2}\sin^{3}\theta\\ &= r^{2} \sin \theta. \end{aligned}\] Therefore, since \(\sin \theta \geq 0\) for all \(\theta \in [0, \pi]\), we have \[\odif{x}\odif{y}\odif{z} = | J(r, \theta, \phi) | \, \odif{r} \odif{\theta} \odif{\phi} = r^{2} \sin \theta \, \odif{r} \odif{\theta} \odif{\phi},\] exactly the same volume element that we found by considering a picture of the small region obtained by small changes in each of the coordinates.