# Show that the piecewise function is not Riemann integrable.

Verify whether the function $$f$$ from $$[0,2]$$ to $$\mathbb{R}$$ defined by

$$f(x) =\begin{cases} x+x^2, & x\in[0,2]\cap\mathbb{Q} \\ x^2 + x^3, & x\in[0,2]\setminus\mathbb Q \end{cases}$$

is not Riemann integrable.

I'll explain the solution given in my textbook.

It is clear that for the interval $$[0,1]$$, $$x+x^2$$ is the supremum of the given function and $$x^2 + x^3$$ is the infimum. In the interval $$[1,2]$$, it's the opposite.

All is good till this point.

Now we are directly trying to find the upper integral.

It is given that the upper integral $$U(f)$$ in the interval $$[0,2]$$ is equal to $$\int_{0}^{1} x+x^2 \, dx + \int_{1}^{2} x^2+x^3 \, dx$$. I don't understand this step. How come we can side-step many complications and straight away reduce an upper integral into a definite integral?

Consider the interval $$I=[0,1]$$. It seems that $$U(f)$$ in the interval $$I$$ is equal to $$\int_{0}^{1} x+x^2 \, dx$$, but I'm not sure why. I understand that $$x+x^2$$ is the supremum of the function in that interval, but I'm not able to make a logical connection to that. If the function wasn't piecewise, say if $$f(x) = x+x^2$$ in $$[0,1]$$, we wouldn't have directly converted the upper integral into a definite integral. Instead, we would have defined a partition, then found $$M_r$$ and $$m_r$$ in the interval, and then calculated $$L(P,f)$$ and $$U(P,f)$$, and finally found the upper and lower integrals. All those steps were skipped in this case.

A proper explanation will be of great help!

• Are you allowed to use this theorem? *A bounded function $f:[a,b]\to\Bbb R$ is Riemann integrable iff the set of its discontinuity has measure $0$. * Mar 8 at 8:34
• Take another function $g(x)$ which equals $x+x^2$ in $[0,1]$ and $x^2+x^3$ in $[1,2]$. Then $g$ is continuous on $[0,2]$ and hence Riemann integrable. Prove that upper sums of $f, g$ coincide. Mar 8 at 8:42

The crux of the issue lies in the phrase "for the interval $$[0,1]$$, $$x+x^2$$ is the supremum of the given function". You said that you understand this, but taken literally, this statement is complete nonsense. How, then, should we interpret this statement?

I would argue that the only meaningful interpretation is the following:

For any sub-interval $$[a,b] \subseteq [0,1]$$ with $$a, $$\sup_{x \in [a,b]} f(x) = \sup_{x \in [a,b]} (x+x^2).$$

This is both correct and meaningful. It means that if we define $$f_1(x) = x+x^2$$, then $$U(P,f) = U(P,f_1)$$ for any partition $$P$$ of $$[0,1]$$ (you should prove this if you don't immediately see why it's true). This means that the upper integral $$U(f)$$ on $$[0,1]$$ is the same as $$U(f_1)$$ on $$[0,1]$$, and since $$f_1$$ is Riemann integrable on $$[0,1]$$, the upper integral of $$f_1$$ equals its integral $$\int_0^1(x+x^2)\,dx$$.

The rest of the problem is resolved in a similar fashion.

• I was writing a comment to question with similar idea and meanwhile you answer came. If you wish I will delete the comment. +1 btw Mar 8 at 8:43
• It seems a link is missing in the italicised text. Can you add that? Mar 8 at 9:27
• @Sasikuttan There is no link. I am simply saying you should check the details of that step if you feel you need to do so. It is a routine application of the definitions. I've rephrased the parenthetical comment, so hopefully it's more clear now. Mar 8 at 9:35
• @BrianMoehring I'm not able to grasp which definition explains that. Rather new to the subject, so I'm not able to make the right connections. Mar 8 at 9:36
• @Sasikuttan Write down the definitions of $U(P,f)$ and $U(P,f_1)$ for an arbitrary partition $P$ of $[0,1]$. Mar 8 at 9:38