How can I solve for $x$ given $a=x \lfloor x \rfloor$
Where $\lfloor x \rfloor$ denotes the greatest integer less than or equal to $x$, and where $a$ is a rational number.
What I've done
\begin{align} \frac{a}{x} &= \lfloor x \rfloor \\ \implies \frac{a}{x} & \le x < \frac{a}{x}+1 \\ \end{align}
which yields two cases
\begin{align} \sqrt{a} &\le x \quad (1) \\\\ \left(x+\frac{1+\sqrt{1+4a}}{2}\right) \left(x+\frac{1-\sqrt{1+4a}}{2}\right) &< 0 \quad (2) \end{align}
If $\lfloor x \rfloor = n$, you want $x = a/n$ and $n \le a/n < n+1$. Thus (assuming $n > 0$) $n^2 \le a < n^2 + n$. Now $(n+1)^2 = n^2 + 2 n + 1 > n^2 + n$. So:
Given $a \ge 1$, take $n = \lfloor \sqrt{a} \rfloor$. If $a \ge n^2 + n$ there is no solution. Otherwise, $x = a/n$.