icon nav

Riemann Integration

Part 2
  • Real Analysis
  • Mathematics

Riemann Integration

 

The Riemann Integral is not Enough

For the majority of functions you will come across on a regular basis, Riemann integration will work just fine. However, this doesn’t mean that this approach to the integral will work for all functions. In this section, we will discuss the shortcomings of the Riemann integral. Is it possible for a function to be integrable but not Riemann integrable?


Example 1. Define the function f: [0,1] \rightarrow \mathbb{R} as f(x) = \begin{cases}<br>    1 & x \in \mathbb{Q} \\<br>    0 & x \notin \mathbb{Q}<br>    \end{cases}


Note that the rational numbers and irrational numbers are what we call dense in the real numbers. What this means is that any interval of real numbers, no matter how small we make that interval, will contain both a rational number and an irrational number.



Therefore, for any interval [a,b] \subset [0,1], we will have \inf_{[a,b]} f = 0 and \sup_{[a,b]} = 1 This means that, for any partition P of [0,1], we will always have L(f,P,[0,1]) = 0 and U(f,P,[0,1]) = 1 Hence, there is no partition we can choose that will give us L(f,P,[0,1]) = U(f,P,[0,1]) and therefore, f is not Riemann integrable.

Now let’s look at what happens when we attempt to take the Riemann integral of a function which is unbounded. If you paid attention in Calculus 2, you may remember that it is possible to solve some integrals which break the standard rules of integration. One such example is below.


Example 2. Define f:[0,1] \rightarrow \mathbb{R} by f(x) = \begin{cases}<br>    \dfrac{1}{\sqrt{x}} & 0 < x \leq 1 \\<br>    0 & x=0<br>    \end{cases}


Here, we have an instance where \sup_{[0,1]} f = \infty Hence, no matter how we partition [0,1], we will have U(f,P,[0,1]) = \infty However, if we integrate this in our standard calculus way, using an improper integral, we get \int_0^1 f = \lim_{a \rightarrow 0} \int_a^1 \frac{1}{\sqrt{x}} \, dx = \lim_{a \rightarrow 0} \left[ 2 \sqrt{x} \, \Big|^1_a \right] = \lim_{a \rightarrow 0} (2-2\sqrt{a}) = 2

Here is another example of a function which isn’t Riemann integrable but can still be integrated:


Example 3. Let r_1, r_2, \dots be a sequence which includes every rational number in [0,1] exactly once and which includes no other numbers. In other words, we have \mathbb{Q} \cap (0,1) = \{r_1,r_2, \dots \} For k \in \mathbb{Z}^+, define f_k:[0,1] \rightarrow \mathbb{R} f_k(x) = \begin{cases}<br>    \dfrac{1}{\sqrt{x-r_k}} & x >r_k \\<br>    0 & x \leq r_k<br>    \end{cases}


Finally, define f:[0,1] \rightarrow [0,\infty) by f(x) = \sum_{k=1}^{\infty} \frac{f_k(x)}{2^k} Similar to the first example, this integral will run into problems due to the density of the rational numbers. Every open interval in [0,1] that we can possible create will contain a rational number. Hence the function f is unbounded, meaning the Riemann integral of f is undefined on every subinterval of [0,1]



However, the area under the graph of each f_k is \int_0^1 f_k = \lim_{a \rightarrow 0} \int_a^1 \frac{1}{\sqrt{x-r_k}} \, dx =  \lim_{a \rightarrow 0} \left[ 2 \sqrt{x-r_k} \, \Big|^1_a \right] = \lim_{a \rightarrow 0} \, [2(\sqrt{1-r_k} - \sqrt{a-r_k} )] = 2 \sqrt{1-r_k} < 2 meaning that the integral of f should actually be \int_0^1 f = \lim_{n \rightarrow \infty} \sum_{k=1}^n \frac{1}{2^k} \int_0^1 f_k = \lim_{n \rightarrow \infty} \sum_{k=1}^n \frac{1}{2^k} (2) = \lim_{n \rightarrow \infty} \sum_{k=1}^n \frac{1}{2^{k-1}} = \frac{1}{1-\frac{1}{2}} = 2


Example 4. Riemann integration also won’t work well with pointwise limits.



