Skip to main content

Section 2.2 Integration with Variable Bounds

Subsection 2.2.1 Calculations over Integrable Sets

As I pointed out in Section 2.1 the formal definition of an integral over an arbitrary set is almost entirely useless for calculation. For calculation, I will construct a techinque that doesn't easly apply to all possible integrable sets, but it useful for most sets that will likely show up in the course (and in the reasonable applications of the theory). To motivate this techique, I'll start with an interesting geometric example.

Figure 2.2.2.

The function \(f(x,y) = a - \frac{a(|x-y| + |x+y|)}{2b}\) over the interval \([-b.b] \times [-b,b]\) describes a square pyramid with height \(a\) and side length \(2b\text{.}\) What is the volume of such a pyramid? Doing the integral directly is difficult with the various evaluations of the absolute value terms. I could try to simplify by integrating over one quarter of pyramid with the interval \([0,b] \times [0,b]\text{,}\) then multiply by 4 to get the entire area. However, this doesn't solve the problem with the absolute value terms; over this quarter, there are still essentially two pieces of the function. I need to split the domain further into two regions: one where \(x>y\) and one where \(x\lt y\text{.}\) In those regions, I can drop the abosolute value in the function and do a reasonable integral. In the interval \([0,b] \times [0,b]\text{,}\) those two regions are triangles, so I need to integrate over triangles. Triangles are not intervals, so I need a new technique.

I can describe the first triangle (where \(y\lt x\)) by saying that \(x \in [0,b]\text{,}\) then, once we've set an \(x\) value, \(y \in [0, x]\text{.}\) This is indicated in the triangle with vertical lines in Figure 2.2.2, showing that for each set \(x\) value, the \(y\) value has a bound based on the matching \(x\) coordinate. I can use this variable bound in an iterate integral. Let \(T\) represent the triangle.

\begin{equation*} \int_T f(x,y) dA = \int_0^b \int_0^x f(x,y) dy dx \end{equation*}

I could have reversed the order. If I have \(y \in [0,b]\) then the condition \(y\lt x\) means that \(x \in [y,b]\text{.}\) This is indicated by the triangle with horizontal lines in Figure 2.2.2.

\begin{equation*} \int_T f(x,y) dA = \int_0^b \int_y^b f(x,y) dx dy \end{equation*}

Now I will evaluate the square pyramid integral. The function was \(f(x,y) = a - \frac{a(|x-y| + |x+y|)}{2b}\text{.}\) On the triangle in \([0,b] \times [0,b]\) where \(y\lt x\text{,}\) the absolute values are \(|x-y| = x-y\) and \(|x+y| = x+y\text{,}\) so the function is \(a - \frac{a(x-y+x+y)}{2b} = a - \frac{2ax}{2b} = a - \frac{ax}{b}\text{.}\)

\begin{align*} \int_T f(x,y) dA \amp = \int_0^b \int_0^x a - \frac{ax}{b} dy dx\\ \amp = \int_0^b \left. ay - \frac{axy}{b} \right|_0^x dx\\ \amp = \int_0^b ax - \frac{ax^2}{b} dx\\ \amp = \left. \frac{ax^2}{2} - \frac{ax^3}{3b} \right|_0^b\\ \amp = \frac{ab^2}{2} - \frac{ab^3}{3b} = \frac{ab^2}{2} - \frac{ab^2}{3} = \frac{ab^2}{6} \end{align*}

This measures one eighth of the total pyramid, so the total volume is \(\frac{4ab^2}{3}\text{.}\)

In the example, instead of having fixed bounds, I let one of the bounds include the other variable. In this way, I could describe the triangle. This is the general technique I will use for describing non-interval domains of integral.

The key point in this is that I can only include a variable in the bounds if integration in that variable happens outside. Once I do a definite integral, the variable disappears entirey. It can't show up again. Therefore, variable bounds only happen on the inside integrals. If \(g\) and \(h\) are function, I have two general forms for integration of two-variable scalar fields.

\begin{align*} \amp \int_a^b \int_{g(x)}^{h(x)} f(x,y) dy dx\\ \amp \int_a^b \int_{g(y)}^{h(y)} f(x,y) dx dy \end{align*}

If I reverse the first of these two, I get

\begin{equation*} \int_{g(x)}^{h(x)} \int_a^b f(x,y) dx dy \end{equation*}

