## The Riemann Integral

We begin with the definition of a partition.
Let \(a,b\in\real\) and suppose \(a \lt b\). By a

Hence, a partition \(\mathcal{P}\) defines a finite collection of non-overlapping intervals \(I_k=[x_{k-1},x_k]\), where \(k=1,\ldots,n\). The **partition**of the interval \([a,b]\) we mean a collection of intervals \[ \mathcal{P} = \{ [x_0,x_1], [x_1,x_2], \ldots, [x_{n-1},x_n] \} \] such that \(a=x_0 \lt x_1 \lt x_2 \lt \cdots \lt x_n=b\) and where \(n\in\N\).**norm**of a partition \(\mathcal{P}\) is defined as \[ \|\mathcal{P}\| = \max\{ x_1-x_0,x_2-x_1,\ldots,x_n-x_{n-1}\}. \] In other words, \(\|\mathcal{P}\|\) is the maximum length of the intervals in \(\mathcal{P}\). To ease our notation, we will denote a partition as \(\mathcal{P}=\{ [x_{k-1},x_k] \}_{k=1}^n\). Let \(\mathcal{P}=\{[x_{k-1},x_k]\}_{k=1}^n\) be a partition of \([a,b]\). If \(t_k\in I_k=[x_{k-1},x_k]\) then we say that \(t_k\) is a

**sample**of \(I_k\) and the set of ordered pairs \[ \dot{\mathcal{P}}=\{([x_{k-1},x_k],t_k)\}_{k=1}^n \] will be called a

**sampled partition**.

Examples of sampled partitions are mid-points, right-end points, and left-end points partitions.

Now consider a function \(f:[a,b]\rightarrow\real\) and let \(\dot{\mathcal{P}}=\{([x_{k-1},x_k],t_k)\}_{k=1}^n\) be a sampled partition of the interval \([a,b]\). The **Riemann sum**of \(f\) corresponding to \(\dot{\mathcal{P}}\) is the number \[ S(f;\dot{\mathcal{P}}) = \sum_{k=1}^n f(t_k) (x_k - x_{k-1}). \] When \(f(x) \gt 0\) on the interval \([a,b]\), the Riemann sum \(S(f;\dot{\mathcal{P}})\) is the sum of the areas of the rectangles with height \(f(t_k)\) and width \((x_k-x_{k-1})\). We now define the notion of Riemann integrability.

The function \(f:[a,b]\rightarrow\real\) is said to be

The set of all Riemann integrable functions on the interval \([a,b]\) will be denoted by \(\mathcal{R}[a,b]\).
**Riemann integrable**if there exists a number \(L\in\real\) such that for every \(\eps \gt 0\) there exists \(\delta \gt 0\) such that for any sampled partition \(\dot{\mathcal{P}}\) that satisfies \(\|\dot{\mathcal{P}}\| \lt \delta\) it holds that \(|S(f;\dot{\mathcal{P}})-L| \lt \eps\).
If \(f\in\mathcal{R}[a,b]\) then the number \(L\) in the definition of Riemann integrability is unique.

Let \(L_1\) and \(L_2\) be two real numbers satisfying the definition of Riemann integrability and let \(\eps \gt 0\) be arbitrary. Then there exists \(\delta \gt 0\) such that \(|S(f;\dprt)-L_1| \lt \eps/2\) and \(|S(f;\dprt)-L_2| \lt \eps/2\), for all sampled partitions \(\dprt\) with \(\|\dprt\| \lt \delta\). Then, if \(\|\dprt\| \lt \delta\) it holds that
\begin{align*}
|L_1-L_2| &\leq |S(f;\dprt)-L_1| + |S(f;\dprt)-L_2|\\
& \lt \eps.
\end{align*}
By Theorem 2.2.7 this proves that \(L_1=L_2\).

If \(f\in \mathcal{R}[a,b]\), we call the number \(L\) the **integral of \(f\) over \([a,b]\)**and we denote it by \[ L = \int_a^b f \]

Show that a constant function on \([a,b]\) is Riemann integrable.

Let \(f:[a,b]:\rightarrow\real\) be such that \(f(x) = C\) for all \(x\in [a,b]\) and let \(\dprt=\{([x_{k-1},x_k],t_k)\}\) be a sampled partition of \([a,b]\). Then
\begin{align*}
S(f;\dprt) &= \sum_{k=1}^n f(t_k) (x_k-x_{k-1}) \\
&= C \sum_{k=1}^n (x_k-x_{k-1}) \\
&= C (x_n-x_0)\\
&= C (b-a).
\end{align*}
Hence, with \(L=C(b-a)\), we obtain that \(|S(f;\dprt)-L|=0 \lt \eps\) for any \(\eps \gt 0\) and therefore \(\int_a^b f = C(b-a)\). This proves that \(f\) is Riemann integrable.

Prove that \(f(x)=x\) is Riemann integrable on \([a,b]\).

