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

$$
\left(x^{2}-6 x+8-a\right)\left(x-a^{2}+6 a-8\right)=0
$$

has exactly two distinct real roots.

(P. Alishev)
Answer: $a \in\{-1\} \cup\left\{\frac{5}{2} \pm \frac{\sqrt{13}}{2}\right\} \cup\left\{\frac{7}{2} \pm \frac{\sqrt{17}}{2}\right\}$

Solution: We will solve the problem graphically. Replace $a$ with $y$ and draw the set of solutions of the equation in the $Oxy$ plane.

The original equation is equivalent to the following system

$$
\left[\begin{array}{l}
y=x^{2}-6 x+8 \\
x=y^{2}-6 y+8
\end{array}\right.
$$

The graph of the first equation is a parabola with branches directed upwards, and the graph of the second equation is a parabola rotated by $90^{\circ}$ (see figure). When we swap $x \leftrightarrow y$, the first parabola transforms into the second and vice versa. Therefore, they are symmetric with respect to the line $y=x$, which means that two points of intersection of these parabolas lie on this line.

![](https://cdn.mathpix.com/cropped/2024_05_06_e94ee529447c7af3ef59g-4.jpg?height=796&width=1519&top_left_y=173&top_left_x=331)

Now let's move on to solving the problem. Since the original equation must have exactly two distinct solutions, the line $y=a$ must intersect both of our parabolas at exactly two points. As can be seen from the figure, this is possible only at five points: when the line passes through the vertex of the first parabola or when the line passes through one of the points of intersection of the parabolas. Let's consider both cases:

I) The line passes through the vertex of the parabola. The vertex has coordinates $\left(-\frac{b}{2 a} ;-\frac{D}{4 a}\right)=(3 ;-1)$. Then we get the line $y=-1$.

II) The line passes through one of the points of intersection of the parabolas. The points of intersection are found from the system

$$
\begin{gathered}
\left\{\begin{array}{l}
y=x^{2}-6 x+8, \\
x=y^{2}-6 y+8 .
\end{array} \Longrightarrow\right. \\
\Rightarrow y=\left(y^{2}-6 y+8\right)^{2}-6\left(y^{2}-6 y+8\right)+8 \Longrightarrow \\
\Longrightarrow y^{4}-12 y^{3}+46 y^{2}-61 y+24=0 .
\end{gathered}
$$

Moreover, two of them can be found from the condition $y=x$, that is, from the equation

$$
y=y^{2}-6 y+8 \Longrightarrow y^{2}-7 y+8=0
$$

Divide the fourth-degree polynomial by the quadratic and we get

$$
y^{4}-12 y^{3}+46 y^{2}-61 y+24=\left(y^{2}-7 y+8\right)\left(y^{2}-5 y+3\right)=0 .
$$

Now we can easily find all four points: $y=\frac{7}{2} \pm \frac{\sqrt{17}}{2}$ and $y=\frac{5}{2} \pm \frac{\sqrt{13}}{2}$. Thus, we obtain five possible values of the parameter

$$
a \in\{-1\} \cup\left\{\frac{5}{2} \pm \frac{\sqrt{13}}{2}\right\} \cup\left\{\frac{7}{2} \pm \frac{\sqrt{17}}{2}\right\}
$$