<s>[INST] Help understanding how to factor completely $x^3-x^2-x+1$ I need someone to help explain the steps to completely factor the problem $x^3-x^2-x+1$.
Here is what I have done so far:

$x^3-x^2-x+1$ 
to 
$x^3-x^2+-1(x+1)$
Since there is a negative I changed $-x+1$ to $-1(x+1)$ 
to 
$x^2(x-1)+-1(x+1)$ 
to
$(x^2-1)(x-1)(x+1)$.

Is this correct? If not please explain what I did wrong and what I should do. If it is then thank you for saying so, if not, thank you for helping me to understand.
 [/INST] \begin{align}x^3-x^2-x+1&=x^3-x^2-x+1+(3x^2-3x^2)+(3x-3x)\\
&=x^3+3x^2+3x+1-x^2-x-3x^2-3x\\
&=(x+1)^3-4x^2-4x\\
&=(x+1)^3-4x(x+1)\\
&=(x+1)\left[(x+1)^2-4x\right]\\
&=(x+1)(x-1)^2\end{align}
</s>