We consider the special case that \([a,b]=[0,1]\), the general case is similar. Let \(\dot{\mathcal{Q}}=\{([x_{k-1},x_k],q_k)\}\) be a sampled partition of \([0,1]\) chosen so that \(q_k=\tfrac{1}{2}(x_{k}+x_{k-1})\), i.e., \(q_k\) is the midpoint of the interval \([x_{k-1},x_k]\). Then
\begin{align*}
S(f;\dot{\mathcal{Q}}) &= \sum_{k=1}^n f(q_k) (x_k-x_{k-1}) \\[2ex]
&= \sum_{k=1}^n \tfrac{1}{2} (x_k+x_{k-1})(x_k-x_{k-1})\\[2ex]
&= \frac{1}{2}\sum_{k=1}^n (x_k^2-x_{k-1}^2)\\[2ex]
&= \frac{1}{2} ( x_n^2 - x_0^2)\\[2ex]
&= \frac{1}{2}( 1^2-0^2)\\[2ex]
&= \frac{1}{2}.
\end{align*}
Now let \(\dprt=\{([x_{k-1},x_k]),t_k\}_{k=1}^n\) be an arbitrary sampled partition of \([0,1]\) and suppose that \(\|\dprt\| \lt \delta\), so that \((x_k-x_{k-1})\leq \delta\) for all \(k=1,2,\ldots,n\). If \(\dot{\mathcal{Q}}=\{([x_{k-1},x_k],q_k)\}_{k=1}^n\) is the corresponding midpoint sampled partition then \(|t_k-q_k| \lt \delta\). Therefore,
\begin{align*}
|S(f;\dprt)-S(f;\dot{\mathcal{Q}})| &= \left|\sum_{k=1}^n t_k (x_k-x_{k-1}) -q_k (x_k-x_{k-1})\right| \\[2ex]
&\leq \sum_{k=1}^n |t_k-q_k| (x_k-x_{k-1})\\[2ex]
& \lt \delta (1-0)\\[2ex]
&= \delta.
\end{align*}
Hence, we have proved that for arbitrary \(\dprt\) that satisfies \(\|\dprt\| \lt \delta\) it holds that \(|S(f;\dprt)-1/2| \lt \delta\). Hence, given \(\eps \gt 0\) we let \(\delta=\eps\) and then if \(\|\dprt\| \lt \delta\) then \(|S(f;\dprt)-1/2| \lt \eps\). Therefore, \(\int_0^1 f = \frac{1}{2}\).

The next result shows that if \(f\in \mathcal{R}[a,b]\) then changing \(f\) at a finite number of points in \([a,b]\) does not affect the value of \(\int_a^b f\).
Let \(f\in \mathcal{R}[a,b]\) and let \(g:[a,b]\rightarrow\real\) be a function such that \(g(x)=f(x)\) for all \(x\in [a,b]\) except possibly at a finite number of points in \([a,b]\). Then \(g\in \mathcal{R}[a,b]\) and in fact \(\int_a^bg = \int_a^b f\).

Let \(L=\int_a^b f\). Suppose that \(g(x)=f(x)\) except at one point \(x=c\). Let \(\dprt=\{([x_{k-1},x_k],t_k)\}\) be a sampled partition. We consider mutually exclusive cases. First, if \(c\neq t_k\) and \(c\neq x_k\) for all \(k\) then \(S(f;\dprt)=S(g;\dprt)\). If \(c=t_k\notin\{x_0,x_1,\ldots,x_n\}\) for some \(k\) then
\[
S(g;\dprt)-S(f;\dprt) = (f(c)-g(c))(x_k-x_{k-1}).
\]
If \(c=t_k=t_{k-1}\) for some \(k\) then necessarily \(c=x_{k-1}\) and then
\[
S(g;\dprt)-S(f;\dprt) = (f(c)-g(c))(x_k-x_{k-1}) + (f(c)-g(c))(x_{k-1}-x_{k-2}).
\]
Hence, in any case, by the triangle inequality
\begin{align*}
|S(g;\dprt)-S(f;\dprt)| &\leq 2 (|f(c)|+|g(c)|) \|\dprt\|\\
& = M \|\dprt\|.
\end{align*}
where \(M = 2 (|f(c)|+|g(c)|)\). Let \(\eps \gt 0\) be arbitrary. Then there exists \(\delta_1 \gt 0\) such that \(|S(f;\dprt)-L| \lt \eps/2\) for all partitions \(\dprt\) such that \(\|\dprt\| \lt \delta_1\). Let \(\delta=\min\{\delta_1,\eps/(2M)\}\). Then if \(\|\dprt\| \lt \delta\) then
\begin{align*}
\|S(g;f) - L\| &\leq |S(g;\dprt)-S(f;\dprt)| + |S(f;\dprt)-L|\\[2ex]
& \lt M\|\dprt| + \eps/2\\[2ex]
& \lt M\eps/(2M) + \eps/2\\[2ex]
&= \eps.
\end{align*}
This proves that \(g\in \mathcal{R}[a,b]\) and \(\int_a^b g = L = \int_a^b f\). Now suppose by induction that if \(g(x)=f(x)\) for all \(x\in [a,b]\) except at a \(j\geq 1\) number of points in \([a,b]\) then \(g\in \mathcal{R}[a,b]\) and \(\int_a^b g = \int_a^b f\). Now suppose that \(h:[a,b]\rightarrow\real\) is such that \(h(x)=f(x)\) for all \(x\in [a,b]\) except at the points \(c_1,c_2,\ldots,c_{j},c_{j+1}\). Define the function \(g\) by \(g(x)=h(x)\) for all \(x\in [a,b]\) except at \(x=c_{j+1}\) and define \(g(c_{j+1})=f(c_{j+1})\). Then \(g\) and \(f\) differ at the points \(c_1,\ldots,c_j\). Then by the induction hypothesis, \(g\in\mathcal{R}[a,b]\) and \(\int_a^b g = \int_a^b f\). Now \(g\) and \(h\) differ at the point \(c_{j+1}\) and therefore \(h\in \mathcal{R}[a,b]\) and \(\int_a^b h = \int_a^b g = \int_a^b f\). This ends the proof.

