# Let $f:[0,1]\to \Bbb R$ such that $f(x)=x$ if $x$ be rational $x^2$ if $x$ be irrational. Find $\underline{\int}_0^1 f$ and $\overline{\int}_0^1f.$

A function $$f$$ is defined on $$[0,1]$$ by $$f(x)=x$$ if $$x$$ be rational $$x^2$$ if $$x$$ be irrational. Find $$\underline{\int}_0^1 f$$ and $$\overline{\int}_0^1f.$$

The solution given is as follows:

$$f$$ is bounded on $$[0,1].$$ For all $$x\in (0,1), x> x^2.$$

Let $$I=[0,1].$$ If $$f/(I\cap Q)$$ is monotone increasing on $$I\cap Q.$$

$$f /(I - Q)$$ is monotone increasing on $$I-Q.$$

Let $$P_n$$ be the partition of $$[0,1]$$ defined by $$P_n=(x_0, x_1,... ,x_n),$$ where $$x_0= 0,x_r=\frac rn; r = 1,2, ...,n.$$ Let $$M_r =\sup f(x),m_r = \inf f(x),$$ for $$r = 1,2,...,n.$$ Since $$f/(I \cap Q)$$ is monotone increasing on $$[x_{r-1}, x_r]\cap Q,$$ $$\sup_{x\in [x_{r-1},x_r]}f(x)=f(x_r)=\frac rn.$$

Since $$f/(I-Q)$$ is monotone increasing on $$[x_{r-1},x_r]$$, and $$x_r$$ is rational, $$\sup_{x\in [x_{r-1},x_r]}f(x) =\lim f(u_n )=x_r^2=(\frac rn)^2,$$ where $$\{u_n\}$$ is a sequence of irrational points in $$[x_{r-1},x_r]$$ converging to $$x_r.$$ Since $$\frac rn \geq (\frac rn)^2,$$ $$\sup_{x\in [x_r,x_{r-1}]} f(x)=\frac rn.$$ Hence $$M_r=\frac rn,$$ for $$r=1,...,n.$$

Since $$f/(I-Q)$$ is monotone increasing on $$[x_{r-1},x_{r}]-Q,$$ and $$x_{r-1}$$ is rational, $$\inf_{x\in [x_{r-1},x_r]-Q}f(x) =\lim_{n\to\infty}f(v_n)=x_{r-1}^2=(\frac{r-1}{n})^2,$$ where $$\{v_n\}$$ is a sequence of irrational points in $$[x_{r-1},x_r]$$ converging $$x_{r-1}.$$

Since $$(\frac{r-1}{n})^2\leq \frac{r-1}{n},$$ $$inf_{x\in [x_{r-1},x_r]} f(x) = (\frac{r-1}{2})^2.$$

Hence $$m_r= (\frac{r-1}n)^2,\in [x_{r-1},x_r],r=1,...,n.$$

$$U(P_n,f)= M_1(x_1 - x_0) + M_2(x_2-x_1) + ... + M_n(x_n - x_{n -1})=\frac 1n[\frac 1n+\frac 2n+...+\frac nn]=\frac{n+1}{2n}.$$

$$L(P_n, f)=m1(x_l - x_0) + m_2(x_2 x_1) + ... + m_n(x_n - x_{n-1})=\frac 1n [0 + (\frac 1n)^2 + (\frac{2}{n})^2 + ... + (\frac{n-1}{n})^2]=\frac{(n-1)(2n-1)}{6n^2}.$$

Let us consider the sequence of partitions $$\{P_n \}$$ of $$[0,1].$$ $$||Pn||=\frac 1n$$ and $$\lim ||P_n||=0.$$

Then $$\overline{\int}_0^1\lim_{n\to\infty}U(Pn , f)=\frac 12$$ and $$\underline{\int}_0^1 = \lim_{n\to\infty} L(P_n,f)=\frac 13.$$

However, I don't understand the following two lines:

