6. For what values of the parameter $a$ will there be two solutions among the solutions of the inequality $\left(x^{2}-a x-x+a\right) \sqrt{x+5} \leqslant 0$ whose difference is 4?
Answer: $a \in(-\infty ;-1] \cup[5 ;+\infty)$.

Solution. The domain of the inequality is determined by the condition $x \geqslant-5$. By factoring the quadratic trinomial in the parentheses (for example, by the grouping method), we get $(x-1)(x-a) \sqrt{x+5} \leqslant 0$. We will solve this inequality using the interval method. To place the points where the left side of the inequality is zero on the number line, we need to consider several cases.

1) $a<-5$. In this case, the points are $x=-5$, $x=1$, and $x=a$. The solution is $x \in\{-5\} \cup[1 ; a]$. For the solution to include points that are 4 units apart, $a$ must be such that $a-1=4$, i.e., $a=5$. However, since $a<-5$, this case does not provide valid solutions.
2) $-5 \leqslant a < 1$. The points are $x=-5$, $x=1$, and $x=a$. The solution is $x \in\{-5\} \cup[a ; 1]$. For the solution to include points that are 4 units apart, $a$ must be such that $1-a=4$, i.e., $a=-3$. This case provides valid solutions for $a \in[-5 ;-1]$.
3) $a=1$. The inequality becomes $(x-1)^2 \sqrt{x+5} \leqslant 0$ and is satisfied only at $x=-5$ and $x=1$. This case does not provide valid solutions.
4) $a>1$. The points are $x=-5$, $x=1$, and $x=a$. The solution is $x \in\{-5\} \cup[1 ; a]$. For the solution to include points that are 4 units apart, $a$ must be such that $a-1=4$, i.e., $a \geqslant 5$.

Combining the results of all considered cases, we get $a \in(-\infty ;-1] \cup[5 ;+\infty)$.