<s>[INST] Complete the square of a 4th degree expression $k^4 + 2k^3 -k^2 - 2k + 1$ I was reading the solution of a problem and I can't figure out how to go from here:
$k^4 + 2k^3 -k^2 - 2k + 1$
to:
$((k^2 + k) -1)^2$
I guess it's using the complete-the-square method but I've only used that with quadratic expressions.
 [/INST] $k^4+2k^3−k^2−2k + 1 = k^4 + (k^2 - 2k^2) + 2k^3 - 2k + 1 \quad \Rightarrow$
$k^4+2k^3−k^2−2k + 1 = (k^4 - 2k^2 + 1) + 2k(k^2 - 1) + k^2$ 
$= (k^2 - 1)^2 + 2(k^2 - 1)k + k^2 = (k^2 - 1 + k)^2 = ((k^2 + k) - 1)^2$
</s>