# Evaluating $\int_{0}^1\left(\int_0^{1}fdx\right)dy$, where $f(x,y)=\frac12$ for $x$ rational, and $f(x,y)=y$ for $x$ irrational

So, while solving problems on double integral I came across this weird problem:

Let $$f(x,y) = 1/2,\ \forall x\in \mathbb Q$$ $$f(x,y) = \ y, \ \forall x\in \mathbb Q^c$$ then find $$\int_{0}^1\left(\int_0^{1}fdx\right)dy$$

I have no idea how to approach this problem, First of all I am not sure whether this integral even exist or not .

Can anyone please explain to me how to think in this question ?

Thank you.

Let $$1_{\mathbb{Q}^c}(x)$$ be the indicator function of the irrationals. From $$\int_0^1 c \cdot 1_{\mathbb{Q}^c}(x)\,dx = c, \qquad \text{and} \qquad \int_0^1 c \cdot 1_{\mathbb{Q}}(x)\,dx = 0 ,$$ it follows (since $$y$$ is constant in the inner integral) that your integral is $$\int_0^1 y\,dy= \frac{1}{2}.$$
• You mean $\mathbb Q^{\mathrm c}$; actually $\Bbb Q^{\Bbb C} = \{\Bbb C\to\Bbb Q\}$, the set of all functions from $\Bbb C$ to $\Bbb Q$. – gen-ℤ ready to perish Aug 21 '19 at 20:38