Integral of function ($1$ if irrational, $2$ if rational)

1.6k Views Asked by At

Problem: Let the function $f$ be defined such that $$ f(x)=\begin{cases} 1 \quad x\in\mathbb{R}\backslash\mathbb{Q}\\ 2 \quad x\in \mathbb{Q}\end{cases}.$$

Compute the folowing integral: $\quad$$\int_0^1 f(x)\,dx$.

Would it be $1$ because there are infinitely many irrational numbers between each rational number?

I don't even know where to start with this.

2

There are 2 best solutions below

0
On BEST ANSWER

Riemann integral: $\int_0^1 f(x) dx$ is undefined, because the refinement of the partition of the interval does not result in a converging Riemann sum.

Lebesgue integral: $f\equiv 1$ almost everywhere, because the rational numbers are a countable set, which means that they are a set of measure zero and do not have any impact on the result. Therefore, $\int_0^1 f(x) dx = 1$

0
On

It could depend on exactly how you are defining integration. Have you heard the phrase "almost everywhere"? It means that the exceptions are a set of measure zero. In the reals, any finite or countable set has measure zero. So, your function is equal to 1 almost everywhere. Even some uncountable set have measure zero; not all, of course.

Almost everywhere at Wikipedia

Almost everywhere at Wolfram MathWorld