You may want to review factoring out GCDs first.

Sometimes, there's nothing obvious to factor out of a whole
polynomial, but you can still factor something out of some of the
terms. For example, suppose you have 4*x**y* +
4*x* + *y* + 1. There's nothing that goes into all four
terms, but the GCD of the first two terms is 4*x*. So we can
factor it out, getting 4*x*(*y* + 1) + *y* + 1. (In
general, we could try to factor something out of the last two
terms, too, but in this case nothing works.)

What's the point of this? Well, not much in general, but, in this
case (and generally on this section of the website), note that the
first part of the expression is something times *y* + 1, and
what's left is *also* something (in this case 1)
times *y* + 1. So now the GCD of the two parts is *y* +
1, and the whole thing can be rewritten as (4*x* +
1)(*y* + 1), which is a factorization.