How to solve $\left \lfloor x^2 - x - 2 \right \rfloor = \left \lfloor x \right \rfloor$

I need some help to solve the next equation: $$\left \lfloor x^2 - x - 2 \right \rfloor = \left \lfloor x \right \rfloor$$

Where $\left \lfloor \cdot \right \rfloor$ is the floor function.

What I've tried: $$x^2 - x - 2 - x < 1$$ $$x^2 - x - 2 \leq x < x^2 - x - 1$$

When I try to solve this system, I don't get the right solution. Is it right what I'm doing? How can I do to solve this?

• Hints: $x^2-x-2=(x-1/2)^2-\dots$. Draw the graphs of these functions. – Berci Jan 4 '15 at 23:24
• I wanted to know the exact solution, not just a guess from the graph... – francolino Jan 4 '15 at 23:30
• It's math.SE policy to require that you give more context and/or show some of your work when asking questions. What have you tried? Did any of the help you got on your last question give you ideas for this one? – aes Jan 4 '15 at 23:32
• A "guess from the graph" will tell you what region the floors are in, permitting you to solve the equation algebraically and get the exact answer. – Ross Millikan Jan 4 '15 at 23:37
• See useful techniques. – Mhenni Benghorbal Jan 5 '15 at 0:15

Your system of equations isn't quite right (for example, $x$ may be the smaller of the two).
To solve $\lfloor f(x) \rfloor = \lfloor x \rfloor$ write $x = n + \epsilon$ where $0\leq \epsilon <1$ and $n$ is an integer so that $\lfloor x\rfloor = n$.
Then the condition $\lfloor f(x)\rfloor = n$ is $n \leq f(n+\epsilon) < n+1$ (and the above conditions on $n$ and $\epsilon$).