Let’s define \{r_1,r_2, \dots \} the same way as in the previous example, with \mathbb{Q} \cap (0,1) = \{r_1,r_2, \dots \} For k \in \mathbb{Z}^+, define f_k(x) = \begin{cases}<br>    1 & x \in \{r_1,r_2, \dots, r_k \} \\<br>    0 & x \notin \{r_1,r_2, \dots, r_k \}<br>    \end{cases}

Here, we’ll have \int_0^1 f_k = 0 \quad \forall k \in \mathbb{Z}^+ Now, define f(x) = \begin{cases}<br>    1 & x \in \mathbb{Q} \\<br>    0 & x \notin \mathbb{Q}<br>    \end{cases}

Clearly, f(x) = \lim_{n \rightarrow \infty} f_k(x)

However, f is not Riemann integrable.


Interchanging the Riemann Integral and the Limit

Now, there are instances in which we can say that \lim_{n \rightarrow \infty} \int_a^b f_k = \int_a^b \lim_{k \rightarrow \infty} f_k However, this will require more than just "the limit exists."

Suppose a,b,M \in \mathbb{R} with a<b. Now, suppose f_1,f_2, \dots is a sequence of Riemann integrable functions on [a,b] such that |f_k(x)| \leq M \quad \forall k \in \mathbb{Z}^+, \, \forall x \in [a,b] and suppose \lim_{k \rightarrow \infty} f_k(x) exists \forall x \in [a,b] Define f[a,b] \rightarrow \mathbb{R} by f(x) = \lim_{k \rightarrow \infty} f_k(x) and further require that f_k converges uniformly to f. If f is Riemann integrable on [a,b], then we can say \int_a^b f = \lim_{n \rightarrow \infty} \int_a^b f_k

Exercises


Problem 5. Define f[0,1] \rightarrow \mathbb{R} as follows f(a) = \begin{cases}<br>    0 & \text{if } a \notin \mathbb{Q} \text{ or } x=0,1\\<br>    \dfrac{1}{n} & \text{if }a = \frac{m}{n} \text{ (most reduced fraction)}<br>    \end{cases}

Show that f is Riemann integrable and compute \int_0^1 f


Solution: To show that this function is Riemann integrable, we want to show that for any \epsilon >0, there exists a partition P such that U(f,P,[0,1]) - L(f,P,[0,1]) < \epsilon Let’s look at the lower sum first. We know that, regardless of what partition we choose, we must have \inf_{[x_{j-1}, x_j]} f = 0 for every interval [x_{j-1}, x_j] in our partition, since any interval will contain at least one irrational number. Hence L[(f,P,[0,1]) for all partitions P. Now for the upper sum. Notice that for any subinterval [x_{j-1}, x_j], we will have \sup_{[x_{j-1}, x_j]} f = \frac{1}{n} where n is the smallest integer such that \frac{m}{n} is in the interval. Now, this tells us that the supremum has an upper bound. Let’s see how small we can make \frac{1}{n}.



Let \epsilon > 0. Let P be a partition with n subintervals. We want U(f,P,[0,1]) = \sum_{j=1}^n (x_{j-1}, x_j) \sup_{[x_{j-1}, x_j]} f < \epsilon Since we know that the supremum, is bounded, making the length of each interval sufficiently small should be able to satisfy this inequality.



In other words, choose a \delta > 0 such that \delta < \frac{\epsilon}{(x_{j-1}, x_j) \sup_{[x_{j-1}, x_j]}} for all [x_{j-1}, x_j] in P_n.



Now we have L(f,P,[0,1]) = 0 and U(f,P,[0,1]) < \epsilon Therefore we have the result U(f,P,[0,1]) - L(f,P,[0,1]) < \epsilon and \int_0^1 f = 0 \blacksquare


Problem 6. Suppose f: [0,1] \rightarrow \mathbb{R} is a bounded function. Prove that f is Riemann integrable if and only if L(-f,[a,b]) = -L(f,[a,b]).


Solution: We proved the forward direction in Problem 1.5 in the previous section, where we showed that L(-f,[a,b]) = -U(f,[a,b]) and U(-f,[a,b]) = -L(f,[a,b] ) To prove (\Leftarrow), notice that L(-f,[a,b]) = -L(f,[a,b]) \iff -U(f,[a,b]) = -L(f,[a,b]) \iff U(f,[a,b]) = L(f,[a,b]) Therefore, f is Riemann integrable. \blacksquare


Problem 7. Suppose f,g: [a,b] \rightarrow \mathbb{R} are two bounded functions. Prove that L(f,[a,b]) + L(g,[a,b]) \leq L(f+g,[a,b]) and U(f,[a,b]) + U(g,[a,b]) \geq U(f+g,[a,b])


Solution: For any partition P = \{x_0.x_1, \dots, x_n \} of [a,b] we have, for all [x_{j-1},x_j] where j=1,2,\dots, n and for all x \in [x_{j-1},x_j], \inf_{[x_{j-1},x_j]}f + \inf_{[x_{j-1},x_j]}g \leq f(x) + g(x) = (f+g)(x) \Rightarrow \inf_{[x_{j-1},x_j]}f + \inf_{[x_{j-1},x_j]}g \leq \inf_{[x_{j-1},x_j]}(f+g) Therefore L(f,P, [a,b]) + L(g,P,[a,b]) = \sum_{j=1}^n (x_j - x_{j-1})\inf_{[x_{j-1},x_j]}f + \sum_{j=1}^n (x_j - x_{j-1})\inf_{[x_{j-1},x_j]}g \leq \sum_{j=1}^n (x_j - x_{j-1})\inf_{[x_{j-1},x_j]}(f+g) = L(f+g,P,[a,b]) Now for any partition P L(f, [a,b]) + L(g,[a,b]) \leq L(f+g,P, [a,b]) \Rightarrow L(f, [a,b]) + L(g,[a,b]) \leq L(f+g, [a,b]) The proof for the upper sum will follow the same argument. \blacksquare


Problem 8. Give an example of bounded functions f,g: [0,1] \rightarrow \mathbb{R} such that L(f,[0,1]) + L(g,[0,1]) < L(f+g, [0,1])) and U(f,[0,1]) + U(g,[0,1]) > U(f+g, [0,1]))