This makes no sense, since the bounds that involve \(x\) are outside the integral in \(x\text{;}\) outside that integral, the variable \(x\) should never appear.

I won't describe the pattern in full generality for all of \(\RR^n\text{,}\) but let me briefly look at functions of three variables. Consider boundings function which satisfy \(g_1 \leq h_1\) and \(g_2 \leq h_2\text{.}\) Then any of the following six patterns are reasonable, since the bounds include variables which are integrate outside the bounds in question.

\begin{align*} \amp \int_a^b \int_{g_1(x)}^{h_2(x)} \int_{g_2(x,y)}^{h_2(x,y)} f(x,y,z) dz dy dx\\ \amp \int_a^b \int_{g_1(x)}^{h_2(x)} \int_{g_2(x,z)}^{h_2(x,z)} f(x,y,z) dy dz dx\\ \amp \int_a^b \int_{g_1(y)}^{h_2(y)} \int_{g_2(x,y)}^{h_2(x,y)} f(x,y,z) dz dx dy\\ \amp \int_a^b \int_{g_1(y)}^{h_2(y)} \int_{g_2(y,z)}^{h_2(y,z)} f(x,y,z) dx dz dy\\ \amp \int_a^b \int_{g_1(z)}^{h_2(z)} \int_{g_2(x,z)}^{h_2(x,z)} f(x,y,z) dy dx dz\\ \amp \int_a^b \int_{g_1(z)}^{h_2(z)} \int_{g_2(y,z)}^{h_2(y,z)} f(x,y,z) dx dy dz \end{align*}

Subsection 2.2.2 Volume

The volume problem of the pyramid is a nice example, since integrals of two-variable scalar fields are volumes under the graphs in \(\RR^3\text{.}\) I'm going to do a couple more volume problems using these iterated integrals with variable bounds.

This technique also allows me to derive the volume of a sphere. I can think of the top half of a sphere as the volume under the graph of \(f(x,y) = \sqrt{r^2 - x^2 - y^2}\text{.}\) However, it is only the volume over the circle \(x^2 + y^2 = r^2\) in the \(xy\) plane. If I take the quarter of that circle in the positive quadrant, let \(D\) be the region where \(x \in [0,r]\) and \(y \in [0, \sqrt{r^2-x^2}]\text{.}\) One eighth of the sphere is measure by the following iterated integral.

\begin{align*} \int_D f(x,y) dA \amp = \int_0^r \int_0^{\sqrt{r^2-x^2}} \sqrt{r^2 - x^2 - y^2} dy dx\\ \amp = \int_0^r \left( \frac{y}{2} \sqrt{r^2 - x^2 - y^2} + \left. \frac{(r^2 - x^2)}{2} \arcsin \left( \frac{y}{\sqrt{r^2 - x^2}} \right) \right|_0^{\sqrt{r^2 - x^2}} \right) dx\\ \amp = \int_0^r \frac{\sqrt{r^2 - x^2}}{2} \sqrt{ r^2 - x^2 - (r^2 - x^2)} + \frac{(r^2-x^2)}{2} \arcsin \left( \frac{ \sqrt{r^2 - x^2}}{\sqrt{r^2 - x^2}} \right) dx\\ \amp = \int_0^r \frac{r^2 - x^2}{2} \frac{\pi}{2} dx = \int_0^r \frac{\pi (r^2-x^2)}{4} dx\\ \amp = \left. \frac{\pi r^2x}{4} - \frac{\pi x^3}{12} \right|_0^r = \frac{\pi r^3}{4} - \frac{\pi r^3}{12} = \frac{\pi r^3}{6} \end{align*}

Multiplying by \(8\) gives \(\frac{8\pi r^3}{6} = \frac{4\pi r^3}{3}\text{,}\) which is the familiar expression for the volume of a sphere. Of couse, I could have reversed the order and taken \(y \in [0,r]\) and \(x \in [0, \sqrt{r^2 - y^2}]\) and repeated very similar steps to also get the same answer.

I can also calcuate the volume of a cone of height \(h\) and radius \(r\text{.}\) I integrate over the same circle of radius \(r\text{,}\) but the function is \(f(x,y) = h - \frac{h}{r} \sqrt{x^2 + y^2}\text{.}\) (This function can be derived by looking at similar triangles in vertical sections of the cone.) The region \(D\) is one quarter of the cirlce, so this integral will give me one quarter of the volume of the cone.

