Factoring $x^3 - x^2 - x + 1$ I'm familiar with basic forms of polynomial factoring like completing the square or factoring (e.g. finding that $x^2+x-6=(x+3)(x-2)$, but I'm currently working on integration of rational functions by partial fractions and I find myself encountering the factorizations of polynomials unlike those I've worked with before.

Given: $x^3 - x^2 - x + 1$

When I first look at this, I'm unsure of where to start. It's very unlike the example above. It's degree $3$, for one thing, and it has $4$ terms.

When I look ahead to the solution, the book says $f(1) = 0$, so we know that $(x-1)$ is a factor. Okay, now that they mention that, I can see it fits, but what?! How did they come up with that? Is that a general rule? Does anyone have a link to where I can learn about it?

Further, once it's known that $(x-1)$ is a factor, how do I then factor an $(x-1)$ out of a longer polynomial like this?

In other words, how does $x^3 - x^2 - x + 1 = (x-1)(x^2-1)$?

Where can I learn more about this type of factorization?
$$\begin{align}x^3-x^2-x+1&amp;=x^3-x^2-(x-1)\\&amp;=x^2(x-1)-(x-1) \\&amp;=(x-1)(x^2-1)\\&amp;=(x-1)[(x-1)(x+1)]\\&amp;=(x+1)(x-1)^2\end{align}$$
There's some theorem (rational root theorem/ factor theorem?) that says that for all rational factors of the form p/q, p divides into the constant in your polynomial and q divides into the leading coefficient. That leaves to with 1 and -1. Testing 1, first, we find it's a root. -1 is also a root. Using polynomial division it becomes easier to test these numbers. Since it's a cubic it has three roots - it turns out that 1 is a double root.