We now state some properties of the Riemann integral.
Suppose that \(f,g\in\mathcal{R}[a,b]\). The following hold.

- If \(k\in\real\) then \((kf)\in\mathcal{R}[a,b]\) and \(\int_a^b kf = k\int_a^b f\).
- \((f+g)\in\mathcal{R}[a,b]\) and \(\int_a^b (f+g) = \int_a^b f + \int_a^b g\).
- If \(f(x)\leq g(x)\) for all \(x\in[a,b]\) then \(\int_a^b f\leq \int_a^b g\).

If \(k=0\) then \((kf)(x)=0\) for all \(x\) and then clearly \(\int_a^b kf = 0\), so assume that \(k\neq 0\). Let \(\eps \gt 0\) be given. Then there exists \(\delta \gt 0\) such that if \(\|\dprt\| \lt \delta\) then \(|S(f;\dprt)-\int_a^b f\| \lt \eps/|k|\). Now for any partition \(\dprt\), it holds that \(S(kf;\dprt) = k S(f;\dprt)\). Therefore, if \(\|\dprt\| \lt \delta\) then
\begin{align*}
\left|S(kf;\dprt)-k\int_a^b f \right| &= |k| \left|S(f;\dprt)-\int_a^b f\right|\\
& \lt |k| (\eps/|k|)\\
& = \eps.
\end{align*}
To prove (b), it is easy to see that \(S(f+g;\dprt) = S(f;\dprt) + S(g;\dprt)\). Given \(\eps \gt 0\) there exists \(\delta \gt 0\) such that \(|S(f;\dprt)-\int_a^b f| \lt \eps/2\) and \(|S(g;\dprt)-\int_a^b g| \lt \eps/2\), whenever \(\|\dprt\| \lt \delta\). Therefore, if \(\|\dprt\| \lt \delta\) we have that
\begin{align*}
\left|S(f+g;\dprt) - \left(\int_a^b f + \int_a^b g\right) \right| &\leq \left|S(f;\dprt)-\int_a^b f\right|+\left|S(g;\dprt)-\int_a^b g\right|\\
& \lt \eps.
\end{align*}
To prove (c), let \(\eps \gt 0\) be arbitrary and let \(\delta \gt 0\) be such that if \(\|\dprt\| \lt \delta\) then
\begin{gather*}
\int_a^b f - \eps/2 \lt S(f;\dprt) \lt \int_a^b f + \eps/2\\[2ex]
\int_a^b g - \eps/2 \lt S(g;\dprt) \lt \int_a^b g + \eps/2
\end{gather*}
Now, by assumption, \(S(f;\dprt)\leq S(g;\dprt)\) and therefore
\[
\int_a^b f -\eps/2 \lt S(f;\dprt)\leq S(g;\dprt) \lt \int_a^b g + \eps/2.
\]
Therefore,
\[
\int_a^b f \lt \int_a^b g + \eps.
\]
Since \(\eps\) is arbitrary, we can choose \(\eps_n=1/n\) and then passing to the limit we deduce that \(\int_a^b f \leq \int_a^b g\).

Properties (i), (ii), and (iii) in Theorem 7.1.8 are known as homogeneity, additivity, and monotonicity, respectively.
We now give a necessary condition for Riemann integrability.
If \(f\in\mathcal{R}[a,b]\) then \(f\) is bounded on \([a,b]\).

