Riemann integral exercises with detailed answers are offered on this page. These kinds of integrals of bounded function in bounded intervals, almost everywhere continuous. Thus, all continuous or monotone functions are Riemann integrable.

## Lower integral, upper integral, and proper integral

In this section, we give a concise definition of Riemann integrals. To this end, we assume that a real function is defined and bounded on the interval $[a,b]$, with $a,b\in\mathbb{R}$ are such that $a<b$.

For a subdivision $\sigma:=\{x_0,\cdots.x_n\}$ of the interval $[a,b]$, i.e. $a=x_0<x_1<\cdots<x_n=b$, we define the* lower sum* of $f$ on $[a,b]$, by $$ L_n(f,\sigma)=\sum_{i=1}^n m_i(f,\sigma)(x_i-x_{i-1}),$$ where $m_i(f,\sigma)$ is the infinimum of $f$ on the interval $[x_{i-1},x_i]$.

By definition, the * lower integral* of f over the interval $[a,b]$ is $$ \underline{\int^b_a}f(x)ds=\sup_{\sigma} L_n(f,\sigma)=\lim_{n\to\infty}U_n(f,\sigma).$$ Similarly, we define the

*of $f$ over the interval $[a,b]$ by $$ U_n(f,\sigma)=\sum_{i=1}^n M_i(f,\sigma)(x_i-x_{i-1}),$$ where $M_i(f,\sigma)$ is the supremum of $f$ on the interval $[x_{i-1},x_i]$.*

**upper sum**The * upper integral* of f over the interval $[a,b]$ is $$ \overline{\int^b_a}f(x)ds=\inf_{\sigma} U_n(f,\sigma)=\lim_{n\to\infty}U_n(f,\sigma).$$

**Definition:**A bounded function $f:[a,b]\to\mathbb{R}$ is said to be Riemann integrable on $[a,b]$ if its lower and upper integrals coincide. In this case, the integral of $f$ over $[a,b]$ is given by $$\int^b_a f(x)dx=\overline{\int^b_a}f(x)ds=\underline{\int^b_a}f(x)ds.$$ There exists another equivalent condition for Riemann integrals. Let’s give a summary of it. We take $c_\in [x_{i-1},x_i]$ for $i=1,\cdots,n$ and de define the

*by $$S_n(f,\sigma):=\sum_{i=1}^n f(c_i)(x_{i}-x_{i-1}).$$ Observe that $L_n(f,\sigma)\le S_n(f,\sigma)\le U_n(f,\sigma)$. Thus if $f$ is Riemann integrable then $S_n(f,\sigma)$ has a limit as $n\to\infty,$ and in this case we have $$ \int^b_a f(x)dx=\lim_{n\to\infty} \sum_{i=1}^n f(c_i)(x_{i}-x_{i-1}).$$*

**Riemann sum**A particular cas: Let $f:[0,1]\to \mathbb{R}$ be Riemann integral and take the uniform subdivision $\sigma:=\{\frac{i}{n}: i=0,\cdots,n\}$, and $c_i=\frac{i}{n}$, Then $$ \int^1_0 f(x)dx=\lim_{n\to\infty}\frac{1}{n}\sum_{i=1}^n f\left(\frac{i}{n}\right).$$

## Riemann integral exercises

We start our selection of Riemann integral exercises by providing an example of a non-integrable bounded function in the sense of Riemann

**Exercise:** Prove that the following function $$g(x)=\cos^2(x)1_{\mathbb{Q}}(x),\quad x\in [0,\pi/2],$$ is not Riemann integrable.

**Exercise:** Let $f:[0,1]\to \mathbb{R}$ be a continuous function. For any $n\in\mathbb{N},$ we set \begin{align*} u_n=n\int^1_0 t^n f(t)dt. \end{align*}

- Let $\varepsilon>0$. Prove that there exists $a\in (0,1)$ such that $|f(t)|\le \frac{\varepsilon}{2}$ whenever $t\in [a,1]$.
- We denote $M=\sup{|f(t)|:t\in [0,1]}$, a such $M\in \mathbb{R}^+$ exists because $f$ is continuous on the compact $[0,1]$. Prove that \begin{align*} |u_n|\le M a^n+\frac{\varepsilon}{2},\qquad \forall n\in\mathbb{N}. \end{align*}
- Deduce that $\lim_{n\to+\infty}u_n=0$.
- Deduce that, in general, we have \begin{align*} \lim_{n\to+\infty}u_n=f(1). \end{align*}

**Solution:** The first 3 question: By definition of left continuity at point $1,$ for all $\varepsilon>0,$ there exists $0 < \delta < 1$ such that $t\in [1-\delta,1]$ we have $|f(t)-f(1)|=|f(t)| \le \frac{\varepsilon}{2}$. It suffices to put $a=1-\delta\in (0,1)$.

