5.19 Iterated integration and Fubini's theorem
For the next lectures, our goal is to describe how to compute integrals of functions in two variables \(f: \mathbb{R}^2 \to \mathbb{R}\) on different regions of the plane.
The idea we followed in the last lecture is that the integral is no longer the area below a curve, but a volume below a surface.
The method to compute this volume is to cut the solid in slices (by fixing a variable \(x\) or \(y\) in a value), compute the area of the slice and then sum up with an integral.
In our example, we considered the function \(f(x, y) = x^2 + y^2\)
and we were trying to find the volume below the graph over the closed disk \(\overline{B}((0,0), 2) = \{(x,y) \in \mathbb{R}^2 \mid x^2 + y^2 \leq 4\}\)
The volume below the surface with base the closed disk is
If we fix now \(x=1\), then the basis is the set \(\overline{B((0,0), 2)} \cap \{x=1\} = \{y \in \mathbb{R} | 1 + y^2 \leq 4\}\) \(= \{y \in \mathbb{R} | y^2 \leq 3\} = \{y \in \mathbb{R} | -\sqrt{3} \leq y \leq \sqrt{3}\}\)
The function in the variable \(y\) is now \(g(y) = f(1, y) = 1 + y^2 \quad \forall y \in [-\sqrt{3}, \sqrt{3}]\) and the area of the slice is \(\displaystyle\int_{-\sqrt{3}}^{\sqrt{3}}1 + y^{2} dy\)
Hence, if we do the same for a fixed value \(x=c\), we get that the base is \(\overline{B((0,0),2)} \cap \{x=c\} = \{y \in \mathbb{R} | c^2 + y^2 \leq 4\}\) \(= \{y \in \mathbb{R} | y^2 \leq 4 - c^2\} = \{y \in \mathbb{R} | -\sqrt{4 - c^2} \leq y \leq \sqrt{4 - c^2}\}\)
Then, the area is then given by \(\displaystyle\int_{-\sqrt{4-c^{2}}}^{\sqrt{4-c^{2}}}c^{2} + y^{2} dy = (c^{2}y + \frac{y^{3}}{3} )\Big|_{-\sqrt{4-c^{2}}}^{\sqrt{4-c^{2}}}= 2(c^{2}(4-c^{2})^{\frac{1}{2}}+ \frac{(4-c^{2})^{\frac{3}{2}}}{3} )\)
To sum up the slices in an infinitesimal way, we replace \(c\) by \(x\) and take the integral:
\(\displaystyle\int_{-2}^{2}\left(\int_{-\sqrt{4-x^{2}}}^{\sqrt{4-x^{2}}}x^{2} + y^{2} dy\right ) dx = \int_{-2}^{2}2\left(x^{2}(4-x^{2})^{\frac{1}{2}}+ \frac{(4-x^{2})^{\frac{3}{2}}}{3} \right) dx\)
Hence, to compute the volume below the surface, we need to compute a double integral!
In order to use this argument with other functions we need:
-
The function \(f(x, y)\) has to be integrable in the variable \(y\) when we fix the variable \(x\) (or be integrable in the variable \(x\) when we fix the variable \(y\)).
-
A nice way to describe the base for a fixed \(x\) (arbitrary) (or a nice way to describe the base for a fixed \(y\)).
-
The integral depending on the variable \(x\), \(\displaystyle F(x)=\int_{c(x)}^{d(x)}f(x, y) dy\) is an integrable function on \(x\).
If the conditions above hold, then we may define the volume by \(\displaystyle V = \int_{a}^{b} F(x) dx = \int_{a}^{b} \left( \int_{c(x)}^{d(x)}f(x, y) dy \right ) dx\)
We begin the discussion by analyzing the possible domains of integration.
Rectangles as domains
To start with the simpliest case, we begin by considering the case that we are integrating a continupus function over a rectangle: any rectangle in \(\mathbb{R}^2\) is of the form \([a, b] \times [c, d]\) with \(a < b\) and \(c < d\).
Let \(f: [a, b] \times [c, d] \to \mathbb{R}\) be a continuous non-negative function on the rectangle.
For a fixed \(x \in [a, b]\), the function is continuous in the variable \(y\) and hence integrable. In particular, the domain where we are integrating is \(\{(x, y) \mid y \in [c, d]\} = \{(x, y) \mid c \le y \le d\}\)
Then we define \(\displaystyle F(x) = \int_{c}^{d} f(x,y) \, dy\)
The function \(F(x)\) then represents the area between the graph of the function \(f\) intersected with the section of the plane \(\{ (x,y,z) \mid c \le y \le d, 0 \le z \} \subseteq \mathbb{R}^3\)
This is the set (\(x\) is fixed) \(\{ (x,y,z) \mid c \le y \le d, 0 \le z \le f(x,y) \} \subseteq \mathbb{R}^3\)
As \(x\) takes different values, we have different areas given by the function \(F(x)\) with \(a \leq x \leq b\).
Definition
Let \(R = [a, b] \times [c, d]\) be a rectangle in \(\mathbb{R}^3\).
The volume of the region above \(R\) and under the graph of a non-negative function \(f: R \rightarrow \mathbb{R}\) is called the double integral of \(f\) over \(R\) and it is denoted by \(\displaystyle \int_{a}^{b} \int_{c}^{d} f(x, y) \, dy \, dx\)
If we compute the same volume, but starting by fixing the variable \(y\) intead of \(x\). Do we get the same number?
Under the hypothesis we asked for, the answer is yes! It is the content of the famous theorem of Fubini.
Below we give a prove of this.
For the proof, we will need the following theorem. For its proof, we have to use the fact that a continuous function on a closed and bounded set in \(\mathbb{R}^2\) is \(\color{red} {\text{uniformly continuous}}\).
\(f\) is uniformly continuous at \(p\) if \(\forall \varepsilon>0\), \(\exists\delta\text{ (works for any p)}>0\) such that \(|f(p)-f(q)|<\varepsilon\) if \(||p-q||<\delta\)
Theorem
With the notation above. If \(f\) is continuous, then the function \(\displaystyle F(x) = \int_{c}^{d} f(x, y) \, dy\) is continuous for all \(a \leq x \leq b\).
Proof
NTP: \(F(x)\) is continuous at \(x_{0}\in[a,b]\), \(\forall\varepsilon>0\) s.t. \(|F(x)-F(x_0)|<\varepsilon\) if \(|x-x_0|<\varepsilon\)
Now \(\displaystyle \left|\int^{b}_{a}f(x,y)dy-\int^{d}_{c}f(x_{0},y)dy\right|=\left|\int ^{b}_{a}f(x,y)-f(x_{0},y)dy\right|\leq \int^{b}_{a}\left|f(x,y)-f(x_{0},y)\right| dy\) (*)
We know that \(f\) is continuous on \([a,b]\times[c,d]\)
Since \([a,b]\times[c,d]\) is compact, then \(f\) is uniformly continuous
That is \(\forall \varepsilon>0,\exists \delta>0\) (not depend on x), s.t. \(\left|f(x,y)-f(x_{0},y_{0})\right|<\varepsilon\) (actually it is \(<\frac{\varepsilon}{d-c}\)) if \(||(x,y)-(x_0,y_0)||<\delta\) where \(||(x,y)-(x_{0},y_{0})||=\sqrt{(x-x_{0})^{2}+(y-y_{0})^{2}}<\delta\)
But in (*) we know \(||(x,y)-(x_0,y)||=|x-x_0|<\delta\), thus \(\left|f(x,y)-f(x_{0},y)\right|<\varepsilon\), then set it to be \(\left|f(x,y)-f(x_{0},y)\right|<\frac{\varepsilon}{d-c}\)
So, \(\displaystyle \int_{c}^{d} |f(x,y)-f(x_{0},y)|dy\) \(\displaystyle \le \int_{c}^{d} \frac{\epsilon}{d-c}dy\) \(\displaystyle\le \frac{\epsilon}{d-c}\int_{c}^{d} 1 dy\) \(\displaystyle= \frac{\epsilon}{d-c}(d-c) = \epsilon\)
Up to now, we have defined a function in one variable using a function on two variables and integrals. So, several natural questions arise:
Questions.
-
Is this function differentiable?
-
Does it satisfy the Fundamental Theorem of Calculus?
The answer is given by a theorem of Leibniz.
Set \(R = [a, b] \times [c, d] \subset \mathbb{R}^2\).
Theorem (Leibnitz)
Let \(f: \R \rightarrow \mathbb{R}\) be a continuous function and consider \(\displaystyle F(x) = \int_{c}^{d} f(x, y) \, dy\)
Assume that the partial derivative \(\frac{\partial f}{\partial x}(x, y)\) exists for all \((x, y) \in \R\) and it is continuous in \(\R\).
Then \(F\) is differentiable in \([a, b]\) and
Proof
We want to prove that \(F\) is differentiable at \(t\in [a,b]\) where \(\displaystyle F(t)=\int^d_cf(t,y)dy\), then NTP: \(\lim_{h\to 0}\frac{F(t+h)-F(t)}{h}\) exists
\(\displaystyle \frac{F(t+h)-F(t)}{h}=\frac{1}{h}\left(\int^{d}_{c} f(t+h,y)dy-\int ^{d}_{c} f(t,y)dy\right)=\int^{d}_{c}\frac{f(t+h,y)-f(t,y)}{h}dy\)
Recall that \(\frac{\partial f}{\partial x}(t,y)=\lim_{h\to 0}\frac{f(t+h,y)-f(t,y)}{h}\), we don't want limit, then use Lagrange Theorem
\(\frac{f(t+h,y)-f(t,y)}{h}=\frac{\partial f}{\partial x}(s,y)\) for some \(s\) between \(t+h\) and \(t\)
Thus \(\displaystyle\int_{c}^{d}\frac{f(t+h,y)-f(t,y)}{h}dy= \int_{c}^{d}\frac{\partial f}{\partial x}(s,y) dy\), then \(\displaystyle\lim_{h\to 0}\int_{c}^{d}\frac{f(t+h,y)-f(t,y)}{h}dy= \lim_{h\to 0} \int_{c}^{d}\frac{\partial f}{\partial x}(s,y) dy\)
Consider \(\frac{\partial f}{\partial x}(s,y)\) is a function in two variables, it is continuous. Then \(\displaystyle G(t)=\int_{c}^{d}\frac{\partial f}{\partial x}(s,y)dy\) is also continuous by above theorem
Then \(\lim_{s\to t}G(s)=G(t)\), then \(\displaystyle \lim_{s\to t}\int_{c}^{d}\frac{\partial f}{\partial x}(s,y)dy=\int_{c}^{d}\frac{\partial f}{\partial x}(t,y)dy\)
If the function \(f: R \rightarrow \mathbb{R}\) is good enough, after integrating in one direction we can integrate in the other.
So, if \(F(x)\) is integrable in \([a, b]\), we can compute \(\displaystyle\int_{a}^{b} F(x) \, dx = \int_{a}^{b} \left(\int_{c}^{d} f(x,y) \, dy \right) \, dx\)
This is called the iterated integral.
Remark
By interchanging the roles of \(x\) and \(y\) one may define a function on \(y\): \(\displaystyle G(y) = \int_{a}^{b} f(x,y) \, dx\)
and if \(G(y)\) is integrable on \([c, d]\), then one can compute the iterated integral \(\displaystyle \int_{c}^{d} G(y) \, dy = \int_{c}^{d} \left(\int_{a}^{b} f(x,y) \, dx \right) d y\)
The iterated integrals and are not equal in general (see examples in tutorial/homework).
But if the function \(f\) is continuous on \(R\), then they coincide by the following famous theorem.
Theorem (Fubini)
Let \(R = [a, b] \times [c, d] \subset \mathbb{R}^2\) and let \(f: R \to \mathbb{R}\) be a continuous function. Then
Proof
Since \(f\) is continuous, then \(\displaystyle F(x)=\int_{c}^{d}f(x,y)\,dy,G(x)=\int_{a}^{b}f(x,y)\,dx\) are continuous by first theorem
Thus both are integrable and NTP: \({\displaystyle\int_{a}^{b}F\left(x\right)\,dx=\int_{c}^{d}G\left(x\right)dy}\)
Let \(\displaystyle g(t)=\int_{a}^{t}F(x)dx=\int_{a}^{t}\left(\int_{c}^{d}f\left(x,y\right )dy\right) dx\) and \({\displaystyle h(t)=\int_{c}^{d}\left(\int_{a}^{t}f\left(x,y\right)dx\right)dy}\)
These are both functions on \(t\in[a,b]\), NTP: \(g(b)=h(b)\)
Actually, we are going to prove that \(g(t)=h(t)%\) \(\forall t\). Idea: Prove that \(g'(t)=h'(t)\)and \(g(a)=h(a)\)
For \(\displaystyle g(t)=\int_{a}^{t} F(x) dx\) where \(\displaystyle F(x) = \int_{c}^{d}f(x,y) dy\)
Since \(f(x,y)\) is continuous, then by theorem \(F(x)\) is continuous, then \(g\) is differentiable in \([a,b]\) by fundamental theorem of calculus and \(\displaystyle g'(t)=F(t) = \int_{c}^{d} f(t,y) dy\)
Now \(\displaystyle h(t) = \int_{c}^{d} \left(\int_{a}^{t} f(x,y) dx\right) dy\)
Let \(\displaystyle S_{y}(t) = \int_{a}^{t} f(x,y) dx\), since \(f(x,y)\) is continuous \(\forall (x,y) \in \mathbb{R}\), then \(S_y(t)\) is continuous, then \(\frac{\partial S_y}{\partial t}\) exist and cont.
Let \(\displaystyle h(t) = \int_{c}^{d} S_{y}(t) dy\), then \(\displaystyle h'(t) = \left(\int_{c}^{d} S_{y}(t) dy\right)'\)
By Leibnitz theorem \(=\) \(\displaystyle \int_{c}^{d} \frac{\partial S_{y}(t)}{\partial t}dy = \int_{c}^{d} f(t,y) dy\) (\(\frac{\partial S_{y}}{\partial t}(t,y) = f(t,y)\) is cont! by FTC)
\(\implies g'(t) = h'(t)\)
\(\implies g(t) - h(t) = C\) constant
\(0 = g(a) - h(a) = C\)
Remark
When \(f: R \to \mathbb{R}\) is continuous, we simply write
\(\displaystyle\int_{a}^{b}\left(\int_{c}^{d}f(x,y) \, dy \right) \, dx = \int_{c} ^{d}\left( \int_{a}^{b}f(x,y) \, dx \right) dy = \iint_{R}f(x,y) \, dA\)
In this case, the double integral on a non-negative continuous function is the iterated integral (in any order).
Example
\(\displaystyle \int_{0}^{1} \frac{x^{3} - x^{2}}{\ln x}dx\)
Note \(\frac{x^{3}- x^{2}}{\ln x}= \frac{x^{3}}{\ln x}- \frac{x^{2}}{\ln x}\) \(\displaystyle = \left( \frac{x^{y}}{\ln x}\right)_{2}^{3} = \int_{2}^{3} x^{y} dy\)
\(\displaystyle\frac{x^{y}}{\ln x}\) is a primitive of \(x^{y}\) with respect to \(y\) because \(f(x,y) = x^y\), \(\frac{\partial f(x,y)}{\partial y} = x^y \ln(x)\), \(\frac{\partial}{\partial y} \left( \frac{x^y}{\ln x} \right) = \frac{1}{\ln x} x^y \ln x = x^y\)
Then \(\displaystyle \int_{0}^{1} \frac{x^{3} - x^{2}}{\ln x}dx = \int_{0}^{1} \left( \int _{2}^{3} x^{y} dy \right) dx\) where \(x^y\) is continuous
By Fubini's theorem \(\displaystyle = \int_{2}^{3} \left( \int_{0}^{1} x^{4} dx \right) dy\) \(\displaystyle = \int_{2}^{3} \left( \frac{x^{4+1}}{4+1}\right)_{0}^{1} dy\) \(\displaystyle = \int_{2}^{3}\frac{1}{y+1}dy = (\ln|y+1|)_{2}^{3}\) \(= \ln(4) - \ln(3)\)