Let \(f\in\mathcal{R}[a,b]\) and put \(L=\int_a^b f\). There exists \(\delta \gt 0\) such that if \(\|\dprt\| \lt \delta\) then \(|S(f;\dprt)-L| \lt 1\) and therefore \(|S(f;\dprt)| \lt |L|+1\). Suppose by contradiction that \(f\) is unbounded on \([a,b]\). Let \(\prt\) be a partition of \([a,b]\), with sets \(I_1,\ldots,I_n\), and with \(\|\prt\| \lt \delta\). Then \(f\) is unbounded on some \(I_j\), i.e., for any \(M \gt 0\) there exists \(x\in I_j=[x_{j-1},x_j]\) such that \(f(x) \gt M\). Choose samples in \(\prt\) by asking that \(t_k=x_k\) for \(k\neq j\) and \(t_j\) is such that
\[
|f(t_j)(x_j-x_{j-1})| \gt |L|+1 + \left|\sum_{k\neq j} f(t_k)(x_k-x_{k-1})\right|.
\]
Therefore, (using \(|a| = |a+b-b|\leq |a+b| + |b|\) implies that \(|a+b|\geq |a|-|b|\))
\begin{align*}
|S(f;\dprt)| &= \left|f(t_j)(x_j-x_{j-1}) + \sum_{k\neq j} f(t_k) (x_k-x_{k-1}) \right|\\[2ex]
&\geq \left|f(t_j)(x_j-x_{j-1}) \right| - \left|\sum_{k\neq j} f(t_k) (x_k-x_{k-1}) \right| \\[2ex]
& \gt |L|+1.
\end{align*}
This is a contradiction and thus \(f\) is bounded on \([a,b]\).

Consider Thomae's function \(h:[0,1]\rightarrow\real\) defined as \(h(x)=0\) if \(x\) is irrational and \(h(m/n)=1/n\) for every rational \(m/n\in [0,1]\), where \(\gcd(m,n)=1\). In Example 5.1.7, we proved that \(h\) is continuous at every irrational but discontinuous at every rational. Prove that \(h\) is Riemann integrable.

Let \(\eps \gt 0\) be arbitrary and let \(E=\{x\in[0,1]\;:\; h(x)\geq \eps/2\}\). By definition of \(h\), the set \(E\) is finite, say consisting of \(n\) elements. Let \(\delta=\eps/(4n)\) and let \(\dprt\) be a sampled partition of \([0,1]\) with \(\|\dprt\| \lt \delta\). We can separate the partition \(\dprt\) into two sampled partitions \(\dot{\mathcal{P}}_1\) and \(\dot{\mathcal{P}}_2\) where \(\dot{\mathcal{P}}_1\) has samples in the the set \(E\) and \(\dot{\mathcal{P}}_2\) has no samples in \(E\). Then the number of intervals in \(\dot{\mathcal{P}}_1\) can be at most \(2n\), which occurs when all the elements of \(E\) are samples and they are at the endpoints of the subintervals of \(\dot{\mathcal{P}}_1\). Therefore, the total length of the intervals in \(\dot{\mathcal{P}}_1\) can be at most \(2n\delta=\eps/2\). Now \(0 \lt h(t_k)\leq 1\) for every sample \(t_k\) in \(\dot{\mathcal{P}}_1\) and therefore \(S(f;\dot{\mathcal{P}}_1)\leq 2n\delta = \eps/2\). For samples \(t_k\) in \(\dot{\mathcal{P}}_2\) we have that \(h(t_k) \lt \eps/2\). Therefore, since the sum of the lengths of the subintervals of \(\dot{\mathcal{P}}_2\) is \(\leq 1\), it follows that \(S(f;\dot{\mathcal{P}}_2)\leq \eps/2\). Hence \(0\leq S(f;\dot{\mathcal{P}})=S(f;\dot{\mathcal{P}}_1)+S(f;\dot{\mathcal{P}}_2) \lt \eps\). Thus \(\int_a^b h = 0\).

#### Exercises

Suppose that \(f, g \in \mathcal{R}[a,b]\) and let \(\alpha,\beta\in\real\). Prove by definition that \((\alpha f + \beta g) \in \mathcal{R}[a,b]\).

If \(f\) is Riemann integrable on \([a,b]\) and \(|f(x)|\leq M\) for all \(x\in[a,b]\), prove that \(|\int_a^bf|\leq M(b-a)\).

**Hint**: The inequality \(|f(x)|\leq M\) is equivalent to \(-M \leq f(x) \leq M\). Then use the fact that constants functions are Riemann integrable whose integrals are easily computed. Finally, apply a theorem from this section.
If \(f\) is Riemann integrable on \([a,b]\) and \((\dot{\mathcal{P}}_n)\) is a sequence of tagged partitions of \([a,b]\) such that \(\|\dot{\mathcal{P}}_n\|\rightarrow 0\) prove that
\[
\int_a^b f = \lim_{n\rightarrow\infty} S(f;\dot{\mathcal{P}}_n)
\]

