# Riemann integration of a function

I would like to ask if the function $$f(x)=\begin{cases}0\text{ if } x\in \mathbb{\mathbb{[0,1]}\cap Q}\\ x^2\text{ if } x\in \mathbb{[0,1]\setminus Q} \end{cases}$$ is Riemann Integrable in $$[0,1]$$?

My thought:

Let $$S(f,P)$$ and $$s(f,P)$$ be the upper and low sums of $$f$$ with respect to partition $$P$$ of interval $$[0,1]$$. Let $$M_i=\sup\{f(x)| x \in I_i\}$$ and $$m_i=\inf\{f(x)| x \in I_i\}$$, where $$I_i$$ is the $$i$$th interval of the partition $$P$$. Note that $$M_i=1$$ for all $$i$$, because every interval $$I_i$$ of the partition $$P$$ contains rational numbers. On the other hand, $$m_i=0$$ for all $$i$$ because every interval $$I_i$$ of the partition $$P$$ contains irrational numbers. By definition, $$S(f,P)=\sum_{i=1}^nM_i\mu(I_i)=\sum_{i=1}^n1\mu(I_i)=\sum_{i=1}^n\mu(I_i)=1-0=1$$ $$s(f,P)=\sum_{i=1}^nm_i\mu(I_i)=\sum_{i=1}^n0\mu(I_i)=0$$ Thus, $$f$$ is not Riemann integrable because the upper and lower integrals are not equal. (The upper integral is the limit of the upper sums and the lower integral is the limit of the lower sums).

• You're very close, but your calculation of $M_i$ is wrong. For instance if $I_1=[0,1/\sqrt{2}]$ then $M_1=1/2$, rather than (as you claim) $M_1=1$. – Jamie Radcliffe Aug 25 '19 at 14:04

## 1 Answer

No, it is not Riemann-integrable, but your computations are not correct. You are right when you claim that $$s(f,P)=0$$, for each partition $$P$$ of $$[0,1]$$. However, it is not true that $$S(f,P)=1$$ for each partition $$P$$ of $$[0,1]$$. Actually, it is not true that “$$M_i=1$$ for all $$i$$, because every interval $$I_i$$ of the partition $$P$$ of $$[0,1]$$ contains rational numbers”. However, it is true that, for each partition $$P$$ of $$[0,1]$$, $$S(f,P)\geqslant\frac13$$, and this is enough to prove what you want.

• I get confused, can you give a complete solution by the beginning please? It would be very helpful for me. Thank you – George Aug 25 '19 at 14:15
• What is confusing you? You wrote that each $M_i$ is equal to $1$, which is just wrong. If $P=\left\{0,\frac12,1\right\}$, then you have two intervals: $I_1=\left[0,\frac12\right]$ and $I_2=\left[\frac12,1\right]$. In this case, $M_2$ is indeed $1$, but $M_1=\frac14$. – José Carlos Santos Aug 25 '19 at 14:20
• It would be helpful for me to have a complete solution, I am studying Riemann integration and I try to understand it. It would help me a lot – George Aug 25 '19 at 14:23
• There is no way I will write anything else if you do not answer my question. – José Carlos Santos Aug 25 '19 at 14:25
• I can't see a question from you. I just ask for a help, if you have time just let me understand – George Aug 25 '19 at 14:28