Solution: For one example of such a function, take f(x) = \begin{cases}<br>    0 & x \in \mathbb{Q} \\<br>    1 & x \notin \mathbb{Q}<br>    \end{cases} and g(x) = \begin{cases}<br>    1 & x \in \mathbb{Q} \\<br>    0 & x \notin \mathbb{Q}<br>    \end{cases} Now for any partition P of [0,1] and interval [x_{j-1},x_j] contained in our partition, we’ll have \inf_{[x_{j-1},x_j]} f = \inf_{[x_{j-1},x_j]} g = 0 while \inf_{[x_{j-1},x_j]} (f+g) = 1 So we’ll have L(f,[0,1]) + L(g,[0,1]) < L(f+g, [0,1])) Similarly, we’ll have \sup_{[x_{j-1},x_j]} f = \sup_{[x_{j-1},x_j]} g = 1 and \sup_{[x_{j-1},x_j]} (f+g) = 1 giving us U(f,[0,1]) + U(g,[0,1]) > U(f+g, [0,1]))


Problem 9. Give an example of a sequence of continuous, real-valued functions f_1, f_2, \dots on [0,1] and a continuous real-valued function f on [0,1] such that f(x) \lim_{k \rightarrow \infty} f_k(x) \quad \forall x \in [0,1] but \int_0^1 f \neq \lim_{n \rightarrow \infty} \int_0^1 f_k


Solution: We can find one such example by defining f_k(x) = \begin{cases}<br>    4k^2 x & x \in \left[0,\frac{1}{2k} \right] \\<br>    -4k^2 x + 4k & x \in \left(\frac{1}{2k},\frac{1}{k} \right] \\<br>    0 & \text{otherwise}<br>    \end{cases}

So each f_k(x) will look similar to the triangle below

As k \rightarrow \infty, the size of the intervals \left[0,\frac{1}{2k} \right] and \left[\frac{1}{2k},\frac{1}{k} \right] will approach zero, giving us f(x) = \lim_{k \rightarrow \infty} f_k(x) = 0 giving us \int_0^1 f = 0 However, if we look at the area under the curve for any f_k, we have \int_0^1 f_k = \frac{\frac{1}{k} \cdot 2k}{2} = 1 and so \lim_{k \rightarrow \infty} \int_0^1 f_k = 1 Hence \lim_{k \rightarrow \infty} \int_0^1 f_k \neq \int_0^1 f