# Is the following function Riemann integrable?

Define $f$ on $[0,1]$ by $f(x)=\begin{cases}x^2 ~~~~~~~~\text{if$x$is rational}\\ x^3~~~~~~~~\text{if$x$is irrational}\end{cases}$. Then

1. $f$ is not Riemann integrable on $[0,1]$.
2. $f$ is Riemann integrable and $\int_{0}^{1}f(x)dx=\frac{1}{4}$,
3. $f$ is Riemann integrable and $\int_{0}^{1}f(x)dx=\frac{1}{3}$,
4. $\frac{1}{4}=\underline{\int_{0}^{1}}f(x)dx<\overline{\int_{0}^{1}} f(x)dx=\frac{1}{3}$, where $\underline{\int_{0}^{1}}f(x)dx$ and $\overline{\int_{0}^{1}} f(x)dx$ are lower and upper Riemann integral of $f$.

I am facing difficulty in solving the above problem, basically because I haven't solve this kind of question. I tried to see whether it is continuous or monotone, which implies R-integrable. But didn't make much headway in that direction. How to solve this kind of problems? Please give some hints or solutions. Thank you.

• $f$ is Riemann integrable iff its discontinuity set has Lebesgue measure $0$. Nov 24 '16 at 2:21

Take any partition $P$ of $[0,1]$ where $P=\{0<\frac{1}{n}<\frac{2}{n}<\ldots<\frac{n-1}{n}<\frac{n}{n}=1\}$

Since $x^2>x^3$ in each subinterval and $\Bbb Q$ is dense in $\Bbb R$ so $M_i=\dfrac{1}{n^2};m_i=\dfrac{1}{n^3}$

Then $U(P,f)=\sum_{i=1}^n M_i\Delta_{i}=\dfrac{1}{n}\{ \dfrac{1}{n^2}+\dfrac{4}{n^2}+\ldots\dfrac{n^2}{n^2}\}=\dfrac{n(n+1)(2n+1)}{6n^3}$ where $M_i=\sup f(x)$ in each subinterval

Again $L(P,f)=\sum_{i=1}^n m_i\Delta_{i}=\dfrac{1}{n}\{0+ \dfrac{1}{n^3}+\dfrac{8}{n^3}+\ldots \dfrac{(n-1)^3}{n^3}\}=\dfrac{n^2(n-1)^2}{4n^4}$ $m_i=\inf f(x)$ in each subinterval

Then as $n\to \infty$ ;$U(P,f)-L(P,f)=\dfrac{1}{3}-\dfrac{1}{4}=\dfrac{1}{12}\text{which does not go to } 0$

Hence $f$ is not $\mathcal R-$ integrable.

Also $\inf\{U(P,f)\}=\frac{1}{6}\{(1-\frac{1}{n})(2+\frac{1}{n}\}=\frac{1}{3}$

Similarly $\sup\{L(P,f)\}=\dfrac{1}{4}$

• I realize that you have actually used is $M_i=(\frac{i}{n})^2,m_i=(\frac{i-1}{n})^3$. There's a mistake in your second line. Also, could you explain why we have these values for $M_i$ and $m_i$, although $\frac{i}{n}$ might be an irrational number. Feb 22 '20 at 5:19
• Okay, I figured this happens because of the fact that $\mathbb{Q}$ is dense in $\mathbb{R}$. (Correct me if I am wrong) Dense basically means closeness- so even if $\frac{i-1}{n}$ is rational we have a sequence of irrationals in $[\frac{i-1}{n},\frac{i}{n}]$ converging to $\frac{i-1}{n}$ which gives us $m_i=inf\{f(x):x\in[\frac{i-1}{n}\frac{i}{n}]\}$ converging to $(\frac{i-1}{n})^3$. Feb 22 '20 at 6:00

Here are some hints:

Let $p_k(x) = x^k$ and note that $p_3(x) \le f(x) \le p_2(x)$.

Note that if $P$ is a partition of $[0,1]$, then $L(p_3,P) = L(f,P)$ and similarly, $U(p_2,P)= U(f,P)$.

Hence $\sup_P L(f,P) = \sup_P L(p_3,P)$ and $\inf_P U(f,P) = \inf_P U(p_2,P)$.

Since the $p_k$ are Riemann integrable, we have $\sup_P L(p_3,P) = \int_0^1 p_3(x) dx$ and $\inf_P U(p_2,P) = \int_0^1 p_2(x) dx$.

Let $f:[0,1]\rightarrow R$, to define the Riemann integral of $f$ (if it exists), one may consider the functions

$f_n=\sum_{i=1}^nsup_{x\in [(i-1)/n,i/n]}f\chi_{[(i-1)/n,i/n]}$ and

$g_n=\sum_{i=1}^ninf_{x\in [(i-1)/n,i/n]}f\chi_{[(i-1)/n,i/n]}$. where $\chi_{[(i-1)/n,i/n]}$ is the characteristic function of $[(i-1)/n,i/n]$.

Then the function is Riemann integrable if and only if $lim_n\int_0^1f_n=\int_0^1g_n$.

For your example $Sup_{x\in [(i-1)/n,i/n]}= i^2/n^2$ and $inf_{x\in [(i-1)/n,i/n]}= (i-1)^3/n^3$. This implies that

$lim_n\int_0^1f_n=\int_0^1x^2=1/2$ and $lim_n\int_0^1g_n=\int_0^1x^3=1/3$. We conclude that this function is not Riemann integrable.