The floored quadratic equation $a \lfloor x^2 \rfloor + b \lfloor x \rfloor + c = 0$

ceiling-and-floor-functionsquadratics

What are the roots of $f(x) = a\lfloor x^2 \rfloor +b\lfloor x \rfloor + c$?
(where $a \neq 0$ and $a,b,c \in \mathbb{R}, f: \mathbb{R} \rightarrow \mathbb{R}$ as usual)

My failed approach:
Let $\delta = x – \lfloor x \rfloor$ and get
\begin{align}
a \lfloor (\lfloor x \rfloor + \delta)^2 \rfloor + b\lfloor x \rfloor + c &= 0, \\
a \lfloor \lfloor x \rfloor^2 + 2\lfloor x \rfloor \delta + \delta^2 \rfloor + b\lfloor x \rfloor + c &= 0, \\
a \lfloor x \rfloor^2 + a\lfloor 2\lfloor x \rfloor \delta + \delta^2 \rfloor + b\lfloor x \rfloor + c &= 0.
\end{align}

From here there are 2 cases:
$$ a \lfloor x \rfloor^2 + a\lfloor 2\lfloor x \rfloor \delta \rfloor + b\lfloor x \rfloor + c = 0 \ \text{or}\ a \lfloor x^2 \rfloor + a\lfloor 2\lfloor x \rfloor \delta \rfloor + b\lfloor x \rfloor + (c + 1) = 0,$$

and then I'm stuck from here. This approach is probably not helpful since even if you get a quadratic equation in terms of $\lfloor x \rfloor$, you still have $\delta$ which is in terms of $x$, the variable of $f(x)$. Which is a difficult.

Best Answer

Fix $a,b,c$ reals with $a\neq 0$, let us look at some necessary conditions that $$(\dagger)\quad\quad a \lfloor x^2\rfloor + b \lfloor x\rfloor +c =0$$ will have a root:

(1) It is necessary that $a,b,c$ satisfies an integral relation $$aN + b M +c =0$$ for some integers $N,M$. Otherwise we will never have a root. For instance if $a,b$ are both rational and $c$ is irrational, then there is no root to $(\dagger)$. This is a very weak necessary condition to meet. We know that $N$ needs to be roughly the square of $M$, so we will make this precise next on what integers $N,M$ can be.

(2) Suppose $(\dagger)$ has a solution for some $x$. Let's break it into cases.

If $x\ge 0 $, then $n\le x < n+1$ for some non-negative integer $n$. In this case $\lfloor x\rfloor =n$, while $n^2\le x^2 <(n+1)^2 = n^2 + 2n+1$. Hence $\lfloor x^2 \rfloor$ can take on any of $n^2, n^2+1 ,\ldots, n^2 +2n$. Hence for $(\dagger)$ to have non-negative $x$ solutions, we need to satisfy $$ (\triangle)\quad\quad a (n^2 + k) + bn +c =0 $$ for some non-negative integer $n$ and $k=0,1,\ldots 2n$.

Once we have such $n$ and $k$, then we can work out what $x$ is.

We can analyze the scenario for a negative $x$ solution similarly.

If there is a negative $x$ solution, then $n\le x <n+1$ for some negative integer $n$. Note $(n+1)^2 < x^2 \le n^2$ as $x$ and $n$ are negative. So $\lfloor x \rfloor=n$ and $\lfloor n^2 \rfloor$ can take on any of $n^2 + 2n+1,\ldots ,n^2$ (again, note $n$ is negative). Hence for $(\dagger)$ to have non-negative $x$ solutions, we need to satisfy $$ (\triangle\triangle)\quad\quad a (n^2 - k) + bn +c =0 $$ for some negative integer $n$ and $k=0,1,\ldots -1-2n$.

Remark. Since we can actually solve for the real roots to $at^2+bt+c=0$, that will give you an approximate search range for such $n$, and you can brute force test out the relevant $(n,k)$ pairs that will satisfy $(\triangle)$ or $(\triangle\triangle)$. And then you can recover your $x$ values from $(n,k)$. (Note each $(n,k)$ pair will give you an interval of $x$ values.)

Related Question