Topic · Algebra

Factoring Techniques

A small, repeating toolbox. Almost every factoring problem you'll meet in algebra reduces to recognizing one of six or seven patterns — GCF, grouping, difference of squares, perfect-square trinomial, sum/difference of cubes, or the trinomial $ax^2 + bx + c$. The skill isn't memorizing the patterns; it's knowing which one to reach for first.

What you'll leave with

  • A decision flowchart that picks the right technique based on the number of terms.
  • The six core patterns — GCF, grouping, difference of squares, perfect-square trinomial, sum/difference of cubes, and the $ax^2 + bx + c$ trinomial — with the rule for each.
  • Two reliable methods for the general trinomial $ax^2 + bx + c$: inspection (for small numbers) and the AC method (for everything else).
  • A precise sense of when an expression is prime — irreducible over the integers — and when "fully factored" really means fully factored.

1. Why factor at all

Factoring is the reverse direction of expansion: take a sum and turn it into a product. That sounds like trivia until you remember a single algebraic fact — a product is zero if and only if one of its factors is zero. So the moment you write a polynomial as a product, its roots fall out for free:

$$ (x-2)(x+3) = 0 \quad\Longrightarrow\quad x = 2 \ \text{or}\ x = -3. $$

That one trick — the zero product property — is why every quadratic solver, every rational-expression simplification, and every partial-fraction decomposition in calculus eventually leans on factoring. Factored form also exposes structure: $a^2 - b^2 = (a-b)(a+b)$ encodes that two quantities square to the same value exactly when they differ by sign. Once you've internalized a handful of identities like that, algebra stops being arithmetic-with-letters and starts being pattern recognition.

The big idea

You don't memorize factorings. You memorize shapes. Every technique on this page is a way of recognizing one shape — number of terms, perfect powers, common factors — and pulling the matching identity off the shelf.

2. The decision flowchart

The single most useful thing on this page is this: a flowchart that tells you which technique to try first. Almost every factoring problem at this level can be solved by walking down it in order.

The flowchart hides one important rule: after every successful factoring, look at each new factor and start over from the top. A binomial that looked unfactorable at first glance may turn into a difference of squares once you've pulled out a GCF. Keep going until every factor is irreducible.

3. Step zero: GCF, always first

Greatest common factor (GCF)

The largest monomial that divides every term of the polynomial. To find it, take the GCD of the numerical coefficients and, for each variable, the lowest power that appears in any term.

The GCF is non-negotiable as a first move because every other technique works better — and sometimes only works — once the GCF is out. Forgetting it is the single most common reason for incomplete factorings.

For $12x^3 y - 18x^2 y^2 + 6xy^3$: the numerical GCD is $\gcd(12, 18, 6) = 6$; the lowest power of $x$ is $x^1$; the lowest power of $y$ is $y^1$. So the GCF is $6xy$, and

$$ 12x^3 y - 18x^2 y^2 + 6xy^3 \;=\; 6xy\,(2x^2 - 3xy + y^2). $$
Why this saves work

Try factoring $6x^2 + 15x + 9$ as a general trinomial directly — the AC method gives $ac = 54$ and you hunt for factors of 54 summing to 15. Pull the 3 out first and you're left with $3(2x^2 + 5x + 3)$, where $ac = 6$ and the search is over in seconds. Smaller numbers, fewer mistakes.

4. Factoring by grouping

When a polynomial has four (or more) terms and the standard patterns don't apply, try splitting it into groups that each have their own common factor.

The pattern

$ax + ay + bx + by = a(x + y) + b(x + y) = (a + b)(x + y)$

Group the terms in pairs. Factor a common factor out of each pair. If the leftover binomials match, factor that common binomial out.

Example: $x^3 + 2x^2 + 3x + 6$.

  1. Group: $(x^3 + 2x^2) + (3x + 6)$.
  2. Factor each group: $x^2(x + 2) + 3(x + 2)$.
  3. Both pieces share $(x+2)$. Pull it out: $(x^2 + 3)(x + 2)$.

