Integrable Functions

Video. Riemann Integrable Functions

Some Topics Covered Continuous functions are integrable, bounded and continuous at all but finitely many points; Thomae's Function
Important (Erratum)
At 42:30, the number of intervals in \(P\) containing a point \(z_i\) is at most \(2M\) rather than \(M\) because the point \(z_i\) could belong to at most 2 intervals in \(P\) (which happens when it's an endpoint of the intervals).

1. Continuous Functions are Riemann Integrable

Theorem
Suppose that \(f : [a,b] \rightarrow {\mathbb R}\) is continuous. Then \(f\) is Riemann integrable.
Proof
Because \([a,b]\) is compact, \(f\) is uniformly continuous on \([a,b]\). Let \(\epsilon > 0\) be given, and let \(\delta > 0\) be a real number such that every \(x,y \in [a,b]\) with \(|x-y| < \delta\) has \(|f(x) - f(y)| < \frac{\epsilon}{b-a}\). Now let \(P\) be any partition of \([a,b]\) such that \(|I| < \delta\) for all \(I \in P\). (For example, let \(N\) be a natural number such that \(\frac{b-a}{N} < \delta\) and let \(P\) be a partition of \([a,b]\) into \(N\) pieces of length \(\frac{b-a}{N}\).) Then
\[{}U(f,P) - L(f,P){}\]
\[{}= \sum_{I \in P} |I| \left( \sup_{x \in I} f(x) - \inf_{y \in I} f(y) \right){}\]
\[{}= \sum_{I \in P} |I| \left( f(x_I) - f(y_I) \right){}\]
for points \(x_I,y_I \in I\) such that the supremum and infimum of \(f\) on \(I\), respectively, are attained at \(x_I\) and \(y_I\). Since \(x_I\) and \(y_I\) both belong to \(I\), \(|x_I - y_I| \leq |I| < \delta\), so \(|f(x_I) - f(y_I)| < \frac{\epsilon}{b-a}\). Thus
\[{}U(f,P) - L(f,P){}\]
\[{}< \sum_{I \in P} |I| \frac{\epsilon}{b-a}{}\]
\[{}= (b-a) \frac{\epsilon}{b-a} = \epsilon.{}\]
Thus \(0 \leq U(f,P) - L(f,P) < \epsilon\).

To conclude, we know that any partition \(P\) satisfies the inequalities
\[{}L(f,P) \leq (L) \int_a^b f(t) dt{}\]
\[{}\leq (U) \int_a^b f(t) dt{}\]
\[{}\leq U(f,P).{}\]
Let \(\eta\) be the value of the upper integral minus the lower integral. It must be the case that \(\eta \geq 0\). If \(\eta > 0\), then this forces
\[{}U(f,P) - L(f,P){}\]
\[{}\geq \eta > 0{}\]
for all \(P\). However, we showed that this difference can be made arbitrarily small, so this means \(\eta = 0\). By definition, this means that \(f\) is Riemann integrable.

2. Discontinuous at Finitely Many Points

Theorem
Suppose that \(f : [a,b] \rightarrow {\mathbb R}\) is bounded and discontinuous at only finitely many points in \([a,b]\). Then \(f\) is Riemann integrable.
Proof
Let \(z_1 < z_2 < \cdots < z_N\) be the points in \([a,b]\) at which \(f\) is discontinuous. Let \(d\) be the minimum distance between adjacent \(z\)'s, i.e. \(d := \min\{ |z_1 - z_2|,\ldots,|z_{N-1} - z_N|\}\). It follows that if \(\zeta < d/2\), then the intervals \([z_i - \zeta,z_i + \zeta]\) are disjoint by the triangle inequality (since if any point \(y\) belonged to \(2\) of them, there would be two distinct \(z_i\)'s at distance at most \(\zeta\) to the point \(y\)). For each \(i = 1,\ldots,N\), let \(I_i\) be the interval \([z_i - \zeta,z_i + \zeta] \cap [a,b]\). Using the endpoints of the intervals \(I_i\) to subdivide \([a,b]\), there must exist closed intervals \(J_1,\ldots,J_K\) for some \(K\) such that \(\{I_1,\ldots,I_N,J_1,\ldots,J_K\}\) is a partition of \([a,b]\). Now if \(|f(x)| \leq M\) on \([a,b]\), then every \(I_i\) satisfies
\[{}|I_i| \left( \sup_{x \in I_i} f(x) - \inf_{y \in I_i} f(y) \right){}\]
\[{}\leq 2 M |I_i|{}\]
\[{}\leq 4 M \zeta{}\]
because
\[{}-M{}\]
\[{}\leq \inf_{y \in I_i} f(y){}\]
\[{}\leq \sup_{x \in I_i} f(x) \leq M{}\]
and \(|I_i| \leq 2 \zeta\). Thus
\[ \sum_{i=1}^N |I_i| \left( \sup_{x \in I_i} f(x) - \inf_{y \in I_i} f(y) \right) \leq 4 N M \zeta. \]
Once \(\epsilon > 0\) is given, choose \(\zeta\) so that \(\zeta < \epsilon/(8 NM)\). This implies
\[ \sum_{i=1}^N |I_i| \left( \sup_{x \in I_i} f(x) - \inf_{y \in I_i} f(y) \right) < \frac{\epsilon}{2}. \]
Now \(f\) is continuous on each \(J_i\) because none of these intervals contain any of the points \(z_1,\ldots,z_N\). This means that each \(J_i\) admits a partition \(P_i\) such that
\[ \sum_{I \in P_i} |I| \left( \sup_{x \in I} f(x) - \inf_{y \in I} f(y) \right) < \frac{\epsilon}{2K}. \]
Now let \(P\) be the partition \(\{I_1,\ldots,I_N\} \cup P_1 \cup \cdots \cup P_K\) of \([a,b]\).
\[{}U(f,P) - L(f,P){}\]
\[{}= \sum_{i=1}^N |I_i| \left( \sup_{x \in I_i} f(x) - \inf_{y \in I_i} f(y) \right){}\]
\[{}+ \sum_{i=1}^K \sum_{I \in P_i} |I| \left( \sup_{x \in I} f(x) - \inf_{y \in I} f(y) \right){}\]
\[{}< \frac{\epsilon}{2} + \sum_{i=1}^K \frac{\epsilon}{2K} = \epsilon.{}\]

