# Is the following cases function Riemann integrable?

I have the following question:

Let $$f$$ be a function defined in the following interval: [0,1], such that:$$f(x)=\begin{cases} 2 & 0\le x<\frac{1}{3} \\\\ 0 & \frac{1}{3}\le x<\frac{2}{3} \\\\ 1 & \frac{2}{3}\le x<1 \end{cases}$$ Is the given function Riemann integrable? if so calculate the integral via Riemann integral's definition.

My attempt:

My intuition says she is Riemann integrable, and the value of the integral is-1 since we can calculate the rectangles in the graph. However, I find it hard to prove that via Riemann integral's definition, because I cannot choose an equal partition $$P$$ for the upper and lower Darboux's sums to show $$\sup_P L(P,f) = \inf_P U(P,f)$$.

• Can you not just do the ones spaced by $\frac1n$? There is a lemma that says that the Riemann integral exists if and only if those upper and lower sums converge to the same number.
– user239203
Apr 28 at 10:26

If $$\varepsilon>0$$, consider the partition $$P_\varepsilon=\left\{0,\frac13-\frac\varepsilon4,\frac13,\frac23-\frac\varepsilon2,\frac23,1\right\}$$. Then$$U(P_\varepsilon,f)=1\quad\text{and}\quad L(P_\varepsilon,f)=1-\varepsilon.$$Therefore, $$f$$ is Riemann-integrable, and $$\int_0^1f=1$$.
• First, thank you so much! Second, you got that $1=U(P_{\varepsilon},f)\neq L(P_{\varepsilon},f)=1-\varepsilon$ and we need to have equality between them. Apr 28 at 10:32
• No, we don't have to have equality among them. Unless $f$ is constant, we never have $U(P,f)=L(P,f)$. But it follows from what I did that $\inf_PL(P,f)-\sup_PL(P,f)<\varepsilon$, for every $\varepsilon>0$, and that therefore $\inf_PL(P,f)=\sup_PL(P,f)$. Apr 28 at 10:43
• So you say that since she integrable then $\sup_P L(P,f) = \inf_P U(P,f)=1$? Apr 28 at 10:52
• Not at all. What I say is that since $\sup_PL(P,f)=\inf_PU(P,f)$, then $f$ is Riemann-integrable. Apr 28 at 11:26
• Since I wrote that $\varepsilon>0$, it should be clear that at no moment I wrote (or suggested) that $\varepsilon=0$. Since, for every $\varepsilon>0$, there is a partition $P_\varepsilon$ such that $L(P,f)=1-\varepsilon$ and that $U(P,f)=1$, then, for every $\varepsilon>0$, $\sup_L(P,f)\geqslant1-\varepsilon$ and $\inf_P U(P,f)\leqslant1$, from which you can deduce that$$\inf_P U(P,f)-\sup_L(P,f)\leqslant\varepsilon.$$Since this occurs for every $\varepsilon>0$, $\inf_P U(P,f)-\sup_L(P,f)=0$. In other words, $\inf_P U(P,f)=\sup_L(P,f)$. Apr 29 at 18:26