I have been under the assumption that Integrate performs Riemann integration. But when I try to integrate the Dirichlet function, it evaluates to $0$.
Dirichlet function is defined as follows: $$ f(x) = \begin{cases} 1 & x\in\mathbb{Q} \\ 0 & x\notin\mathbb{Q} \end{cases} $$ Under Riemann integration, this function is not integrable; but under Lebesgue integration, this function evaluates to $0$.
So does it mean Integrate performs Lebesgue integration? Or is it neither and I am not even asking the correct question to begin with? Couldn't find anything in the documentation about this.
EDIT: My implementation of Dirichlet function is as follows:
f[x] := Piecewise[{{1, Element[x, Rationals]}, {0, True}}]
And the code for the integral is simply
Integrate[f[x], {x, 0, 1}]
IntegrateorNIntegrateto do the integral? Your code would be useful here as well. – Michael Seifert Sep 29 '21 at 20:29x \[Element] Rationals; sorry, I'm not sure how to put in Mathematica code here yet.. And I usedIntegrate(notNIntegrate), but from $x=0$ to $x=1$ – Tham Sep 29 '21 at 21:39Integrateuses whatever theory of integration it can bring to bear to find a useful answer. – John Doty Sep 29 '21 at 22:36