Sub topic 3
Factoring Out the Greatest Common Factor
This chapter assumes you can multiply integers, apply the exponent rule x^m * x^n = x^(m+n), use the distributive property, and recognize terms, coefficients, monomials, binomials, and trinomials. Factoring out the greatest common factor (GCF) is the first move in almost every factoring problem. Later chapters (grouping, trinomials, special products) all depend on it.
The idea: the distributive property run backward
The distributive property says a(b + c) = ab + ac. Factoring out a GCF reads that equation from right to left. You start with a sum of terms that share a piece, then pull that piece out in front and leave what remains inside parentheses.
6x^3 + 9x^2 = 3x^2(2x + 3)
Check: 3x^2 * 2x = 6x^3 and 3x^2 * 3 = 9x^2The shared piece 3x^2 is the GCF of 6x^3 and 9x^2. It is "greatest" because no larger monomial divides both terms evenly. If you pulled out only 3x, you would get 3x(2x^2 + 3x). That is a correct equation, but the factoring is not finished because the parentheses still share the factor x.
Finding the GCF of a set of terms
The GCF of several terms is a monomial built from two parts: a numeric part and a variable part.
- Numeric part. Take the largest positive integer that divides every coefficient. Ignore signs for this step.
- Variable part. Include a variable only if it appears in every term. Give it the smallest exponent it has in any term.
For 12a^3b^2, -18a^2b^3, and 30a^2b:
- The coefficients 12, 18, and 30 share the largest divisor 6.
- Both a and b appear in all three terms.
- The smallest exponent of a is 2, and the smallest exponent of b is 1.
- The GCF is 6a^2b.
The "smallest exponent" rule follows from the exponent rule for division. Dividing x^5 by x^2 leaves x^3, which is fine. Dividing x^2 by x^5 would leave a negative exponent, which is not a polynomial term. The smallest exponent is the largest power that divides every term cleanly.
You can compute this mechanically. The Python function below takes each term as a coefficient and a dictionary of variable exponents.
from math import gcd
from functools import reduce
def monomial_gcf(terms):
"""terms is a list of (coefficient, {variable: exponent}) pairs."""
coef = reduce(gcd, (abs(c) for c, _ in terms))
shared = set.intersection(*(set(v) for _, v in terms))
powers = {var: min(v[var] for _, v in terms) for var in sorted(shared)}
return coef, powers
terms = [
(12, {"a": 3, "b": 2}),
(-18, {"a": 2, "b": 3}),
(30, {"a": 2, "b": 1}),
]
print(monomial_gcf(terms))The program prints (6, {'a': 2, 'b': 1}), which matches the hand result 6a^2b. A variable missing from even one term is dropped, because the set intersection keeps only variables present in every term.
The procedure
Follow these steps in order.
- Find the GCF of all the terms.
- Divide each term by the GCF. Each quotient is a term inside the parentheses.
- Write the GCF, then the quotients in parentheses, keeping the original signs between them.
- Check by multiplying the GCF back through the parentheses.
Worked example with three terms and two variables
Factor 12a^3b^2 - 18a^2b^3 + 30a^2b. The GCF is 6a^2b, as found above. Divide each term:
12a^3b^2 / 6a^2b = 2ab
-18a^2b^3 / 6a^2b = -3b^2
30a^2b / 6a^2b = 5
12a^3b^2 - 18a^2b^3 + 30a^2b = 6a^2b(2ab - 3b^2 + 5)
Check: 6a^2b * 2ab = 12a^3b^2
6a^2b * (-3b^2) = -18a^2b^3
6a^2b * 5 = 30a^2bDividing the coefficients and subtracting the exponents of matching variables is all each division requires.
Edge cases
A term that equals the GCF leaves a 1
When a term is exactly the GCF, dividing gives 1, and the 1 must stay inside the parentheses.
4x^2 + 2x = 2x(2x + 1)
x^3 + x = x(x^2 + 1)If you wrote 2x(2x) for the first one, the check would give 4x^2 and lose the + 2x. The check step catches this error every time. A useful rule is that the parentheses must contain the same number of terms as the original polynomial.
Negative leading coefficients
When the first term is negative, it is conventional to factor out a negative GCF. That makes the first term inside the parentheses positive. Every sign inside the parentheses then flips relative to the original.
-4x^2 + 8x = -4x(x - 2)
Check: -4x * x = -4x^2 and -4x * (-2) = +8xBoth -4x(x - 2) and 4x(-x + 2) are correct. The first is preferred because the leading term inside is positive, which makes the later steps in this tutorial easier. Sign errors are the most common mistake here: forgetting to flip the second sign turns -4x(x + 2) into -4x^2 - 8x, which is wrong.
A constant term blocks variable factors
A variable counts as common only if every term contains it. In x^3 + x^2 + 5, the term 5 has no x, so no power of x can be pulled out. The GCF is 1, and the polynomial is already as factored as this step can make it.
The common factor can be a binomial
The GCF does not have to be a monomial. If the same parenthesized expression appears in every term, treat it as a single block and factor it out.
5(x + 2) + x(x + 2) = (x + 2)(5 + x)
3x(x - 4) - 2(x - 4) = (x - 4)(3x - 2)This is the move that completes factoring by grouping in the next chapter. Seeing that (x + 2) is a shared factor works exactly like seeing that 3x^2 is shared.
Opposite binomials
Sometimes the binomials differ only by sign, such as (x - 4) and (4 - x). Because 4 - x = -(x - 4), you can rewrite one to match the other.
2x(x - 4) + 3(4 - x)
= 2x(x - 4) - 3(x - 4)
= (x - 4)(2x - 3)Note how the plus sign in front of 3 became a minus when the negative was pulled out of (4 - x). Writing out the middle line prevents sign slips.
Factoring out the GCF can be the whole answer, or only the first step
After you pull out the GCF, look at what is left in the parentheses. Sometimes it can be factored further.
2x^3 - 8x = 2x(x^2 - 4) = 2x(x - 2)(x + 2)Here 2x is the GCF, but x^2 - 4 is a difference of squares and keeps factoring. "Factor completely" means continuing until no factor can be broken down further over the integers. The chapter on strategy covers this in full.
Common mistakes
| Mistake | Why it is wrong | Fix |
|---|---|---|
| 6x^3 + 9x^2 = 3x(2x^2 + 3x) | The GCF was not the greatest. Parentheses still share x. | Use the smallest exponent of each shared variable: 3x^2(2x + 3). |
| 4x^2 + 2x = 2x(2x) | The term equal to the GCF left a 1, which was dropped. | Write 2x(2x + 1). |
| -4x^2 + 8x = -4x(x + 2) | The sign of the second term was not flipped after factoring out a negative. | Divide 8x by -4x to get -2: -4x(x - 2). |
| x^3 + x^2 + 5 = x^2(x + 1 + 5) | The constant 5 has no x^2, so x^2 is not common. | The GCF is 1. Nothing can be pulled out. |
| 12x + 18 = 3(4x + 6) and stop | 3 is a common factor, but 6 is larger, so the parentheses still share a 2. | Use 6(2x + 3). |
Every one of these errors is caught by the check. Multiply the result out, and compare each term with the original.
Checking with software
A computer algebra system can confirm a hand factoring. SymPy's factor_terms pulls out common factors without factoring the remainder, which mirrors what this chapter teaches.
from sympy import symbols, factor_terms, expand
x = symbols("x")
expr = 6 * x**3 + 9 * x**2
factored = factor_terms(expr)
print(factored)
print(expand(factored) == expr)This prints 3*x**2*(2*x + 3) and then True. The expand(...) == expr comparison is the programmatic version of the multiply-back check. SymPy's factor function would go further and factor the remainder, which is useful later but can hide whether you found the GCF yourself.
Why this step comes first
Pulling out the GCF first shrinks the numbers and exponents you must handle in every later step. Compare factoring 3x^2 + 15x + 18 directly with factoring it after removing 3:
3x^2 + 15x + 18 = 3(x^2 + 5x + 6) = 3(x + 2)(x + 3)The trinomial x^2 + 5x + 6 has leading coefficient 1, so the simpler method from a later chapter applies. Without the GCF step, you would need the harder ac method for a leading coefficient of 3. Skipping the GCF also leaves a final answer that is not complete, because 3 is still a common factor of the terms in one of the answers you might otherwise accept.
Practice
Exercise
Factor 20x^4 - 30x^3 + 10x^2 by pulling out the greatest common factor, and verify by expanding.
Show answer
The coefficients 20, 30, and 10 share 10. The smallest exponent of x is 2. The GCF is 10x^2. Dividing gives 2x^2, -3x, and 1, so the result is 10x^2(2x^2 - 3x + 1). Check: 10x^2 2x^2 = 20x^4, 10x^2 (-3x) = -30x^3, and 10x^2 * 1 = 10x^2. The trinomial in parentheses can be factored further, which later chapters cover.
Exercise
Factor -9y^3 - 6y^2 so that the first term inside the parentheses is positive.
Show answer
Factor out the negative GCF -3y^2. Dividing -9y^3 by -3y^2 gives 3y, and dividing -6y^2 by -3y^2 gives 2. The result is -3y^2(3y + 2). Check: -3y^2 3y = -9y^3 and -3y^2 2 = -6y^2.
Exercise
Factor 2x(x - 5) + 7(5 - x).
Show answer
Rewrite 5 - x as -(x - 5), so 7(5 - x) = -7(x - 5). The expression becomes 2x(x - 5) - 7(x - 5). Factor out the common binomial: (x - 5)(2x - 7). Check: (x - 5)(2x - 7) = 2x^2 - 7x - 10x + 35 = 2x^2 - 17x + 35, and the original expands to 2x^2 - 10x + 35 - 7x = 2x^2 - 17x + 35.