Grouping has a quiet second life: it's also the engine inside the AC method for trinomials (§8). Once you've used it to split a middle term, you'll see it everywhere.

When grouping fails

If the two binomials don't match after step 2, the grouping was wrong — try rearranging the terms or pairing them differently. If no rearrangement produces matching binomials, the polynomial may simply not factor by grouping.

5. Difference of squares

The identity

$a^2 - b^2 = (a - b)(a + b)$

Recognize it when you have exactly two terms, both perfect squares, with a minus sign between them.

The tricky part is recognizing hidden squares. The following are all "perfect squares" for our purposes:

Looks likeIs the square of
$x^2$$x$
$4x^2$$2x$
$25y^6$$5y^3$
$x^4$$x^2$
$1$$1$

Examples:

  • $x^2 - 49 = (x - 7)(x + 7)$.
  • $4x^2 - 25 = (2x - 5)(2x + 5)$.
  • $x^4 - 16 = (x^2 - 4)(x^2 + 4) = (x - 2)(x + 2)(x^2 + 4)$ — keep factoring; $(x^2 - 4)$ was itself a difference of squares.
Sum of squares does not factor over $\mathbb{R}$

$a^2 + b^2$ has no real factorization. There is no real analogue of difference-of-squares for sums. Anyone "factoring" $x^2 + 9$ as $(x+3)(x-3)$ has made two mistakes at once — wrong sign in the original and wrong factorization to match.

6. Perfect-square trinomials

The identities

$a^2 + 2ab + b^2 = (a + b)^2$
$a^2 - 2ab + b^2 = (a - b)^2$

Three terms. First and last are perfect squares. Middle term is exactly $\pm 2$ times the product of their square roots.

The check is mechanical: look at the trinomial, compute $a = \sqrt{\text{first}}$ and $b = \sqrt{\text{last}}$, then verify the middle term equals $\pm 2ab$. If it does, you have a perfect square. If it doesn't, move on to the general trinomial methods.

Examples:

  • $x^2 + 10x + 25$: $a = x$, $b = 5$, check $2 \cdot x \cdot 5 = 10x$ ✓  →  $(x + 5)^2$.
  • $9x^2 - 24x + 16$: $a = 3x$, $b = 4$, check $2 \cdot 3x \cdot 4 = 24x$ ✓  →  $(3x - 4)^2$.
$a^2 - b^2$ vs $(a - b)^2$

These look similar but are entirely different beasts. $x^2 - 4 = (x-2)(x+2)$ is a difference of squares (two terms). $(x-2)^2 = x^2 - 4x + 4$ is a perfect-square trinomial (three terms). Don't confuse the count.

7. Sum and difference of cubes

The identities

$a^3 + b^3 = (a + b)(a^2 - ab + b^2)$
$a^3 - b^3 = (a - b)(a^2 + ab + b^2)$

Two terms, both perfect cubes. The sign in the binomial matches the original; the middle sign of the trinomial flips.

Memorize the cube list — it's short and it pays off forever: $1, 8, 27, 64, 125, 216, 343, 512, 729, 1000$. Also $x^3$, $(2x)^3 = 8x^3$, $(3x)^3 = 27x^3$, and so on.

Examples:

  • $x^3 + 8 = (x + 2)(x^2 - 2x + 4)$.
  • $x^3 - 27 = (x - 3)(x^2 + 3x + 9)$.
  • $8x^3 + 27 = (2x + 3)(4x^2 - 6x + 9)$ — here $a = 2x$, $b = 3$.
Mnemonic: "outer matches, inner flips"

The sign in the binomial factor matches the sign in the original. The sign in front of the $ab$ term in the trinomial factor is the opposite. The trinomial's $b^2$ is always positive. The quadratic factor never factors further over the reals — it's the "leftover" that finishes the job.

8. The general trinomial: inspection & AC method

For $ax^2 + bx + c$, two reliable methods cover everything. Use inspection when $a = 1$ and the numbers are small. Use the AC method when $a \neq 1$ or when inspection takes more than a few seconds.