\begin{align*} \int_D f(x,y) dA \amp = \int_0^r \int_0^{\sqrt{r^2 - x^2}} \left( h - \frac{h}{r} \sqrt{x^2 + y^2} \right) dy dx \end{align*}

The cone integral is quite difficult to do directly; for now, we'll leave it. I will return to this integral when I do change of variables.

The two previous examples found volume of a three-dimension object by integrating a two-variable function. This works because the graph of a two-variable function is an object in \(\RR^3\text{,}\) and the volume above the domain (in the \(z=0\) plane) and below the graph is a normal volume in \(\RR^3\text{.}\) However, there is another approach, one that is more conceptually interesting for formal mathematics.

Definition 2.2.5.

>

Let \(S\) be a integrable set in \(\RR^n\text{.}\) Then the size (area, volume, hypervolume) of \(S\) is defined to be

\begin{equation*} \int_S 1 dV\text{.} \end{equation*}

Note that this is a definition: there have no other way, in general, to understand the size of (integrable) sets in higher dimensions. This definition is the start of another whole branch of mathematics called measure theory. It deals with various ways of measuring sizes of sets in topological spaces.

I want to use this definition of volume to calculate the volume of a sphere or radius \(r\) in \(\RR^3\text{.}\) I ned to describe the sphere (or a portion of it) as a domain in \(\RR^3\) and then integrate the constant function \(f(x,y,z) = 1\) over that domain.

I will work with an eight of the sphere (and them multiply the result by eight). I'd like to describe the portion of the sphere where all three variables are positive. To describe this shape, I take \(x \in [0,r]\text{,}\) \(y \in [0, \sqrt{r^2-x^2}]\) and \(x \in [0, \sqrt{r^2 - x^2 - y^2}]\text{.}\) Then I calculate the volume.

\begin{align*} V = \int_D 1 dV \amp = \int_0^r \int_0^{\sqrt{r^2-x^2}} \int_0^{\sqrt{r^2 - x^2 - y^2}} 1 dz dy dx\\ \amp = \int_0^r \int_0^{\sqrt{r^2 - x^2 - y^2}} \sqrt{1-x^2 - y^2} dy dx \end{align*}

Subsection 2.2.3 More Examples of Integrals with Variable Bounds

Figure 2.2.8. The triangle with vertices \((0,0)\text{,}\) \((4,5)\) and \((6,2)\)

Say I wanted to integrate the function \(f(x,y) = xy\) over the triangle \(T\) with vertices \((0,0)\text{,}\) \((4,5)\) and \((6,2)\text{.}\) There isn't any one system of iterated integrals that covers this region; therefore I have to treat it as two sections. I divide the triangle into two pieces using the line \(x=4\text{.}\) On the left, the \(y\) coordinate is bounded by the lines \(y=\frac{x}{3}\) and \(y=\frac{5x}{4}\text{.}\) On the right, the \(y\) coordinate is bounded by \(y=\frac{x}{3}\) and \(y=-\frac{3x}{2} + 11\text{.}\) This division of the triangle and the bounding lines, above and below each piece, is shown in Figure 2.2.8. I calculate two integrals using these variables bounds for \(y\text{.}\)

\begin{align*} \int_0^4 \int_{\frac{x}{3}}^{\frac{5x}{4}} xy dy dx \amp = \int_0^4 \left. \frac{xy^2}{2} \right|_{\frac{x}{3}}^{\frac{5x}{4}} dx\\ \amp = \int_0^4 \frac{x}{2} \left( \frac{25x^2}{16} - \frac{x^2}{9} \right) dx\\ \amp = \int_0^4 \frac{25x^3}{32} - \frac{x^3}{18} = \int_0^4 \frac{209}{289} x^3 dx\\ \amp = \left. \frac{209}{288} \frac{x^4}{4} \right|_0^4 = \frac{1196}{9}\\ \int_4^6 \int_{\frac{x}{3}}^{\frac{-3x}{2} + 11} xy dy dx \amp = \int_4^6 \left. \frac{xy^2}{2} \right|_{\frac{x}{3}}^{\frac{-3x}{2} + 11} dx\\ \amp = \int_4^6 \frac{x}{2} \left( \frac{-3x}{2} + 11 \right)^2 - \frac{x}{2} \frac{x^2}{9} dx\\ \amp = \int_4^6 \frac{x}{2} \left( \frac{9x^2}{4} - 32 x + 121 \right) - \frac{x^3}{18} dx\\ \amp = \int_4^6 \frac{77x^3}{81} - \frac{33x^2}{2} + \frac{121 x}{2} dx\\ \amp = \left. \frac{77x^4}{324} - \frac{11x^3}{2} + \frac{121 x^2}{4} \right|_4^6\\ \amp = \frac{77 \cdot 6^4}{324} - \frac{11 \cdot 6^3}{2} + \frac{121 \cdot 6^2}{4} \\ \amp - \frac{77\cdot 4^4}{324} + \frac{11 4^3}{2} - \frac{121 \cdot 4^2}{4} \\ \amp = \frac{86845}{81} \end{align*}

