5

The question was:

Find $\int_{[0, \pi/2]} f$ if $$f(x) = \begin{cases} \sin{x}, & if \cos(x) \in \mathbb{Q}, \\ \sin^2{x}, & if \cos(x) \not\in \mathbb{Q}. \end{cases}$$

My answer was:

Assume that $0 \leq x \leq \pi/2$, then taking the cosine of this, we get $\cos 0 \geq \cos x \geq \cos (\pi/2),$ so, $1 \geq \cos (x) \geq 0$ (because $\cos (x)$ is a decreasing function in this interval.)\

Now, by monotonicity of measure $$m\{x \in [0, \pi/2] \mid \cos(x)\in \mathbb Q\} \subseteq m\{[0, \pi/2] \cap \mathbb{Q}\}.$$

But,$m\{[0, \pi/2] \cap \mathbb{Q}\} = 0.$\

This is because $\mathbb{Q}$ is countable and hence its measure is 0 and $\{[0, \pi/2] \cap \mathbb{Q}\} \subset \mathbb{Q}$, then by monotonicity of measure $m\{[0, \pi/2] \cap \mathbb{Q}\} = 0.$\

And since the integral of each integrable function $f$ on a set of measure equal to $0$ is $0$, we have:\

$\int_{[0, \pi/2]} f = \int_{[0, \pi/2] \cap \mathbb{Q}} f + \int_{[0, \pi/2] \cap \mathbb{Q}^c} f = 0 + \int_{[0, \pi/2] \cap \mathbb{Q}^c} f = \int_{[0, \pi/2] \cap \mathbb{Q}^c} \sin^2{x} = \int_{[0, \pi/2] \cap \mathbb{Q}} \sin^2{x} + \int_{[0, \pi/2] \cap \mathbb{Q}^c} \sin^2{x} dx = \int_{[0, \pi/2]} \sin^2{x} dx,$\

Where in the last equality we have changed the Lebesgue integral over $[0, \pi/2]$ into Riemann integral over $[0, \pi/2]$ because our function $\sin^2{x}$ is Riemann integrable and bounded by $[0,1]$ and the domain of integration is closed and bounded interval then by \textbf{ Theorem 3, on page 73} the Lebesgue integral is the Riemann integral.\

Now we can compute this integral:\

$$\int_0^{\pi/2}f(x)\,\mathrm d x=\int_0^{\pi/2}\sin^2(x)\,\mathrm d x = \int_0^{\pi/2} \{ \frac{1 - \cos{2x}}{2} \} d x = \frac{\pi}{4} - ( \frac{1}{4} \times 0) = \frac{\pi}{4}. $$

But it turns out that:

My justification in this step:

$$m\{x \in [0, \pi/2] \mid \cos(x)\in \mathbb Q\} \subseteq m\{[0, \pi/2] \cap \mathbb{Q}\}.$$ was wrong, could anyone help me correct this step please?

  • 1
    If $X={x\in [0,\pi/2]\mid \cos(x) \in\Bbb{Q}} $ then since $\cos(x) $ is bijective on $[0,\pi/2]$ then there is a bijection between $X$ and $[0,1]\cap \Bbb{Q}$ ($f(x) =\cos(x) $) so $X$ is countable so it's measure is $0$. If I understood correctly that you only needed the measure to be $0$. – kingW3 Oct 10 '19 at 22:26
  • yes this is exactly what I need. what do you mean by $\mathbb{Q}(f(x) = \cos (x))$? –  Oct 10 '19 at 22:46
  • I meant we take $f(x) =\cos x$ it's easy to prove that function is a bijection on $X\to \Bbb{Q} \cap [0,1]$. Probably should have written it more clearly. – kingW3 Oct 10 '19 at 22:51
  • Could you please write your detailed answer as an answer so that I can accept it? @kingW3 –  Oct 10 '19 at 23:15
  • Also, could you please look at this question for me (if you do not mind) https://math.stackexchange.com/questions/3388757/proving-some-points-missed-in-my-proof? –  Oct 10 '19 at 23:16
  • for my first comment above my question is: do you mean the rational numbers that satisfy $(f(x) = \cos (x))$ ?@kingW3 –  Oct 10 '19 at 23:19
  • 1
    Let me rewrite that part; then there is a bijection between $X$ and $[0,1]\cap \Bbb{Q} $(we can take $f(x) =\cos (x) as an easy bijective function.). As for the other question I'm not really good at measure theory so someone else might be better suited to help you. – kingW3 Oct 10 '19 at 23:27

