Show that $f$ is Riemann Integrable on $\left[0,\pi/2\right]$

integrationreal-analysisriemann sumriemann-integration

Let $f(x)=\cos^2(x)$ if $x\in \mathbb{Q}$ and $f(x)=0$ if not. Show that $f$ is Riemann Integrable on $\left[0,\pi/2\right]$.

The problem that I have, is that I don't really see why this function would be Riemann integrable. I will start the proof and explain in details what I did. So, if someone could tell me where my intuition is worng, I would appreciate it.

By definition, $f$ is integrable iff. $\exists$ a subdivision $\sigma$: $\overline{S}_{\sigma}(f)<\underline{S}_{\sigma}(f)+\epsilon \ \forall \epsilon>0$.

By density of irrational numbers, the lower Darboux sum is equal to $0$. So, we have to show that $$\overline{S}_{\sigma}(f)<\epsilon \iff \sum_{i=0}^{n}M_i(x_{i+1}-x_i)<\epsilon,$$ with $M_i=\sup\{f(x):x\in[x_{i},x_{i+1}]\}$. By density of rational numbers, we consider the following sum:

$$\sum_{i=0}^{n}\cos^2(x_i)(x_{i+1}-x_i)$$ as $\cos^2(x)$ is decreasing on $[0,\pi/2]$. But, $0\le\cos^2(x)\le 1$ on $[0,\pi/2]$. Therefore,
$$\sum_{i=0}^{n}\cos^2(x_i)(x_{i+1}-x_i)\le 1 \cdot \sum_{i=0}^{n}(x_{i+1}-x_i)=\frac{\pi}{2}-0>\epsilon$$ for every subdivision. Thus, $f$ is not intergable on $[0,\pi/2]$.

Best Answer

Using the density of irrationals and rationals and the monotonicity of $x \mapsto \cos^2x$ on $[0,\pi/2]$, we have for any subinterval $[x_{j},x_{j+1}]$ of a partition $P$,

$$\sup_{x \in [x_{j},x_{j+1}]} f(x) = \cos ^2 x_{j}, \quad \inf_{x \in [x_{j},x_{j+1}]} f(x) = 0$$

Immediately we see that the lower Darboux sum is $L(P,f) =0$ and the upper Darboux sum is

$$U(P,f) = \sum_{j=0}^{n-1} \cos ^2 x_{j}(x_{j+1}-x_j)$$

Using the facts that $U(P,f)$ is also an upper Darboux sum for the decreasing and Riemann integrable function $x \mapsto \cos^2 x$, we get

$$ U(P,f)\geqslant \int_0^{\pi/2}\cos^2 x\, dx = \frac{\pi}{4} >0$$

This proves that $f$ is not Riemann integrable since for any $0 < \epsilon < \frac{\pi}{4}$ there can be no partition such that $U(P,f) - L(P,f) < \epsilon$.