The total is the sum of the two integrals.

\begin{equation*} \int_T f dA = \frac{1196}{9} + \frac{86845}{81} = \frac{97609}{81} \end{equation*}
Figure 2.2.10. Region of Integration

Say I want to integrate the function \(f(x) = x^2 + y^2\) over the region shown in Figure 2.2.10.

I should divide the figure up into three pieces. The first piece is the triangle \((0,0)\text{,}\) \((1,1)\text{,}\) and \((1,0)\text{.}\) The second is the half-circle above \(y=1\text{.}\) The third is the remaining triangle \((1,1)\text{,}\) \((2,1)\) and \((1,0)\text{.}\)

The first integral is a short calculation.

\begin{align*} \int_0^1 \int_0^x x^2 + y^2 dy dx \amp = \int_0^1 \left. x^2y + \frac{y^3}{3} \right|_0^x\\ \amp = \int_0^1 \frac{4x^3}{3} = \left. \frac{x^4}{3} \right|_0^1 = \frac{1}{3} \end{align*}

The second integral is more involved.

\begin{align*} \amp \int_1^3 \int_1^{1+\sqrt{1-(x-2)^2}} x^2 + y^2 dy dx\\ \amp = \int_1^3 \left. x^2y + \frac{y^3}{3} \right|_1^{1+\sqrt{1-(x-2)^2}}\\ \amp = \int_1^3 x^2 (1 + \sqrt{1-(x-2)^2}) + \frac{(1+\sqrt{1-(x-2)^2})^3}{3} dx\\ u \amp = x-2\\ \amp = \int_{-1}^1 (u^2 + 4u + 4) (1 + \sqrt{1-u^2}) + \frac{(1 + \sqrt{1-u^2})^3}{3} du\\ \amp = \int_{-1}^1 u^2 + 4u + 4 + u^2 \sqrt{1-u^2} + 4u \sqrt{1-u^2} + 4 \sqrt{1-u^2}\\ \amp \hspace{1cm} + \frac{1}{3} + \sqrt{1-u^2} + (1-u^2) - \frac{u^2}{3} \sqrt{1-u^3} du\\ \amp = \int_{-1}^1 \frac{16}{3} + 4u + 5 \sqrt{1-u^2} + 4u \sqrt{1-u^2} + u^2 \sqrt{1-u^2} + \frac{1}{3} (1-u^2)^{\frac{3}{2}} du\\ \amp = \frac{16u}{3} + 2u^2 + \left. 4 (1-u^2)^\frac{3}{2} \frac{-2}{3} \right|_{-1}^1 + 5 \int_{-1}{1} \sqrt{1-u^2} du \\ \amp + \int_{-1}^1 u^2 \sqrt{1-u^2} du + \frac{1}{3} \int_{-1}^1 (1-u^2)^{\frac{3}{2}} du\\ \amp = \frac{32}{5} + 0 + 0 + \left. \frac{1}{8} 2 \sqrt{1-u^2}(2u^2-1) + \arcsin u \right|_{-1}^1 \\ \amp + \left. 5 (u \sqrt{1-u^2} + \arcsin u) \right|_{-1}^1\\ \amp \hspace{1cm} + \left. \frac{1}{3} \frac{1}{8} (u(5-2u^2)\sqrt{1-u^2} + 3 \arcsin u ) \right|_{-1}^1\\ \amp = \frac{32}{3} + \frac{1}{8} \left( \frac{\pi}{2} - \frac{-\pi}{2} \right) + 5 \left( \frac{\pi}{2} - \frac{-\pi}{2} \right) + \frac{1}{8} \left( \frac{\pi}{2} - \frac{-\pi}{2} \right)\\ \amp = \frac{32}{3} + \frac{\pi}{8} + 5\pi + \frac{\pi}{8} = \frac{32}{3} + \frac{21\pi}{4} \end{align*}

