5. Find all values of the parameter $a$, for each of which the sum of the lengths of the intervals that make up the solution to the inequality

$$
\frac{x^{2}+\left(2 a^{2}+2\right) x-a^{2}+4 a-6}{x^{2}+\left(a^{2}+5 a-5\right) x-a^{2}+4 a-6}<0
$$

is not less than 1.
Solution. Let's analyze the graphs of the functions in the numerator and denominator of the fraction. Let $y=f(x)$ be the function of the numerator, and $y=g(x)$ be the function of the denominator. Both of these functions are quadratic trinomials, and their graphs are parabolas. The problem reduces to the inequality $\frac{f(x)}{g(x)}<0$, and if $f(x_0)=g(x_0)=0$, then for any $a$ the sign of the difference $f(x)-g(x)$ coincides with the sign of $\mathrm{x}$, so the parabolas are positioned as shown in figure a).

The solution to the inequality is the union of the intervals $\left(x_{1} ; x_{3}\right)$ and $\left(x_{2} ; x_{4}\right)$, the sum of the lengths of which is equal to $x_{3}-x_{1}+x_{4}-x_{2}=\left(x_{3}+x_{4}\right)-\left(x_{1}+x_{2}\right)=a^{2}-5 a+7$.

According to the problem, this number is not less than 1, hence $a^{2}-5 a+6 \geq 0$, i.e., $a \in(-\infty ; 2] \cup[3 ;+\infty)$.

Answer: $a \in(-\infty ; 2] \cup[3 ;+\infty)$.