**Hint**: For each \(n\in\mathbb{N}\) we have the real number \(s_n = S(f;\dot{\mathcal{P}}_n)\), and we therefore have a sequence \((s_n)\). Let \(L=\int_a^b f\). We therefore want to prove that \(\displaystyle\lim_{n\rightarrow\infty} s_n = L\).
Give an example of a function \(f:[0,1]\rightarrow\real\) that is Riemann integrable on \([c,1]\) for every \(c\in (0,1)\) but which is not Riemann integrable on \([0,1]\).

**Hint**: What is a necessary condition for Riemann integrability?## Riemann Integrable Functions

To ease our notation, if \(I\) is a bounded interval with end-points \(a \lt b\) we denote by \(\mu(I)\) the length of \(I\), that is \(\mu(I)=b-a\). Hence, if \(I=[a,b]\), \(I=[a,b)\), \(I=(a,b]\), or \(I=(a,b)\) then \(\mu(I)=b-a\). Thus far, to establish the Riemann integrability of \(f\), we computed a candidate integral \(L\) and showed that in fact \(L=\int_a^b f\). The following theorem is useful when a candidate integral \(L\) is unknown. The proof is omitted.
A function \(f:[a,b]\rightarrow\real\) is Riemann integrable if and only if for every \(\eps \gt 0\) there exists \(\delta \gt 0\) such that if \(\dprt\) and \(\dqrt\) are sampled partitions of \([a,b]\) with norm less than \(\delta\) then
\[
|S(f;\dprt)-S(f;\dqrt)| \lt \eps.
\]

Using the Cauchy Criterion, we show next that the Dirichlet function is not Riemann integrable.
Let \(f:[0,1]\rightarrow\real\) be defined as \(f(x)=1\) if \(x\) is rational and \(f(x)=0\) if \(x\) is irrational. Show that \(f\) is not Riemann integrable.

To show that \(f\) is not in \(\mathcal{R}[0,1]\), we must show that there exists \(\eps_0 \gt 0\) such that for all \(\delta \gt 0\) there exists sampled partitions \(\dprt\) and \(\dqrt\) with norm less than \(\delta\) but \(|S(f;\dprt)-S(f;\dqrt)|\geq \eps_0\). To that end, let \(\eps_0=1/2\), and let \(\delta \gt 0\) be arbitrary. Let \(n\) be sufficiently large so that \(1/n \lt \delta\). Let \(\dprt\) be a sampled partition of \([0,1]\) with intervals all of equal length \(1/n \lt \delta\) and let the samples of \(\dprt\) be rational numbers. Similarly, let \(\dqrt\) be a partition of \([0,1]\) with intervals all of equal length \(1/n\) and with samples irrational numbers. Then \(S(f;\dprt) = 1\) and \(S(f;\dqrt)=0\), and therefore \(|S(f;\dqrt)-S(f;\dqrt)| \geq \eps_0\).

We now state a sort of squeeze theorem for integration.
Let \(f\) be a function on \([a,b]\). Then \(f\in\mathcal{R}[a,b]\) if and only if for every \(\eps \gt 0\) there exist functions \(\alpha\) and \(\beta\) in \(\mathcal{R}[a,b]\) with \(\alpha(x)\leq f(x)\leq \beta(x)\) for all \(x\in[a,b]\) and \(\int_a^b (\beta-\alpha) \lt \eps\).

If \(f\in\mathcal{R}[a,b]\) then let \(\alpha(x)=\beta(x)=f(x)\). Then clearly \(\int_a^b(\beta-\alpha)=0 \lt \eps\) for all \(\eps \gt 0\). Now suppose the converse and let \(\eps \gt 0\) be arbitrary. Let \(\alpha\) and \(\beta\) satisfy the conditions of the theorem, with \(\int_a^b(\beta-\alpha) \lt \frac{\eps}{3}\). Now, there exists \(\delta \gt 0\) such that if \(\|\dprt\| \lt \delta\) then
\[
\int_a^b\alpha - \frac{\eps}{3} \lt S(\alpha;\dprt) \lt \int_a^b\alpha + \frac{\eps}{3}
\]
and
\[
\int_a^b\beta - \frac{\eps}{3} \lt S(\beta;\dprt) \lt \int_a^b\beta + \frac{\eps}{3}.
\]
For any sampled partition \(\dprt\) it holds that \(S(\alpha;\dprt)\leq S(f;\dprt)\leq S(\beta;\dprt)\), and therefore
\begin{equation}
\int_a^b\alpha -\frac{\eps}{3} \lt S(f;\dprt) \lt \int_a^b\beta+\frac{\eps}{3}.
\end{equation}
If \(\dqrt\) is another sampled partition with \(\|\dqrt\| \lt \delta\) then also
\begin{equation}\label{eqn:s2}
\int_a^b\alpha - \frac{\eps}{3} \lt S(f;\dqrt) \lt \int_a^b\beta + \frac{\eps}{3}.
\end{equation}
Subtracting the two inequalities \eqref{eqn:s1}-\eqref{eqn:s2}, we deduce that
\[
-\int_a^b(\beta-\alpha)-2\frac{\eps}{3} \lt S(f;\dprt) - S(f;\dqrt) \lt \int_a^b(\beta-\alpha) + 2\frac{\eps}{3}.
\]
Therefore, since \(\int_a^b(\beta-\alpha) \lt \frac{\eps}{3}\) it follows that
\[
-\eps \lt S(f;\dprt) - S(f;\dqrt) \lt \eps.
\]
By the Cauchy criterion, this proves that \(f\in\mathcal{R}[a,b]\).