We can write \begin{align*} |u_n|&\le n \int^1_0 t^n |f(t)|dt\cr &\le n \int^a_0 t^n |f(t)|dt+n \int^1_a t^n |f(t)|dt\cr & \le n M \int^a_0 t^n dt+ n \frac{\varepsilon}{2} \int^1_a t^n dt\cr & \le n M \left[\frac{t^{n+1}}{n+1}\right]^a_0+ n \frac{\varepsilon}{2} \left[\frac{t^{n+1}}{n+1}\right]^1_a \cr &\le M \frac{n}{n+1} a^{n+1}+\frac{\varepsilon}{2} \frac{n}{n+1} (1-a^{n+1}). \end{align*} As $a\in (0,1),$ then $a^{n+1}\le a^n$ and $0 < 1-a^{n+1} < 1$. On the other hand, $\frac{n}{n+1}le 1$. This implies that \begin{align*} |u_n|\le M a^n+\frac{\varepsilon}{2},\qquad \forall n\in\mathbb{N}. \end{align*}

Since $a\in (0,1)$ then the geometric sequence $(a^n)_n$ satisfies $a^n\to 0$ as $n\to+\infty$. Then there exists $N\in \mathbb{N}$ such that for any $n\ge N,$ we have $0 < a^n < \frac{\varepsilon}{2M}$. Hence for $n\ge N,$ we have \begin{align*} |u_n|\le M \frac{\varepsilon}{2M}+\frac{\varepsilon}{2}=\varepsilon. \end{align*} Thus $u_n\to 0$ as $n\to +\infty$.

4) In this question we work with a general continuous function $f:[0,1]\to \mathbb{R}$. We set $g(t)=f(t)-f(1)$. The function $g$ is continuous on $[0,1]$ and satisfies $g(1)=0$. According to the first question we have \begin{align*} \lim_{n\to+\infty} n\int^1_0 t^n g(t)dt=0. \end{align*} In addition, observe that \begin{align*} u_n&=n\int^1_0 t^n g(t)dt+n f(1) \int^1_0 t^n dt \cr &= n\int^1_0 t^n g(t)dt+\frac{n}{n+1}f(1) \end{align*} Hence $u_n\to f(1)$ as $n\to +\infty$.

**Exercise:** Let $f:\mathbb{R}\to \mathbb{R}$ be a continuous function and let $\omega\in\mathbb{R}^\ast$. Define the following function \begin{align*} \varphi(x)=\frac{1}{\omega}\int^x_0 \sin\left(\omega (x-t)\right)f(t),dt,\qquad x\in\mathbb{R}. \end{align*}

- Prove that there exist two functions $\Phi,\Psi:\mathbb{R}\to \mathbb{R}$ such that for any $x\in\mathbb{R},$ \begin{align*} \varphi(x)=\frac{\sin(\omega x)}{\omega} \Phi(x)- \frac{\cos(\omega x)}{\omega}\Psi(x). \end{align*}
- Show that $\varphi$ is twice differentiable on $\mathbb{R}$ and that \begin{align*} \varphi”+\omega^2 \varphi=f. \end{align*}

**Solution:** 1) Let $x\in\mathbb{R}$ and $t\in\mathbb{R}$. We know from trigonometric formulas that \begin{align*} \sin(\omega x-\omega t)=\sin(\omega x)\cos(\omega t)-\cos(\omega x)\sin(\omega t). \end{align*} Then \begin{align*} \varphi(x)&= \frac{\sin(\omega x)}{\omega} \int^x_0 \cos(\omega t)f(t)dt-\frac{\cos(\omega x)}{\omega} \int^x_0 \sin(omega t)f(t)dt. \end{align*} Thus it suffices to select \begin{align*} \Phi(x)= \int^x_0 \cos(\omega t)f(t)dt\quad\text{and} \quad \Psi(x)=\int^x_0 \sin(\omega t)f(t)dt. \end{align*}

2) The functions $\Phi$ and $\Psi$ are primitives of continuous functions. Thus $\Phi$ and $\Psi$ are $C^1$ functions on $\mathbb{R}$ and that \begin{align*} \Phi'(x)=\cos(\omega x)f(x),\qquad \Psi(x)=\sin(\omega x)f(x) \end{align*} for any $x\in \mathbb{R}$. This proves that the function $varphi$ is differential on $\mathbb{R}$ as the product and sum of differentiable functions. Moreover, \begin{align*} \omega\varphi'(x)&= \omega \cos(\omega x) \Phi(x)+\sin(\omega x) \cos(\omega x)f(x)\cr & \hspace{2cm}+\omega\sin(\omega x)\Psi(x)-\cos(\omega x)\sin(\omega x)f(x)\cr &= \omega \cos(\omega x) \Phi(x)+\omega\sin(\omega x)\Psi(x). \end{align*} As $\omega\neq 0,$ then \begin{align*} \varphi'(x)=\cos(\omega x) \Phi(x)+\sin(\omega x)\Psi(x) \end{align*} This last formula show that $\varphi’$ is differentiable as product and sum of differentiable functions. Hence $\varphi$ is twice differentiable and \begin{align*} \varphi”(x)&=-\omega\sin(\omega x) \Phi(x)+\cos^2(\omega x)f(x)\cr & \hspace{2.5cm}+\omega\cos(\omega x)\Psi(x)+\sin^2(\omega x)f(x)\cr &= -\omega (\sin(\omega x) \Phi(x)-\cos(\omega x)\Psi(x))+f(x)\cr &= -\omega^2 \varphi(x)+f(x) \end{align*} for any $x\in\mathbb{R}$. This proves that \begin{align*} \varphi”+\omega^2 \varphi=f. \end{align*}