3. Example: Thomae's Function

Example
Let
\[ f(x) := \begin{cases} 0 & x \not \in \mathbb{Q}, \\ \frac{1}{q} & x = \frac{p}{q} \text{ in lowest terms}. \end{cases}\]
We claim that \(f\) is Riemann integrable on \([0,1]\) (and in fact, any bounded interval).
Proof
To show this, first observe that \(\inf_{y \in I} f(y) = 0\) for any interval \(I\) because it contains irrationals. This implies that every lower sum is zero and
\[ (L) \int_0^1 f(t) dt = 0. \]
Now fix any \(\epsilon > 0\) and let \(N\) be a natural number such that \(N > \epsilon^{-1}\). Let \(z_1,\ldots,z_M\) be the points (if any) in \([0,1]\) at which \(f(z_i) > \frac{1}{N}\). (We note that there are only finitely many such points because there are only finitely many rationals in \([0,1]\) which have denominator \(\leq N\) when expressed in lowest terms.) Let \(P\) be the partition of \([0,1]\) into \(NM\) intervals of equal length. Let \(I \in P\). Then \(\sup_{x \in I} f(x) \leq \frac{1}{N}\) when none of the \(z_i\) belong to \(I\). If some \(z_i \in I\), then we make only the weaker statement \(\sup_{x \in I} f(x) \leq 1\). Thus
\[ |I| \sup_{x \in I} f(x) \leq \begin{cases} \frac{1}{N^2 M} & z_i \not \in I \text{ for all } i \\ \frac{1}{NM} & z_i \in I \text{ for some } i. \end{cases}\]
The number of intervals \(I \in P\) which contain a \(z_i\) is at most \(2M\) because each \(z_i\) can belong to at most \(2\) intervals. The number of intervals of the other type (not containing any \(z_i\)) is at most \(NM\) (since that's the total number of intervals). So
\[{}\sum_{I \in P} |I| \sup_{x \in I} f(x){}\]
\[{}\leq \frac{2M}{NM} + \frac{NM}{N^2M}{}\]
\[{}= \frac{3}{N} < 3 \epsilon.{}\]
Since \(\epsilon\) is arbitrary, this forces the upper integral of \(f\) on \([0,1]\) to be zero. Therefore \(f\) is Riemann integrable on \([0,1]\) and has integral zero.