How do you find that: $x^3+4x^2+x-6=(x+2)(x^2+2x-3)$? How do you find that: $x^3+4x^2+x-6=(x+2)(x^2+2x-3)$?
I get that you can take out the $x$ like so: $x^3+4x^2+x-6=x(x^2+4x+1)-6$ but how do you get the $2$ from here?

*

*Struggle to find a real root. By trying small positive and negative integers, you find that $P(-2)=0$. So $x+2$ is a factor.

*Apply the change of variable $y=x+2$:
$$P(x)=P(y-2)=(y-2)^3+4(y-2)^2+(y-2)+6=y^3-2y^2-3y.$$
Now you easily factor as
$$P(y-2)=y(y^2-2y-3),$$
and revert to the original
$$P(x)=(x+2)\left((x+2)^2-2(x+2)-3\right)=(x+2)(x^2+2x-3).$$

Similarly, $x=1$ is a root of $x^2+2x-3$; set $z=x-1$, and
$$x^2+2x-3=(z+1)^2+2(z+1)-3=z^2+4z=z(z+4).$$
Hence, $$x^2+2x-3=(x-1)((x-1)+4)=(x-1)(x+3).$$
Tedious, but "without" long division.