Monic trinomials by inspection

For $x^2 + bx + c$ (leading coefficient 1), find two numbers $p$ and $q$ with

$$ p \cdot q = c \quad\text{and}\quad p + q = b. $$

Then the factorization is $(x + p)(x + q)$.

Example: $x^2 + 5x + 6$. Find two numbers multiplying to $6$ and adding to $5$: that's $2$ and $3$. So $(x + 2)(x + 3)$.

Example: $x^2 - 3x - 10$. Find two numbers multiplying to $-10$ and adding to $-3$: that's $-5$ and $2$. So $(x - 5)(x + 2)$.

General trinomials via the AC method

When $a \neq 1$, the trick is to widen the search: instead of looking for two numbers that multiply to $c$, look for two numbers that multiply to $ac$ and still sum to $b$. Then use those two numbers to split the middle term, and finish by grouping.

  1. Compute $ac$.
  2. Find $p, q$ with $pq = ac$ and $p + q = b$.
  3. Rewrite $bx$ as $px + qx$, splitting the middle term.
  4. Factor by grouping.

Example: $6x^2 + 11x - 10$.

  1. $ac = 6 \cdot (-10) = -60$.
  2. Two numbers with product $-60$ and sum $11$: that's $15$ and $-4$.
  3. Split: $6x^2 + 15x - 4x - 10$.
  4. Group: $3x(2x + 5) - 2(2x + 5) = (3x - 2)(2x + 5)$.
Sign discipline in the AC method

For $3x^2 - 11x + 6$: $ac = 18$. You need two numbers that multiply to $+18$ and sum to $-11$. Both must be negative: $-2$ and $-9$. Forgetting both signs is a classic mistake — the product determines the signs' relationship, the sum determines which one is bigger.

9. When an expression is prime

Prime (irreducible) polynomial

A polynomial is prime — or irreducible — over a chosen number system if it cannot be written as a product of two lower-degree polynomials with coefficients from that system. In elementary algebra the default is "over the integers" unless stated otherwise.

Some polynomials simply don't factor at the level you're working at. Two common reasons:

  • No integer pair exists. For $x^2 + x + 1$: you'd need $p, q$ with $pq = 1$ and $p + q = 1$. The only integer pair with product $1$ is $\{1, 1\}$ (sum 2) or $\{-1, -1\}$ (sum $-2$). Neither works. Irreducible over the integers — and over the reals too.
  • Sum of squares. $x^2 + 4$, $9x^2 + 25$, etc. No real factorization, period.

"Irreducible" depends on which number system you're allowed to use. $x^2 - 2$ is prime over the integers but factors as $(x - \sqrt{2})(x + \sqrt{2})$ over the reals. $x^2 + 1$ is prime over the reals but factors as $(x - i)(x + i)$ over the complex numbers. In this topic, "prime" means prime over the integers unless we say otherwise.

Note

The Fundamental Theorem of Algebra guarantees every non-constant polynomial factors completely into linear pieces over the complex numbers. So the question "does it factor?" is really "does it factor in the system I care about?" — and for everyday algebra that system is the integers.

10. Common pitfalls

Skipping the GCF

Attempting $6x^2 + 15x + 9$ directly as a trinomial is needlessly painful. Pull the 3 out first: $3(2x^2 + 5x + 3) = 3(2x + 3)(x + 1)$. The GCF is always the easiest step and almost always required.

Stopping too soon

$x^4 - 16 = (x^2 - 4)(x^2 + 4)$ — but $(x^2 - 4)$ is itself a difference of squares. The full factoring is $(x - 2)(x + 2)(x^2 + 4)$. Always look at every new factor and ask: "can this be factored further?"

Sign errors in monic trinomials

For $x^2 - x - 12$, the factors multiply to $-12$ and sum to $-1$. That's $-4$ and $3$ — not $4$ and $-3$. Check both conditions every time; one alone is not enough.

$a^3 + b^3 \neq (a + b)^3$

