Riemann integration of a function with different condition

39 Views Asked by At

$f:[0,\pi/2]\rightarrow \mathbb{R}$ defined as

$f(x)= \begin{cases} \sin x,& \text{if } x\in [0,\pi/2]\cap \mathbb{Q}\\ \cos x, & \text{otherwise} \end{cases}$

What is the upper integral and lower integral of $f$ on $[0,\pi/2]$.

1

There are 1 best solutions below

0
On

We have $$\begin{cases} \sin(x) \le \cos(x) & \text{if $x \in \left[0,\frac{\pi}{4} \right]$, and} \\ \sin(x) > \cos(x) & \text{if $x \in \left(\frac{\pi}{4},\frac{\pi}{2}\right]$.}\\ \end{cases} $$ It then follows that $$ \overline{\int}_{0}^{\frac{\pi}{2}} f(x)\,\mathrm{d}x = \overline{\int}_{0}^{\frac{\pi}{4}} f(x)\, \mathrm{d}x + \overline{\int}_{\frac{\pi}{2}}^{\frac{\pi}{4}} f(x)\, \mathrm{d}x = \int_{0}^{\frac{\pi}{4}} \cos(x)\,\mathrm{d}x + \int_{\frac{\pi}{4}}^{\frac{\pi}{2}} \sin(x)\, \mathrm{d}x = \frac{2}{\sqrt{2}},$$ and $$ \underline{\int}_{0}^{\frac{\pi}{2}} f(x)\,\mathrm{d}x = \underline{\int}_{0}^{\frac{\pi}{4}} f(x)\, \mathrm{d}x + \underline{\int}_{\frac{\pi}{2}}^{\frac{\pi}{4}} f(x)\, \mathrm{d}x = \int_{0}^{\frac{\pi}{4}} \sin(x)\,\mathrm{d}x + \int_{\frac{\pi}{4}}^{\frac{\pi}{2}} \cos(x)\, \mathrm{d}x = 2 - \frac{2}{\sqrt{2}}.$$ In both cases, we are using the fact that $f(x) = \sin(x)$ and $f(x)=\cos(x)$ on dense subsets of the interval over which we are integrating, which implies that $f$ attains a maximum of one and a minimum of the other on any interval.