• Since $$f/(I-Q)$$ is monotone increasing on $$[x_{r-1},x_r]$$, and $$x_r$$ is rational, $$\sup_{x\in [x_{r-1},x_r]}f(x) =\lim f(u_n )=x_r^2=(\frac rn)^2,$$ where $$\{u_n\}$$ is a sequence of irrational points in $$[x_{r-1},x_r]$$ converging to $$x_r.$$

and

• Since $$f/(I-Q)$$ is monotone increasing on $$[x_{r-1},x_{r}]-Q,$$ and $$x_{r-1}$$ is rational, $$\inf_{x\in [x_{r-1},x_r]-Q}f(x) =\lim_{n\to\infty}f(v_n)=x_{r-1}^2=(\frac{r-1}{n})^2,$$ where $$\{v_n\}$$ is a sequence of irrational points in $$[x_{r-1},x_r]$$ converging $$x_{r-1}.$$

I don't get how are they so certain that $$\exists$$ a sequence of irrational numbers $$\{u_n\}$$ and $$\{v_n\}$$ converging to $$x_r$$ and $$x_{r-1}$$ respectively. I know Density Theorem implies that $$\exists$$ sequences of irrational numbers say, $$\{u_n'\}$$ and $$\{v_n'\}$$ converging to $$x_r$$ and $$x_{r-1}$$ respectively but how can I be sure that I can choose the sequences $$\{u_n'\},\{v_n'\}$$ in such a manner so that both of them lies in the interval $$[x_{r-1},x_r].$$

This is the part that confuses me. Any clarifications regarding this will be greatly appreciated.

• "Find $\int_0^1 f$ and $\int_0^1f.$" I'm guessing this is some kind of typo? Commented Feb 13 at 5:06
• It probably should be $\overline{\int}_0^1$ and $\underline{\int}_0^1$, as somewhere in the question body. Commented Feb 13 at 5:37
• @TheoBendit Thanks for pointing out the typo. I have fixed it now. Commented Feb 13 at 7:20
• If ever there's a function whose integral does not exist, this looks like a perfect candidate (not sure if I'm right, though). Commented Feb 13 at 7:34
• Intuitively we have $\underline{\int}_0^1 f = \int_0^1 x^2=\frac 13$ and $\overline{\int}_0^1 f=\int_0^1 x=\frac 12$, I am a bit surprised that the proof is so technical. Commented Feb 13 at 7:41

The density of the irrationals in $$\mathbb{R}$$ means that any open interval contains an irrational number.

To construct a sequence of irrational numbers contained in $$[x_{r-1},x_r]$$ and converging to $$x_r$$, let $$u_1$$ be an irrational number in $$(x_{r-1},x_r)$$. Let $$u_2$$ be an irrational number in $$(a_1,x_r)$$ where $$a_1 = (u_1+x_r)/2$$. Proceeding in this way we construct sequences of real numbers $$(a_n)$$ and irrational numbers $$(u_n)$$ such that for $$n = 1,2,3,\ldots$$ we have

$$a_n = \frac{u_n+x_r}{2}, \quad u_{n+1} \in (a_n,x_r)$$

The sequence $$(u_n)$$ is increasing and bounded above by $$x_r$$ since for every $$n$$ we have

$$u_n < \frac{u_n+x_r}{2} < u_{n+1}

and since $$u_1 > x_{r-1}$$, the sequence clearly lies in $$[x_{r-1},x_r]$$.

Finally, by a simple inductive argument we have for $$n > 1$$,

$$x_r - u_n < \frac{x_r - u_1}{2^{n-1}},$$

and, hence, $$u_n \to x_r$$ as $$n \to \infty$$.

• If I understood correctly, your proof means that the irrational $u_n$ lies in the interval $[x_{r-1},x_r]$. But does this complete the proof that "The density of the irrationals in $\mathbb R$ means that any open interval contains an irrational number."? Commented Mar 26 at 10:01
• @MathArt: I’m not proving that first statement here. It is a well-known property of the real numbers. I’m using it to prove there is a sequence of irrational numbers converging to the endpoint $x_r$ that stays in the closed interval. Similarly one constructs a sequence of irrational numbers converging to the left endpoint.
– RRL
Commented Mar 26 at 13:10
• Thanks. It is not fundamental to master. Commented Mar 28 at 13:39