Step-functions, defined below, play an important role in integration theory.
A function \(s:[a,b]\rightarrow\real\) is called a

In the definition of a step-function, the intervals \(I_k\) may be of any form, i.e., half-closed, open, or closed.
**step-function**on \([a,b]\) if there is a finite number of disjoint intervals \(I_1,I_2,\ldots,I_n\) contained in \([a,b]\) such that \([a,b] = \bigcup_{k=1}^n I_k\) and such that \(s\) is constant on each interval.
Let \(J\) be a subinterval of \([a,b]\) and define \(\varphi_J\) on \([a,b]\) as \(\varphi_J(x)=1\) if \(x\in J\) and \(\varphi_J(x)=0\) otherwise. Then \(\varphi_J\in\mathcal{R}[a,b]\) and \(\int_a^b\varphi_J = \mu(J)\).

If \(\varphi:[a,b]\rightarrow\real\) is a step function then \(\varphi\in\mathcal{R}[a,b]\).

Let \(I_1,\ldots,I_n\) be the intervals where \(\varphi\) is constant, and let \(c_1,\ldots,c_n\) be the constant values taken by \(\varphi\) on the intervals \(I_1,\ldots,I_n\), respectively. Then it is not hard to see that \(\varphi = \sum_{k=1}^n c_k \varphi_{I_k}\). Then \(\varphi\) is the sum of Riemann integrable functions and therefore is also Riemann integrable. Moreover, \(\int_a^b\varphi = \sum_{k=1}^n c_k \mu(I_k)\).

We will now show that any continuous function on \([a,b]\) is Riemann integrable. To do that we will need the following.
Let \(f:[a,b]\rightarrow\real\) be a continuous function. Then for every \(\eps \gt 0\) there exists a step-function \(s:[a,b]\rightarrow\real\) such that \(|f(x)-s(x)| \lt \eps\) for all \(x\in [a,b]\).

Let \(\eps \gt 0\) be arbitrary. Since \(f\) is uniformly continuous on \([a,b]\) there exists \(\delta \gt 0\) such that if \(|x-u| \lt \delta\) then \(|f(x)-f(u)| \lt \eps\). Let \(n\in\N\) be sufficiently large so that \((b-a)/n \lt \delta\). Partition \([a,b]\) into \(n\) subintervals of equal length \((b-a)/n\), and denote them by \(I_1,I_2,\ldots,I_n\), where \(I_1=[x_0,x_1]\) and \(I_k=(x_{k-1},x_k]\) for \(1 \lt k\leq n\). Then for \(x,u \in I_k\) it holds that \(|f(x)-f(u)| \lt \eps\). For \(x\in I_k\) define \(s(x)=f(x_k)\). Therefore, for any \(x\in I_k\) it holds that \(|f(x)-s(x)| = |f(x)-f(x_k)| \lt \eps\). Since \(\bigcup_{k=1}^n I_k = [a,b]\), it holds that \(|f(x)-s(x)| \lt \eps\) for all \(x\in [a,b]\).

We now prove that continuous functions are integrable.
A continuous function on \([a,b]\) is Riemann integrable on \([a,b]\).

Suppose that \(f:[a,b]\rightarrow\real\) is continuous. Let \(\eps \gt 0\) be arbitrary and let \(\tilde\eps = (\eps/4)/(b-a)\). Then there exists a step-function \(s:[a,b]\rightarrow\real\) such that \(|f(x)-s(x)| \lt \tilde\eps\) for all \(x\in [a,b]\). In other words, for all \(x\in [a,b]\) it holds that
\[
s(x)-\tilde\eps \lt f(x) \lt s(x) + \tilde\eps.
\]
The functions \(\alpha(x):=s(x)-\tilde\eps\) and \(\beta(x):=s(x)+\tilde\eps\) are Riemann integrable integrable on \([a,b]\), and \(\int_a^b (\beta-\alpha) = 2\tilde\eps (b-a) = \eps/2 \lt \eps\). Hence, by the Cauchy criterion, \(f\) is Riemann integrable.

Recall that a function is called monotone if it is decreasing or increasing.
A monotone function on \([a,b]\) is Riemann integrable on \([a,b]\).