2 Answers2

2

It's better to directly prove that $X=\{x\in [0,\pi/2]\mid \cos(x) \in\Bbb{Q}\}$ is countable.

There is a natural bijection between $X\to \Bbb{Q} \cap [0,1]$ given by $f(x) = \cos(x) $ since $\cos$ is injective (1 on 1) on $[0,\pi/2]$ then so it is on $X\subseteq [0,\pi/2]$.

Since $\cos x$ is surjective (onto) from $[0,\pi/2]$ to $[0,1]$ then for each element from $[0,1]\cap\Bbb{Q}$ there is a corresponding element $y\in [0,\pi/2]$ such that $\cos y=x$ but by definition $\cos y=x\in\Bbb{Q} $ so $y\in X$.

kingW3
  • 13,496
  • I don't think we need to know that $\cos$ is onto. All we need is that $c^{-1}(y)$ is finite for any $y$, where $c$ is $\cos$ restricted to $[0, \pi / 2]$. Then $X = c^{-1}(\Bbb{Q} \cap [0, 1])$ is clearly countable. – Hew Wolff Oct 11 '19 at 00:19
  • Could you please explain your idea in detail in an answer @HewWolff? – Intuition Oct 13 '19 at 16:22
  • why "all we need that $c^{-1}(y)$ is finite for any $y$"?@HewWolff – Intuition Oct 13 '19 at 16:30
  • 1
    I think it's because then there is a finite $M$ such that $|c^{-1}(y)|\leq M$ then $|c^{-1}(\Bbb{Q}\cap [0,1])|\leq |M||\Bbb{Q}\cap [0,1]| =|\Bbb{Q}\cap [0,1]|$. Though it's better if HewWolff answers what he thinks; anyway a different way with avoiding onto is that $X\to \Bbb{Q}$ is an injection so $|X|\leq |\Bbb{Q}|$ which means that $X$ is countable, or we could take $X\to \Bbb{Q}\cap[0,1]$ and we'd still get $|X|\leq |\Bbb{Q}\cap [0,1]|$ – kingW3 Oct 13 '19 at 16:52
  • in the last line in your answer, when you said "by definition" which definition do you mean? @kingW3 –  Oct 17 '19 at 15:26
  • 1
    @Smart by the definition of $X$ – kingW3 Oct 17 '19 at 15:34
  • why $|X| \leq |Q|$ means that $X$ is countable? do you mean finite countable or infinite countable? and so by this, it will still have measure 0? can not it be an interval? –  Oct 17 '19 at 16:01
  • @Smart it doesn't matter whether it is finite/infinite countable, any countable set has measure $0$. Because the cardinality of $X$ is smaller or equal to the cardinality of $\Bbb{Q}$ which is countable. It can't be an interval because no interval has measure $0$. – kingW3 Oct 17 '19 at 16:31
2

Expanding a little on my comment...We need to show that we can ignore the $\cos x \in \Bbb{Q}$ case and just integrate $\sin^2$. Moreover, this is true when integrating over any subset $J \subseteq \Bbb{R}$, not just $J = [0, \pi/2]$.

I claim that $X = \{x \in J: \cos x \in \Bbb{Q} \}$ is countable. If this is true, then $X$ has measure zero, and deleting that case in the definition of $f$ does not change the integral of $f$, as required.

We can assume $J = \Bbb{R}$ since this gives us the largest $X$. Note that for any $y \in \Bbb{R}$, if we define $C_y$ as $\{x \in \Bbb{R}: \cos x = y\}$, then $C_y$ is countable (look at the way horizontal lines meet the cosine graph). $X$ is just $\bigcup_{y \in \Bbb{Q}} C_y$, so it's a countable union of countable sets. So $X$ is countable, as required.

Hew Wolff
  • 4,074