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

Solution. The domain of the inequality is defined by the condition $x \leqslant 5$. Factoring the quadratic trinomial in the parentheses (for example, by the grouping method), we get $(x+2)(x-a) \sqrt{5-x} \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$. Then the factor $(x-a)$ is negative on the domain, and it can be discarded, changing the sign of the inequality. We get $(x+2) \sqrt{5-x} \geqslant 0, x \in[-2 ; 5]$. Clearly, on this interval there are points that are 4 units apart (for example, $x=-4$ and $x=0$). All values of $a<-5$ satisfy the condition of the problem.
2) $a=5$. The inequality takes the form $(x+2)(x-5) \sqrt{5-x} \leqslant 0$, which is equivalent to the inequality obtained in the previous case. Therefore, $a=5$ works.
3) $-2<a<5$. Then we get $x \in[-2 ; a] \cup\{5\}$. If $a \geqslant 0$, then in this set there are points 4 units apart ($x=0$ and $x=5$); if $a<0$, then there are no such points. Therefore, in this case, the values $a \in[0 ; 5)$ work.
4) $a=-2$. The inequality takes the form $(x+2)^{2} \sqrt{5-x} \leqslant 0$ and is satisfied only at $x=-2$ and $x=5$. This case does not work.
5) $a<-2$. Then $x \in[a ;-2] \cup\{5\}$, and solutions 5 units apart exist when $a \leqslant-7$.

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