6. For what values of the parameter $a$ will there be two solutions among the solutions of the inequality $(x+2) \sqrt{a x+x-x^{2}-a} \geqslant 0$ such that the difference between them is 4?
Answer: $a \in[-6 ;-3] \cup[5 ;+\infty)$.

Solution. Note that the expression under the square root can be transformed as follows: $a x+2 x-x^{2}-2 a=a(x-1)-x(x-1)=-(x-a)(x-1)$. The domain of the inequality is determined by the condition $(x-a)(x-1) \leqslant 0$. When $a=1$, this condition becomes $(x-1)^{2} \leqslant 0$, i.e., its solution is the single number $x=1$. When $a \neq 1$, it defines an interval between the points $a$ and 1 on the number line. Clearly, the first case does not satisfy the problem's condition since the inequality has no more than one solution. It can also be noted that for there to be 2 solutions 4 units apart, the domain must be an interval of length at least 4, from which $a \leqslant-3$ or $a \geqslant 5$.

The original inequality is equivalent to:

$$
(x+2) \sqrt{-(x-1)(x-a)} \geqslant 0
$$

We will solve this inequality using the interval method, and for placing the points on the number line where the factors in the left side of the inequality are zero, we will consider two cases.

1) $a \geqslant 5$. Then the domain is $x \in[1 ; a]$; any value of $x$ from this interval is a solution to the inequality, as the first factor in (1) is positive, and the second is non-negative. Therefore, all values of the parameter $a \in[5 ;+\infty)$ are suitable (for example, the solutions to the inequality are the numbers $x=1$ and $x=5$).
2) $a \leqslant-3$. Then the domain is $x \in[a ; 1]$. The interval method gives $x \in\{a\} \cup[-2 ; 1]$. In this set, there are points 4 units apart when $-6 \leqslant a \leqslant-3$ (these are the points $x=a$ and $x=a+4$). In the end, we get $a \in[-6 ;-3] \cup[5 ;+\infty)$.