11. Riemann Integrals
≪ 10. Derivatives | Table of ContentsLast week, we described differentiation, which is a bit of a messy operation in theory, for a variety of reasons. This week, we’ll describe the way cooler older cousin of differentiation, integration, and we’ll showcase some of the ways in which it’s better. A main driving force behind that is the fundamental theorem of calculus, which makes the inverse relationship between integration and differentiation precise.
Let’s quickly recall the definition of an integrable function.
Definition 1.
A function \(f : \left[ a, b \right]\to \mathbb{R} \) is Riemann integrable if, for every \(\epsilon > 0\), there is a partition \(\mathcal{P}\) such that \[U \left( f; \mathcal{P} \right) - L \left( f; \mathcal{P} \right) < \epsilon.\]
Here, we typically write partitions \(\mathcal{P}\) as \(a = t_0 < t_1 < \cdots < t_n = b\). Of course, the upper and lower sums are defined as \[\begin{align*} U(f; \mathcal{P}) = \sum _{k=1}^{n} \sup _{t\in \left[ t _{k-1}, t_k \right]} f(t) \cdot \left( t _{k}- t _{k-1} \right) && \textrm{and} && L(f; \mathcal{P}) = \sum _{k=1}^{n} \inf _{t\in \left[ t _{k-1}, t_k \right]} f(t) \cdot \left( t_k - t _{k-1} \right). \end{align*}\] Ugh, what a clunky definition. The integral of \(f\) is then defined as \[\int _{a}^{b} f(t) dt = \sup L(f; \mathcal{P}) = \inf U \left( f; \mathcal{P} \right),\] where the supremum and infimum run over all possible partitions.
Traditionally (i.e. in calculus), we define integrals as a limit of Riemann sums, usually a left-hand, right-hand, or midpoint Riemann sum. For integrable functions, it actually does not matter what you do for the Riemann sum, as long as the widths of the intervals in these sums tends to \(0\).
This definition above is what ensures that happens: you should think of \(\mathcal{P}\) as dictating which intervals to use for a Riemann sum. \(U(f; \mathcal{P})\) represents the largest possible Riemann sum with the given partition, and \(L(f; \mathcal{P})\) represents the smallest possible Riemann sum. If, for some partition, the two are not far apart, this means that every Riemann sum should give approximately the same answer, as long as the underlying partition is fine enough.
Continuous functions, of course, are Riemann integrable over any closed interval:
Theorem 2.
If \(f: \left[ a, b \right]\to \mathbb{R}\) is continuous, then it is Riemann integrable.
Of course, not every Riemann integrable function is continuous, and one should be comfortable proving this. In fact, not every Riemann integrable function is even piecewise continuous — there are some that aren’t continuous anywhere.
Example 3.
Show that the function \(f : \left[ 0, 1 \right]\to \mathbb{R}\) via \[f(x) = \begin{cases} 0 & x \leq \frac{1}{2}, \\ 1 & x > \frac{1}{2}\end{cases}\] is Riemann integrable.
Solution
Example 4.
Let \(f : \left[ 0, 1 \right] \to \mathbb{R} \) via \(f(x) = \frac{1}{q}\) if \(x\) is a rational with \(x=\frac{p}{q}\) in lowest terms, and \(f(x) = 0\) if \(x\) is irrational. Show that although \(f\) is discontinuous at the rationals, \(f\) is Riemann integrable on \(\left[ 0, 1 \right]\).
Solution
Since \(f(x) \geq 0\) for all \(x\), and since every interval contains an irrational number, we have \(L(f; \mathcal{P}) = 0\) for any partition \(\mathcal{P}\). Thus, we need to show that for any \(\epsilon > 0\), there exists a partition \(\mathcal{P} \) such that \[U(f; \mathcal{P}) - L(f; \mathcal{P}) = U(f; \mathcal{P}) < \epsilon .\]
Let \(\epsilon > 0\). There exists an integer \(Q\) such that \(\frac{1}{Q} < \epsilon \). Enumerate \(r_0< \cdots< r_N\) as every rational number between \(0\) and \(1\) with a denominator \(\leq Q\). These are the only points for which \(f\left( x \right) \geq \epsilon \); whenever \(x \neq r_i\) for any \(i\), we have \(f(x) < \epsilon \).
We’ll now construct \(\mathcal{P}\) to consist of very, very narrow intervals centred at these rational points. Draw a picture with an example! Specifically, we’ll pick for \(\delta < \frac{1}{2} \min \left\lbrace r_k - r _{k-1} : k = 1,\ldots, N \right\rbrace\) the partition
\[\begin{align*}
t_0 &= r_0, \\
t_1 &= r_0 + \delta , \\
t_2 &= r_1 - \delta , \\
t_3 &= r_1 + \delta , \\
t_4 &= r_2 - \delta , \\
&\vdots \\
t _{2N} &= r_N - \delta , \\
t _{2N+1} &= r_N.
\end{align*}\]
For any \(k = 0,\ldots, N\), we have that the interval \(\left[ t _{2k}, t _{2k+1} \right]\) contains \(r_k\), and the best we can do is say that
\[\sup _{t\in \left[ t _{2k}, t _{2k+1} \right]}f(t) \leq 1.\]
On the other hand, none of the \(r_i\)’s are contained in intervals of the form \(\left[ t _{2k+1}, t _{2k+2} \right]\), hence
\[\sup _{t\in \left[ t _{2k+1}, t _{2k+2} \right]} f(t) \leq \epsilon .\]
Thus, we have
\[\begin{align*}
U(f; \mathcal{P}) &= \sum _{j=1}^{2N+1} \left( \sup _{t\in \left[ t _{j-1}, t_j \right]} f(t) \right) \left( t _j - t _{j-1} \right) \\
&\leq \sum _{k=0}^{N} \underbrace{1 \cdot \left( t _{2k+1} - t _{2k} \right)}_{\textrm{intervals containing }r_k} + \sum _{k=0}^{N-1} \underbrace{\epsilon \cdot \left( t _{2k+2} - t _{2k+1} \right)}_{\textrm{intervals containing no }r_k\textrm{’s}}.\\
&= 2N \delta + \epsilon.
\end{align*} \]
We are free to choose \(\delta \), so picking \(\delta < \frac{\epsilon }{2N}\) makes \(U(f; \mathcal{P}) \leq 2 \epsilon \). Replacing \(\epsilon \) with something smaller concludes the proof. \(\square\)
It can be shown, with moderate effort, that any bounded piecewise continuous function is Riemann integrable, using similar arguments to the above. (However, as you can probably foretell, this will be rather painful.)
Proving that a function is not Riemann integrable takes a bit more work. To show \(f: \left[ a, b \right]\to \mathbb{R}\) is not integrable, then there exists some \(\epsilon > 0\) such that for every partition \(\mathcal{P}\), \[U(f; \mathcal{P}) - L(f; \mathcal{P}) \geq \epsilon .\]
Example 5.
Show that the function \(f: \left[ 0, 1 \right]\to \mathbb{R}\) given by \[f(x) = \begin{cases} 1 & x\in \mathbb{Q}, \\ 0 & x \notin \mathbb{Q}\end{cases}\] is not Riemann integrable.
Proof
Perhaps the most famous fruit falling from the tree of integration theory is the fundamental theorem of calculus (well, one of them). It says, very loosely, that differentiation and integration are inverses of each other, with some caveats.
Theorem 6. The Fundamental Theorem of Calculus
Let \(f: \left[ a, b \right]\to \mathbb{R}\) be a continuous function, and define \[F(x) = \int _{a}^{x} f(t) dt. \] Then \(F\) is continuous on \(\left[ a, b \right]\), differentiable on \(\left( a, b \right)\), and \(F’(x) = f(x)\).
The condition that \(f\) is continuous is paramount, and it comes into play in the proof of this theorem. Returning to the function \(f(x) = \frac{1}{q}\) when \(x = \frac{p}{q}\in \mathbb{Q}\) is in lowest terms, and \(f(x) = 0\) otherwise, our proof of the integrability earlier revealed that \[F(x) = \int _{0}^{x} f(t) dt = 0\] for all \(x\in \left[ 0, 1 \right]\). Indeed, \(F\) is continuous and differentiable, but it no longer satisfies \(F’(x) = f(x)\).
On the flip side, it’s not necessarily true that \[f(x) = f(a) + \int _{a}^{x} f’(t) dt\] if \(f\) is differentiable. One needs \(f’\) to additionally be a Riemann integrable function — functions like \(f(x) = x^2\sin \left( \frac{1}{x} \right)\) are differentiable but have non-integrable derivatives (exercise!).
That being said, when the conditions of the fundamental theorem of calculus are satisfied, it can be used to prove some very satisfying theorems.
Theorem 7.
Let \(f:\left[ -1, 1 \right]\to \mathbb{R}\) be a continuous function that’s continuously differentiable on \((-1, 1)\setminus \left\lbrace 0 \right\rbrace\). Suppose \(\lim _{x\to 0} f’(x)\) exists. Then \(f\) is differentiable at \(0\), and \(f’(0) = \lim _{x\to 0} f’(x)\).