-1

Define

$f(x) = \left\{ \begin{array}{ll} 1 & \mbox{if } x \in \mathbb{Q} \\ 0 & \mbox{if } \notin \mathbb{Q} \end{array} \right.$

How to evaluate $\int_0^1 f(x)\,dx$ ?

I have no idea how to solve it, but all I think is that: since between any two rational numbers there exist an irrational number and vice versa, so the number of rational and irrational numbers are same in the interval of $[0,1]$ (or $[0,1)$ to be precise), and since the integral is equivalent to area under the function, so $\int_0^1 f(x)\,dx$ must be equal to $\frac{1}{2}$. Is that correct?

Thank you.

glS
  • 7,963
  • 4
    Riemann or Lebesgue integral? http://math.stackexchange.com/questions/437711/is-dirichlet-function-riemann-integrable, http://math.stackexchange.com/questions/755576/the-lebesgue-integral-and-the-dirichlet-function – Hans Lundmark Feb 27 '15 at 11:39
  • @Hans Lundmark: Unfortunately I don't have knowledge of advanced real analysis (Riemann or Lebesgue integral), and by integration I mean what is in calculus. Is there some simple explanation for the solution? Thank you. –  Feb 27 '15 at 11:43
  • 3
    Then it's the Riemann integral, and your function $f$ is not integrable. – Hans Lundmark Feb 27 '15 at 11:46

2 Answers2

3

It is not Riemann-integrable, as the upper and lower Darboux sums do not converge to the same limit:

For a given partition $\,P\colon0=x_0<x_1<\dots<x_{n-1}<x_n=1$, the upper and lower Darboux sums are, respectively:

\begin{align*} U_{f,P}&=\sum_{i=1}^n (x_{i}-x_{i-1})M_i && M_i=\sup_{x\in[x_{i},x_{i-1}]}f(x)\\ L_{f,P}&=\sum_{i=1}^n (x_{i}-x_{i-1})m_i && m_i=\inf_{x\in[x_{i},x_{i-1}]}f(x) \end{align*} Since any non-empty interval contains both rational and irrational numbers, $M_i=1,\enspace m_i=0$, hence $U_{f,P}=1$ and $L_{f,P}=0$ for any partition $P$.

For the Lebesgue integral, it's different: as $[0,1]\cap\mathbf Q$ has measure $0$, $f$ is equal to the null function almost everywhere, hence it is integrable and its integral is equal to $0$.

Bernard
  • 179,256
  • If $m([0,1]\cap\mathbb {Q})=0$, can we say that ratio of number of irrational numbers to rational numbers is infinite in $[0,1]$? –  Mar 01 '15 at 03:15
  • That belongs to the theory of (transfinite) cardinals. In a sense, yes. Rational numbers are denumerable (i.e. they can be numbered) while real numbers can't. If you denote $\aleph_0$ the cardinal number of $\mathbf Q$ then the cardinal of $\mathbf R$ is (in a certain sense) $2^{\aleph_0}$. – Bernard Mar 01 '15 at 03:25
0

$$\int_0^1 f(x)dx=1\cdot m([0,1]\cap \mathbb Q)+0\cdot m([0,1]\cap (\mathbb R\backslash \mathbb Q))=0$$

Surb
  • 57,262
  • 11
  • 68
  • 119