## Task A-2.2.

Determine all real numbers $x$ for which

$$
\left\lfloor\frac{x^{2}+1}{x+2}\right\rfloor+\left\lfloor\frac{x-1}{2}\right\rfloor=\frac{x(3 x+1)}{2(x+2)}
$$

For a real number $t, \lfloor t\rfloor$ is the greatest integer not greater than $t$.

For example, if $t=3.14$, then $\lfloor t\rfloor=3$.
## Solution.

According to the definition of the greatest integer function, for all real $t$ we have $\lfloor t\rfloor \leqslant t$, with equality holding if and only if $t$ is an integer.

Therefore,

$$
\left\lfloor\frac{x^{2}+1}{x+2}\right\rfloor \leqslant \frac{x^{2}+1}{x+2} \quad \text { and } \quad\left\lfloor\frac{x-1}{2}\right\rfloor \leqslant \frac{x-1}{2}
$$

By adding these inequalities, we get:

$$
\frac{x(3 x+1)}{2(x+2)}=\left\lfloor\frac{x^{2}+1}{x+2}\right\rfloor+\left\lfloor\frac{x-1}{2}\right\rfloor \leqslant \frac{x^{2}+1}{x+2}+\frac{x-1}{2}=\frac{x(3 x+1)}{2(x+2)}
$$

Thus, both of the above inequalities must be equalities, so $\frac{x^{2}+1}{x+2}$ and $\frac{x-1}{2}$ must be integers. The second fraction is an integer if and only if $x$ is an odd integer.

Let's rewrite the first fraction as:

$$
\frac{x^{2}+1}{x+2}=x-2+\frac{5}{x+2}
$$

Since $x$ is an integer, it is necessary and sufficient that $\frac{5}{x+2}$ be an integer. Therefore, $x+2 \in\{1,-1,5,-5\}$, which means $x \in\{-1,-3,3,-7\}$.