These look symmetric but aren't equal. $(a + b)^3 = a^3 + 3a^2b + 3ab^2 + b^3$. The actual factorization of $a^3 + b^3$ is $(a + b)(a^2 - ab + b^2)$. The middle term in the quadratic factor is the giveaway: it's $-ab$ (sum of cubes) or $+ab$ (difference of cubes), not a perfect-square term.

"Factoring" sum of squares

$x^2 + 9$ does not factor over the reals. Period. Anyone writing $(x+3)(x-3)$ has computed a difference of squares for the wrong sign and gotten an answer that doesn't even equal what they started with — expand it and you get $x^2 - 9$, not $x^2 + 9$.

11. Worked examples

Try each one before opening the solution. Focus on which step on the flowchart you'd land on first.

Example 1 · Factor $3x^2 + 15x + 12$ completely

GCF. $\gcd(3, 15, 12) = 3$, with no shared variable. Pull it out:

$$ 3x^2 + 15x + 12 = 3(x^2 + 5x + 4). $$

Inner trinomial. Three terms, $a = 1$. Find $p \cdot q = 4$ and $p + q = 5$: that's $1$ and $4$.

$$ = 3(x + 1)(x + 4). $$

Check. Expand: $3(x^2 + 5x + 4) = 3x^2 + 15x + 12$ ✓.

Example 2 · Factor $2x^3 - 18x$ completely

GCF. Both terms share $2x$:

$$ 2x^3 - 18x = 2x(x^2 - 9). $$

Inner binomial. Two terms, both perfect squares, minus sign — difference of squares.

$$ = 2x(x - 3)(x + 3). $$
Example 3 · Factor $6x^2 + 11x - 10$

No GCF. Three terms, $a = 6 \neq 1$ — use the AC method.

$ac = 6 \cdot (-10) = -60$. Find two numbers with product $-60$ and sum $11$: $15$ and $-4$.

Split: $6x^2 + 15x - 4x - 10$. Group: $3x(2x + 5) - 2(2x + 5) = (3x - 2)(2x + 5)$.

Example 4 · Factor $x^3 + 2x^2 + 3x + 6$

No GCF. Four terms — try grouping.

$$ (x^3 + 2x^2) + (3x + 6) = x^2(x + 2) + 3(x + 2) = (x^2 + 3)(x + 2). $$

$(x^2 + 3)$ is a sum of squares and doesn't factor further over the reals. Done.

Example 5 · Factor $x^4 - 5x^2 + 4$

Quadratic in disguise. The exponents are $4, 2, 0$ — substitute $u = x^2$:

$$ u^2 - 5u + 4 = (u - 1)(u - 4). $$

Back-substitute and keep factoring — each piece is a difference of squares:

$$ (x^2 - 1)(x^2 - 4) = (x - 1)(x + 1)(x - 2)(x + 2). $$
Example 6 · Factor $8x^3 + 27$

Two terms, both perfect cubes. $8x^3 = (2x)^3$, $27 = 3^3$. Sum of cubes:

$$ a^3 + b^3 = (a + b)(a^2 - ab + b^2) $$

with $a = 2x$, $b = 3$:

$$ 8x^3 + 27 = (2x + 3)(4x^2 - 6x + 9). $$

The quadratic factor $(4x^2 - 6x + 9)$ is prime over the reals — discriminant $36 - 144 < 0$.

Example 7 · Is $x^2 + x + 1$ factorable over the integers?

You need $p \cdot q = 1$ and $p + q = 1$. The integer pairs with product $1$ are $\{1, 1\}$ (sum 2) and $\{-1, -1\}$ (sum $-2$). Neither sums to $1$, so no integer factorization exists.

Conclusion: prime over the integers (and in fact prime over the reals — its discriminant is $1 - 4 = -3 < 0$).

Sources & further reading

The patterns and strategy above are standard across pre-college algebra; the canonical references below cover the same material with extra worked examples and exercises.

Test your understanding

A quiz that builds from easy to hard. Pick an answer to get instant feedback and a worked explanation. Your progress is saved in this browser — come back anytime to continue.

Question 1 of 24
0 correct