How can you factor $x^4-6x^3+8x^2+2x-1?$ The original question is:
Solve this equation for x:
$$(x^2-3x+1)^2-3(x^2-3x+1)+1=x$$
I expanded and simplified it to get
$$x^4-6x^3+8x^2+2x-1=0$$
Since neither -1 nor 1 are factors, it appears that the roots will be fractional. How can I proceed from here? Thanks.
 A: Hint:
$f(x)=x^2(x-3)^2-(x-1)^2$
A: Let $f(x) = x^2 -3x + 1$
Note that the original equation is in the form $f(x)^2 - 3f(x) + 1 = x$, and the LHS is equivalent to $f(f(x))$.
So you know that the required roots are the roots of $f(f(x)) = x$.
Apply the inverse function to both sides to get $f(x) = f^{-1}(x)$.
Graphically, the inverse function is formed by reflecting the function in the line of identity $y = x$. This implies that the two points of intersection between $y=f(x)$ and $y=x$ will give the required roots.
So all you have to solve is $x^2 - 3x + 1 = x$ or $x^2 - 4x + 1 = 0$.
(Of course, it's strictly improper to speak of an inverse function here, since the quadratic is not bijective. If you wanted to be rigorous, you could split the domain up to make the same argument).
A: Note that initial equation have following form:
$$f(f(x))=x$$
where $f(x) = x^2 -3x+1$
So roots of $f(x)=x$ equation will be roots of your initial equation. Solve this quadratic equation and you will get 2 roots. Other 2 roots you can get from 4-degree polynom factorization.