The third integral is not quite as bad as the second.

\begin{align*} \int_1^2 \int_{x-1}^1 x^2 + y^2 dy dx \amp = \int_1^2 \left. x^2 y + \frac{y^3}{3} \right|_{x-1}^1 dx\\ \amp = \int_1^2 x^2 + \frac{1}{3} - x^2(x-1) - \frac{1}{3} (x-1)^3 dx\\ \amp = \int_1^2 \frac{2}{3} - x + 3x^2 - \frac{4x^3}{3} dx\\ \amp = \left. \frac{2x}{3} - \frac{x^2}{2} + x^3 - \frac{x^4}{3} \right|_1^2\\ \amp = \frac{4}{3} - 2 + 8 - \frac{16}{3} - \frac{2}{3} + \frac{1}{2} - 1 + \frac{1}{3}\\ \amp = \frac{7}{6} \end{align*}

The total is the sum of the three integrals.

\begin{equation*} \frac{1}{3} + \frac{32}{3} + \frac{21\pi}{4} + \frac{7}{6} = \frac{73}{6} + \frac{21\pi}{4} \end{equation*}

Here is an odd application of multiple integration. I know that \(e^{-x^2}\) has no elementary antiderivative. Therefore, the intergal

\begin{equation*} A = \int_{-\infty}^\infty e^{-x^2} dx \end{equation*}

cannot be evaluated directly. However, this is a very important integral: \(e^{-x^2}\) is the normal distribution and, in Statistics, I need to integrate it frequently. I'll use integrals over \(\RR^2\text{,}\) strangely enough, to calculate this integral by squaring the single variable integral.

\begin{align*} A \amp = 2 \int_{0}^\infty e^{-x^2} dx\\ A^2 \amp = \left( 2 \int_{0}^\infty e^{-x^2} dx \right) \left(2 \int_{0}^\infty e^{-y^2} dy \right) \end{align*}

The second integral uses a new variables since variables of integration only matter inside the integral. Then I can combine the two integrals.

\begin{align*} A^2 \amp = 4 \int_0^\infty \int_0^\infty e^{-x^2} e^{-y^2} dx dy\\ \amp = 4 \int_0^\infty \int_0^\infty e^{-(x^2 + y^2)} dx dy \end{align*}

Now I am going to do a substitution in the \(y\) variable. Treating the \(x\) variable as a constant, I replace \(y\) with \(y = xs\) so that \(dy = x ds\text{.}\) If \(y=0\) then \(s=0\) and as \(y \rightarrow \infty\text{,}\) \(s \rightarrow \infty\text{,}\) so the bounds for \(s\) remain the same as the bounds for \(y\text{.}\) Remember, \(x\) is a constant through this whole substitution. (Using Fubini's Theorem, I could think of \(y\) as the inside integral for this substitution, and then switch back to thinking of \(x\) as the inside integral after the substitution.)

\begin{align*} A^2 \amp = 4 \int_0^\infty \int_0^\infty e^{-x^2 (1+s^2)} x dx ds\\ \amp = 4 \int_0^\infty \left. \frac{-1}{2(1+s^2)} e^{-x^2(1+s^2)} \right|_0^\infty ds\\ \amp = 2 \int_0^\infty \frac{1}{1+s^2} ds\\ \amp = \lim_{a \rightarrow \infty} 2 \arctan a - \arctan 0 = \frac{2\pi}{2} = \pi\\ A \amp = \int_{-\infty}^\infty e^{-x^2} dx = \sqrt{\pi} \end{align*}

I recover the area under the bell curve: \(\sqrt{\pi}\text{.}\) It's a very strange result. However, if you taken any statistics and worked on normal distributions, likely you will recall the presence of these strange \(\sqrt{\pi}\) terms. Now I know they are present to normalize the area (since we want a probability function to have area one under its graph).