Assume that \(f:[a,b]\rightarrow\real\) is increasing and that \(M=f(b)-f(a) \gt 0\) (if \(M=0\) then \(f\) is the zero function which is clearly integrable). Let \(\eps \gt 0\) be arbitrary. Let \(n\in\N\) be such that \(\frac{M(b-a)}{n} \lt \eps\). Partition \([a,b]\) into subintervals of equal length \(\Delta x=\frac{(b-a)}{n}\), and as usual let \(a=x_0 \lt x_1 \lt \cdots \lt x_{n-1} \lt x_n=b\) denote the resulting points of the partition. On each subinterval \([x_{k-1},x_k]\), it holds that \(f(x_{k-1})\leq f(x) \leq f(x_k)\) for all \(x\in [x_{k-1},x_k]\) since \(f\) is increasing. Let \(\alpha:[a,b]\rightarrow\real\) be the step-function whose constant value on the interval \([x_{k-1},x_k)\) is \(f(x_{k-1})\) and similarly let \(\beta:[a,b]\rightarrow\real\) be the step-function whose constant value on the interval \([x_{k-1},x_k)\) is \(f(x_k)\), for all \(k=1,\ldots,n\). Then \(\alpha(x)\leq f(x)\leq \beta(x)\) for all \(x\in[a,b]\). Both \(\alpha\) and \(\beta\) are Riemann integrable and
\begin{align*}
\int_a^b (\beta-\alpha) &= \sum_{k=1}^n [f(x_k) - f(x_{k-1})] \Delta x\\
& = (f(x_n)-f(x_{n-1}) \Delta x\\
& = M \frac{(b-a)}{n}\\
& \lt \eps.
\end{align*}
Hence by the Squeeze theorem for integrals (Theorem 7.2.3), \(f\in \mathcal{R}[a,b]\).

Our las theorem is the additivity property of the integral, the proof is omitted.
Let \(f:[a,b]\rightarrow\real\) be a function and let \(c\in (a,b)\). Then \(f\in\mathcal{R}[a,b]\) if and only if its restrictions to \([a,c]\) and \([c,b]\) are both Riemann integrable. In this case,
\[
\int_a^b f = \int_a^c f + \int_c^b f
\]

#### Exercises

Suppose that \(f:[a,b]\rightarrow\real\) is continuous and assume that \(f(x) \gt 0\) for all \(x\in [a,b]\). Prove that \(\int_a^b f \gt 0\).

**Hint**: A continuous function on a closed and bounded interval achieves its minimum value.
Suppose that \(f\) is continuous on \([a,b]\) and that \(f(x)\geq 0\) for all \(x\in [a,b]\).

- Prove that if \(\int_a^b f =0\) then necessarily \(f(x)=0\) for all \(x\in [a,b]\).
- Show by example that if we drop the assumption that \(f\) is continuous on \([a,b]\) then it may not longer hold that \(f(x)=0\) for all \(x\in [a,b]\).

Show that if \(f:[a,b]\rightarrow\real\) is Riemann integrable then \(|f|:[a,b]\rightarrow\real\) is also Riemann integrable.

## The Fundamental Theorem of Calculus

Let \(f:[a,b]\rightarrow\real\) be a function. Suppose that there exists a finite set \(E\subset [a,b]\) and a function \(F:[a,b]\rightarrow\real\) such that \(F\) is continuous on \([a,b]\) and \(F'(x)=f(x)\) for all \(x\in [a,b]\backslash\hspace{-0.3em} E\). If \(f\) is Riemann integrable then \(\int_a^b f = F(b)-F(a)\).

Assume for simplicity that \(E:=\{a,b\}\). Let \(\eps \gt 0\) be arbitrary. Then there exists \(\delta \gt 0\) such that if \(\|\dprt\| \lt \eps\) then \(|S(f;\dprt)-\int_a^b f| \lt \eps\). For any \(\dprt\), with intervals \(I_k=[x_{k-1},x_k]\) for \(k=1,2,\ldots,n\), there exists, by the Mean Value Theorem applied to \(F\) on \(I_k\), a point \(u_k\in (x_{k-1},x_k)\) such that \(F(x_k) - F(x_{k-1}) = F'(u_k) (x_k-x_{k-1})\). Therefore,
\begin{align*}
F(b) - F(a) &= \sum_{k=1}^n F(x_k) - F(x_{k-1})\\
& = \sum_{k=1}^n f(u_k) (x_k-x_{k-1})\\
& = S(f;\dprt_u)
\end{align*}
where \(\dprt_u\) has the same intervals as \(\dprt\) but with samples \(u_k\). Therefore, if \(\|\dprt\| \lt \delta\) then
\begin{align*}
\left| F(b) - F(a) - \int_a^bf \right| &= \left| S(f;\dprt_u) - \int_a^b f\right|\\
& \lt \eps.
\end{align*}
Hence, for any \(\eps\) we have that \(\left| F(b) - F(a) - \int_a^bf \right| \lt \eps\) and this shows that \(\int_a^b f = F(b) - F(a)\).

Let \(f\in\mathcal{R}[a,b]\). The

**indefinite integral**of \(f\) with basepoint \(a\) is the function \(F:[a,b]\rightarrow\real\) defined by \[ F(x) := \int_a^x f \] for \(x\in [a,b]\).
Let \(f\in\mathcal{R}[a,b]\). The indefinite integral \(F:[a,b]\rightarrow\real\) of \(f:[a,b]\rightarrow\real\) is a Lipschitz function on \([a,b]\), and thus continuous on \([a,b]\).

For any \(w,z\in [a,b]\) such that \(w\leq z\) it holds that
\begin{align*}
F(z) &= \int_a^z f\\
& = \int_a^w f + \int_w^z f \\
&= F(w) + \int_w^z f
\end{align*}
and therefore \(F(z)-F(w) = \int_w^z f\). Since \(f\) is Riemann integrable on \([a,b]\) it is bounded and therefore \(|f(x)|\leq K\) for all \(x\in [a,b]\). In particular, \(-K \leq f(x) \leq K\) for all \(x\in [w,z]\) and thus \(-K(z-w) \leq \int_w^z f \leq K (z-w)\), and thus
\begin{align*}
|F(z) -F(w) | &= \left|\int_w^z f\right|\\
& \leq K |z-w|
\end{align*}

Under the additional hypothesis that \(f\in\mathcal{R}[a,b]\) is continuous, the indefinite integral of \(f\) is differentiable.
Let \(f\in\mathcal{R}[a,b]\) and let \(f\) be continuous at a point \(c\in [a,b]\). Then the indefinite integral \(F\) of \(f\) is differentiable at \(c\) and \(F'(c) = f(c)\).

## Riemann-Lebesgue Theorem

In this section we present a complete characterization of Riemann integrability for a bounded function. Roughly speaking, a bounded function is Riemann integrable if the set of points were it is discontinuous is not too large. We first begin with a definition ofnot too large.

A set \(E\subset\real\) is said to be of

**measure zero**if for every \(\eps \gt 0\) there exists a countable collection of open intervals \(I_k\) such that \[ E\subset\bigcup_{k=1}^\infty I_k \text{ and } \sum_{k=1}^\infty \mu(I_k) \lt \eps. \]
Show that a subset of a set of measure zero also has measure zero. Show that the union of two sets of measure zero is a set of measure zero.

Let \(S\subset\real\) be a countable set. Show that \(S\) has measure zero.

Let \(S=\{s_1, s_2, s_3, \ldots\}\). Consider the interval
\[
I_k = \left(s_k - \frac{\eps}{2^{k+1}}, s_k + \frac{\eps}{2^{k+1}}\right).
\]
Clearly, \(s_k \in I_k\) and thus \(S\subset\bigcup I_k\). Moreover,
\[
\sum_{k=1}^\infty \mu(I_k) = \sum_{k=1}^\infty \frac{\eps}{2^k} = \eps.
\]
As a corollary, \(\rat\) has measure zero.

However, there exists uncountable sets of measure zero.
The Cantor set is defined as follows. Start with \(I_0 = [0,1]\) and remove the middle third \(J_1=(\tfrac{1}{3},\tfrac{2}{3})\) yielding the set \(I_1 = I_0 \backslash\hspace{-0.3em} J_1 = [0,\tfrac{1}{3}] \cup [\tfrac{2}{3},1]\). Notice that \(\mu(J_1)=\frac{1}{3}\). Now remove from each subinterval of \(I_1\) the middle third resulting in the set
\[
I_2 = I_1 \backslash\hspace{-0.3em} \left( (\tfrac{1}{9},\tfrac{2}{9})\cup (\tfrac{7}{9},\tfrac{8}{9}) \right) = [0,\tfrac{1}{9}]\cup [\tfrac{2}{9},\tfrac{3}{9}] \cup [\tfrac{6}{9},\tfrac{7}{9}] \cup [\tfrac{8}{9}, 1]
\]
The two middle thirds \(J_2=(\tfrac{1}{9},\tfrac{2}{9})\cup (\tfrac{7}{9},\tfrac{8}{9})\) removed have total length \(\mu(J_2) = 2 \frac{1}{9}\). By induction, having constructed \(I_{n}\) which consists of the union of \(2^n\) closed subintervals of \([0,1]\), we remove from each subinterval of \(I_n\) the middle third resulting in the set \(I_{n+1} = I_n \backslash\hspace{-0.3em} J_{n+1}\), where \(J_{n+1}\) is the union of the \(2^n\) middle third open intervals and \(I_{n+1}\) now consists of \(2^{n+1}\) disjoint closed-subintervals. By induction, the total length of \(J_{n+1}\) is \(\mu(J_{n+1}) = \frac{2^n}{3^{n+1}}\). The Cantor set is defined as
\[
C = \bigcap_{n=1}^\infty I_n.
\]

We now state the Riemann-Lebesgue theorem.
Let \(f:[a,b]\rightarrow\real\) be a bounded function. Then \(f\) is Riemann integrable if and only if the points of discontinuity of \(f\) forms a set of measure zero.