# Evaluate the integral of this piece-wise function only continuous at ${ \pi \over 2}$

$\displaystyle\int_0^\pi f(x) \, dx$, where $f(x) = \begin{Bmatrix} 1 & \text{if } x \in \Bbb Q \\ \sin x & \text{if } x \notin \Bbb Q \end{Bmatrix}$

I got the idea after looking at problem #7 in Chapter 4.1 from Gerald B. Folland's Advanced Calculus:

"Let $f$ be an integrable function on $[a,b]$. Suppose that $f(x) \ge 0$ for all $x$ and there is at least one point $x_o \in [a,b]$ at which $f$ is continuous and strictly positive. Show that $\int_a^b f(x) \, dx \gt 0$."

I believed I have proved the statement, my question is to the particular example that I thought of that fits the problem.

Is the example I thought of integrable? If so, what does it integrate to?

I am sure I am not the first to have thought of this integral so I am not claiming any originality here, only curiosity. The only thing I know is that the area represented by the integral $A$, $2 \le A \lt \pi$.

-
Well, your function has way "too many" discontinuity points (Riemann-Lebesgue Theorem) ... – DonAntonio Mar 22 '14 at 0:07
What definition of integral are you using? The Riemann integral doesn't exist. – vonbrand Mar 22 '14 at 0:13
Lesbesgue Integral. – StudentofEuler2718 Mar 22 '14 at 0:13
well, f(x)=sin(x) almost everywhere, yes? – ant Mar 22 '14 at 0:19

The measure of $\mathbb Q$ is $0$ because $\mathbb Q$ is countably infinite, so the integral is the same as if $f(x)$ had been equal to $\sin x$ at every point. In this case there is only one point at which your piecewise defined function is continuous and has a strictly positive value, and that is $\pi/2$.