4. Find all values of the parameter $a$ for which the equation

$|a-3| x+0.5|+x+2.5|+|a-x^{2}|=x^{2}+x-3|x+0.5|+2.5$ has exactly two integer solutions.

(16 points)

#
# Solution:

Let $u=a-3|x+0.5|+x+2.5, v=a-x^{2}$. Then the original equation will have the form $|u|+|v|=u-v$. The solutions to the latter equation are all $u$ and $v$ such that $u \geq 0, v \leq 0$, or $a-3|x+0.5|+x+2.5 \geq 0$ and $a-x^{2} \leq 0$. From this, we have $3|x+0.5|-x-2.5 \leq a \leq x^{2}$.

In the Oha system, we will plot the graphs of the functions $a=3|x+0.5|-x-2.5$ and $a=x^{2}$.

The right ray of the angle lies on the line $a=2x-1$, and the left ray of the angle lies on the line $a=-4x-4$. We will find the points of intersection of the parabola with these lines:

$x^{2}=2x-1, x=1, a=1$

$x^{2}=-4x-4, x=-2, a=4$.

For $a=0$, we have two solutions $x=-1, x=0$. For $a=1$, we have two solutions $x=-1, x=1$.

For $a=4$, we have two solutions $x=-2, x=2$.

For $a \in [7, 8)$, we have two solutions $x=3, x=4$.

For $a \in (9, 11)$, we have two solutions $x=4, x=5$. For other $a<12$, there will not be exactly two solutions. If $\frac{a+1}{2}-\sqrt{a} \geq 3$, then the equation will have at least three positive integer solutions.

Solving this inequality: $a-2\sqrt{a}-5 \geq 0, \sqrt{a} \geq 1+\sqrt{6}$. If $a \geq 12$, then the considered inequality is satisfied.

![](https://cdn.mathpix.com/cropped/2024_05_06_98d1c66abeb3b26d6d6dg-03.jpg?height=1450&width=1242&top_left_y=797&top_left_x=727)

Answer: $a \in \{0, 1, 4\} \cup [7, 8) \cup (9, 11)$.