Let $a>2$ be a real number. Solve the equation $$ x^3-2 a x^2+\left(a^2+1\right) x+2-2 a=0 $$
The solution given in the book goes like this:
The trick is to view this as an equation in $a$. The discriminant is $\Delta=4(x-1)^2$, and we get $$ a=\frac{x^2+x}{x} \text { or } a=\frac{x^2-x+2}{x} . $$ These are quadratic equations that can be solved easily.
$\textbf{My Doubt:}$ In the problem, $a$ is a constant and $x$ is the variable, and we are solving for $x$, then how can we view it as an equation of $a$ and not as an equation on $x$?