# Solve $x-\lfloor x\rfloor= \frac{2}{\frac{1}{x} + \frac{1}{\lfloor x\rfloor}}$

Could anyone advise me how to solve the following problem:

Find all $x \in \mathbb{R}$ such that $x-\lfloor x\rfloor= \dfrac{2}{\dfrac{1}{x} + \dfrac{1}{\lfloor x\rfloor}},$ where $\lfloor *\rfloor$ denotes the greatest integer function.

Here is my attempt:

Clearly, $x \not \in \mathbb{Z}.$

$\dfrac{x}{\lfloor x \rfloor} - \dfrac{\lfloor x \rfloor}{x}= 2$

$\implies x^2 -2x\lfloor x \rfloor - \lfloor x \rfloor ^2 = 0$

$\implies x = (1 \pm \sqrt2 )\lfloor x \rfloor$

$\implies \{x\} = \pm\sqrt2 \lfloor x \rfloor$

Thank you.

You have $$x=(1\pm\sqrt 2)\lfloor x\rfloor.$$
Now let $\lfloor x\rfloor=k\in\mathbb Z$ where $k\not=0$. Then $$k\le x\lt k+1\Rightarrow k\le (1\pm\sqrt 2)k\lt k+1\Rightarrow k=0.$$
So, there is no such $x\in\mathbb R$.
Completing the square gives $$x^2-2x\lfloor x\rfloor+\lfloor x\rfloor^2=2\lfloor x\rfloor^2$$ so $$(x-\lfloor x\rfloor)^2=2\lfloor x\rfloor^2$$ Since $0\le x-\lfloor x\rfloor<1$, we conclude $\lfloor x\rfloor=0$ that's disallowed by the starting equation.