Visual Tools
Calculators
Tables
Mathematical Keyboard
Converters
Other Tools


Factoring Polynomials






From Product to Pieces

Multiplying (x+2)(x+3)(x + 2)(x + 3) to get x2+5x+6x^2 + 5x + 6 is a mechanical process — distribute, combine, done. But going the other direction — starting with x2+5x+6x^2 + 5x + 6 and recovering the factors that built it — requires pattern recognition, strategy, and a toolkit of techniques that grows with the complexity of the polynomial.

That reverse process is factoring, and it underpins much of algebra. Solving polynomial equations, simplifying rational expressions, and analyzing how polynomials behave all depend on the ability to decompose a polynomial into simpler multiplicative pieces. The sections that follow develop the methods for doing so, from extracting common factors through recognizing special patterns to handling polynomials of any degree.



What is Factoring?

To factor a polynomial means to write it as a product of two or more polynomials of lower degree. The original polynomial and its factored form are equivalent expressions — they produce the same value for every input — but the factored form reveals structure that the expanded form conceals.

Consider x2+5x+6x^2 + 5x + 6. Written this way, the polynomial is a sum of three terms. Factored as (x+2)(x+3)(x + 2)(x + 3), the same expression becomes a product of two linear factors, making it immediately clear that the polynomial equals zero when x=2x = -2 or x=3x = -3. This connection between factors and roots is one of the main reasons factoring matters.

A polynomial is fully factored when none of its factors can be broken down further. The expression 2x(x29)2x(x^2 - 9) is not fully factored because x29x^2 - 9 splits into (x+3)(x3)(x + 3)(x - 3). The complete factorization is 2x(x+3)(x3)2x(x + 3)(x - 3).

What counts as "fully factored" depends on the number system in play. Over the integers, x2+1x^2 + 1 cannot be factored — no pair of integer-coefficient linear factors multiplies to give x2+1x^2 + 1. Over the reals, it remains irreducible for the same reason. Over the complex numbers, however, x2+1=(x+i)(xi)x^2 + 1 = (x + i)(x - i), and every polynomial of degree nn factors into exactly nn linear factors.

Greatest Common Factor (GCF)

The first step in any factoring problem is to check whether all terms share a common factor. The greatest common factor is the largest expression — including both numerical and variable parts — that divides evenly into every term of the polynomial.

For 6x3+9x23x6x^3 + 9x^2 - 3x, each term is divisible by 3x3x. Factoring it out gives 3x(2x2+3x1)3x(2x^2 + 3x - 1). The original three-term polynomial now appears as a product of a monomial and a simpler trinomial.

When variables carry different exponents, the GCF takes the lowest power present across all terms. In 4x2y+8xy24x^2y + 8xy^2, the numerical GCF is 44, the lowest power of xx is x1x^1, and the lowest power of yy is y1y^1, so the GCF is 4xy4xy. Factoring yields 4xy(x+2y)4xy(x + 2y).

Extracting the GCF should become automatic — it simplifies the remaining expression and often makes subsequent factoring steps far more manageable. A polynomial like 2x3+8x2+8x2x^3 + 8x^2 + 8x looks like a difficult cubic until the GCF of 2x2x is removed, leaving 2x(x2+4x+4)2x(x^2 + 4x + 4), which is a recognizable perfect square trinomial: 2x(x+2)22x(x + 2)^2.

Factoring by Grouping

When a polynomial has four or more terms and no single GCF spans all of them, grouping offers a path forward. The idea is to split the polynomial into pairs of terms, factor each pair separately, and then look for a common binomial factor across the groups.

Take x3+2x2+3x+6x^3 + 2x^2 + 3x + 6. Grouping the first two terms and the last two gives (x3+2x2)+(3x+6)(x^3 + 2x^2) + (3x + 6). Factoring each group produces x2(x+2)+3(x+2)x^2(x + 2) + 3(x + 2). The binomial (x+2)(x + 2) now appears in both pieces, so it factors out: (x2+3)(x+2)(x^2 + 3)(x + 2).

The method depends on the right grouping — and the original order of terms does not always produce one that works. Rearranging may be necessary. For ax+by+ay+bxax + by + ay + bx, the natural left-to-right pairing yields (ax+by)+(ay+bx)(ax + by) + (ay + bx), which leads nowhere useful. Rearranging to ax+bx+ay+byax + bx + ay + by and grouping as (ax+bx)+(ay+by)(ax + bx) + (ay + by) gives x(a+b)+y(a+b)=(x+y)(a+b)x(a + b) + y(a + b) = (x + y)(a + b).

Grouping also plays a role inside other techniques. The AC method for factoring trinomials with a leading coefficient other than 11 rewrites the middle term as two terms, creating a four-term polynomial that is then factored by grouping.

Factoring Trinomials — Simple Case

A trinomial of the form x2+bx+cx^2 + bx + c has a leading coefficient of 11, which makes the factoring process straightforward. The goal is to find two numbers mm and nn such that mn=cm \cdot n = c and m+n=bm + n = b. If such a pair exists, the trinomial factors as (x+m)(x+n)(x + m)(x + n).

For x2+7x+12x^2 + 7x + 12, the task is to find two numbers that multiply to 1212 and add to 77. The pair 33 and 44 satisfies both conditions: 34=123 \cdot 4 = 12 and 3+4=73 + 4 = 7. So x2+7x+12=(x+3)(x+4)x^2 + 7x + 12 = (x + 3)(x + 4).

The signs of bb and cc guide the search. When cc is positive and bb is positive, both numbers are positive. When cc is positive and bb is negative, both numbers are negative — for instance, x29x+20=(x4)(x5)x^2 - 9x + 20 = (x - 4)(x - 5) since (4)(5)=20(-4)(-5) = 20 and (4)+(5)=9(-4) + (-5) = -9. When cc is negative, the two numbers have opposite signs: x2+2x15=(x+5)(x3)x^2 + 2x - 15 = (x + 5)(x - 3) because 5(3)=155 \cdot (-3) = -15 and 5+(3)=25 + (-3) = 2.

Not every trinomial of this form factors over the integers. The polynomial x2+x+1x^2 + x + 1 requires two integers that multiply to 11 and add to 11 — no such pair exists. The discriminant b24cb^2 - 4c determines factorability: when it is a perfect square, the trinomial factors over the integers.

Factoring Trinomials — General Case

When the leading coefficient is not 11, the trinomial takes the form ax2+bx+cax^2 + bx + c and requires a more systematic approach. The AC method handles this by converting the problem into a grouping problem.

Multiply aa and cc to get the product acac. Then find two numbers mm and nn such that mn=acm \cdot n = ac and m+n=bm + n = b. Use these numbers to split the middle term into two terms, creating a four-term polynomial that can be factored by grouping.

For 6x2+11x+46x^2 + 11x + 4, compute ac=64=24ac = 6 \cdot 4 = 24. The pair 33 and 88 satisfies 38=243 \cdot 8 = 24 and 3+8=113 + 8 = 11. Rewrite the middle term: 6x2+3x+8x+46x^2 + 3x + 8x + 4. Group and factor: 3x(2x+1)+4(2x+1)=(3x+4)(2x+1)3x(2x + 1) + 4(2x + 1) = (3x + 4)(2x + 1).

The order in which the split terms are written does not affect the final result. Writing 6x2+8x+3x+46x^2 + 8x + 3x + 4 instead leads to 2x(3x+4)+1(3x+4)=(2x+1)(3x+4)2x(3x + 4) + 1(3x + 4) = (2x + 1)(3x + 4) — the same factors in a different order.

As with the simple case, the discriminant b24acb^2 - 4ac determines whether the trinomial factors over the integers. When b24acb^2 - 4ac is negative, the polynomial has no real roots and is irreducible over the reals.

Difference of Squares

The identity a2b2=(a+b)(ab)a^2 - b^2 = (a + b)(a - b) is one of the most frequently used factoring patterns. It applies whenever a polynomial consists of two perfect square terms separated by subtraction.

Recognizing perfect squares is the key skill. The term 9x29x^2 is (3x)2(3x)^2, the term 1616 is 424^2, and the term x4x^4 is (x2)2(x^2)^2. So 9x216=(3x+4)(3x4)9x^2 - 16 = (3x + 4)(3x - 4), and x41=(x2+1)(x21)=(x2+1)(x+1)(x1)x^4 - 1 = (x^2 + 1)(x^2 - 1) = (x^2 + 1)(x + 1)(x - 1) after factoring the second factor further.

The pattern extends to less obvious cases. The expression x25x^2 - 5 is a difference of squares if reals are permitted: x2(5)2=(x+5)(x5)x^2 - (\sqrt{5})^2 = (x + \sqrt{5})(x - \sqrt{5}). Over the integers alone, x25x^2 - 5 does not factor.

The sum of squares a2+b2a^2 + b^2 has no factorization over the real numbers. No real values of mm and nn satisfy (a+m)(a+n)=a2+b2(a + m)(a + n) = a^2 + b^2. Over the complex numbers, however, the factorization exists: a2+b2=(a+bi)(abi)a^2 + b^2 = (a + bi)(a - bi), using the fact that i2=1i^2 = -1.

Perfect Square Trinomials

Two closely related patterns arise when a binomial is squared:

a2+2ab+b2=(a+b)2a^2 + 2ab + b^2 = (a + b)^2


a22ab+b2=(ab)2a^2 - 2ab + b^2 = (a - b)^2


The test for a perfect square trinomial has three parts: the first term must be a perfect square, the last term must be a perfect square, and the middle term must equal twice the product of their square roots. If all three conditions hold, the trinomial is the square of a binomial.

For x2+10x+25x^2 + 10x + 25, the first term is x2x^2, the last is 525^2, and the middle term 10x=2x510x = 2 \cdot x \cdot 5. All conditions are met, so x2+10x+25=(x+5)2x^2 + 10x + 25 = (x + 5)^2.

For 4x212x+94x^2 - 12x + 9, the first term is (2x)2(2x)^2, the last is 323^2, and the middle term 12x=22x312x = 2 \cdot 2x \cdot 3. The subtraction sign carries through: 4x212x+9=(2x3)24x^2 - 12x + 9 = (2x - 3)^2.

A common error is assuming any trinomial with perfect square first and last terms must be a perfect square trinomial. The expression x2+7x+9x^2 + 7x + 9 has x2x^2 and 323^2 at the ends, but the middle term 7x7x does not equal 2x3=6x2 \cdot x \cdot 3 = 6x. This trinomial is not a perfect square.

Sum and Difference of Cubes

Two factoring identities handle cubic terms:

a3+b3=(a+b)(a2ab+b2)a^3 + b^3 = (a + b)(a^2 - ab + b^2)


a3b3=(ab)(a2+ab+b2)a^3 - b^3 = (a - b)(a^2 + ab + b^2)


Each factors a two-term cubic into a linear factor and a quadratic factor. The linear factor shares the same sign as the original expression. The quadratic factor follows the pattern: square the first term, take the opposite sign for the product term, then square the last term. The mnemonic SOAP — Same, Opposite, Always Positive — captures the sign sequence.

For x3+8x^3 + 8, recognize 8=238 = 2^3. The sum of cubes formula gives x3+23=(x+2)(x22x+4)x^3 + 2^3 = (x + 2)(x^2 - 2x + 4). The linear factor (x+2)(x + 2) takes the same sign as the original sum. The quadratic factor has a negative middle term (opposite) and a positive constant (always positive).

For 27x3127x^3 - 1, recognize 27x3=(3x)327x^3 = (3x)^3 and 1=131 = 1^3. The difference of cubes formula gives (3x1)(9x2+3x+1)(3x - 1)(9x^2 + 3x + 1). The linear factor takes the minus sign (same as the original difference), the middle term is positive (opposite), and the constant remains positive.

The quadratic factors a2ab+b2a^2 - ab + b^2 and a2+ab+b2a^2 + ab + b^2 that arise from these formulas are irreducible over the reals. Their discriminants are 3b2-3b^2 and 3b2-3b^2 respectively — both negative — so neither factors further into real linear terms.

Factoring Higher-Degree Polynomials

Polynomials of degree four and above often yield to the same techniques used on quadratics and cubics, provided the right structure is recognized.

A common pattern is the quadratic in disguise. The polynomial x4+5x2+6x^4 + 5x^2 + 6 contains only even powers of xx, which means substituting u=x2u = x^2 transforms it into u2+5u+6u^2 + 5u + 6. This factors as (u+2)(u+3)(u + 2)(u + 3), and substituting back gives (x2+2)(x2+3)(x^2 + 2)(x^2 + 3). Neither quadratic factor has real roots, so the factorization is complete over the reals.

Repeated application of earlier techniques handles layered structures. The polynomial x416x^4 - 16 is a difference of squares: (x2+4)(x24)(x^2 + 4)(x^2 - 4). The second factor is itself a difference of squares: (x2+4)(x+2)(x2)(x^2 + 4)(x + 2)(x - 2). The first factor x2+4x^2 + 4 is irreducible over the reals, so the process stops here.

Known roots provide another entry point. If rr is a root of a polynomial P(x)P(x), then (xr)(x - r) is a factor, and polynomial division produces the remaining quotient. For instance, if direct substitution shows that P(2)=0P(2) = 0, then (x2)(x - 2) divides P(x)P(x) evenly, and the quotient can be factored further using any applicable technique.

The Fundamental Theorem of Algebra guarantees that every polynomial of degree nn has exactly nn roots over the complex numbers, counted with multiplicity. This means complete factorization into linear factors is always possible in that setting.

Factoring Strategy

With multiple techniques available, a systematic approach prevents wasted effort and missed factors.

The first move is always to extract the greatest common factor. Even when a GCF seems small — a single factor of 22 or a lone xx — removing it simplifies everything that follows. Skipping this step is the most common source of incomplete factorizations.

Next, count the terms. A two-term polynomial calls for checking special patterns: difference of squares, sum or difference of cubes. A three-term polynomial is a candidate for trinomial factoring — simple case if the leading coefficient is 11, the AC method otherwise. A polynomial with four or more terms suggests grouping.

After each factoring step, examine every factor to determine whether it can be broken down further. The expression x481x^4 - 81 factors as (x2+9)(x29)(x^2 + 9)(x^2 - 9), but stopping here misses the difference of squares hiding in the second factor: (x2+9)(x+3)(x3)(x^2 + 9)(x + 3)(x - 3).

The final check is verification. Multiplying the factors back together must reproduce the original polynomial. This catches sign errors, arithmetic mistakes, and overlooked terms. If the product does not match, at least one factoring step contains an error.

Not every polynomial factors neatly over the integers. When no technique produces integer-coefficient factors, the polynomial may be irreducible over the integers — or it may factor over the reals or complex numbers using roots found through the quadratic formula or numerical methods.

Irreducible Polynomials

A polynomial is irreducible over a given number system when it cannot be written as a product of lower-degree polynomials with coefficients in that system. Irreducibility is not an absolute property — it depends entirely on what numbers are allowed.

The polynomial x22x^2 - 2 is irreducible over the integers because no pair of integer-coefficient linear factors produces it. Over the reals, it factors as (x+2)(x2)(x + \sqrt{2})(x - \sqrt{2}). The polynomial x2+1x^2 + 1 goes further: it is irreducible over both the integers and the reals, since its roots ±i\pm i are not real numbers. Over the complex numbers, it factors as (x+i)(xi)(x + i)(x - i).

The Fundamental Theorem of Algebra settles the question at the deepest level: every polynomial of degree n1n \geq 1 with complex coefficients factors completely into nn linear factors over the complex numbers. This means the only irreducible polynomials over the complex numbers are linear — degree 11.

Over the reals, the irreducible building blocks are linear polynomials and quadratic polynomials with negative discriminant (b24ac<0b^2 - 4ac < 0). Every real polynomial factors into a product of such pieces. Over the integers, identifying irreducibility is harder and no single test covers all cases, though the discriminant and the rational root theorem from the rules page offer useful starting points.

Common Mistakes

Certain errors appear repeatedly in factoring work, and awareness of them is the simplest way to avoid them.

Skipping the GCF check is the most frequent. The polynomial 3x312x3x^3 - 12x looks like it might require advanced techniques, but extracting 3x3x first gives 3x(x24)=3x(x+2)(x2)3x(x^2 - 4) = 3x(x + 2)(x - 2). Without that initial step, the factorization becomes unnecessarily difficult or incomplete.

Sign errors plague trinomial factoring. In x25x+6x^2 - 5x + 6, both numbers must be negative: (2)(3)=6(-2)(-3) = 6 and (2)+(3)=5(-2) + (-3) = -5. Writing (x+2)(x3)(x + 2)(x - 3) instead of (x2)(x3)(x - 2)(x - 3) gives a middle term of x-x, not 5x-5x. Verification by expanding catches this immediately.

Confusing the sum and difference of squares is another trap. The difference a2b2a^2 - b^2 factors as (a+b)(ab)(a + b)(a - b). The sum a2+b2a^2 + b^2 does not factor over the reals — attempting to write it as (a+b)(ab)(a + b)(a - b) produces a2b2a^2 - b^2, not a2+b2a^2 + b^2.

With cube formulas, the most common error is mishandling signs in the quadratic factor. For a3+b3=(a+b)(a2ab+b2)a^3 + b^3 = (a + b)(a^2 - ab + b^2), the middle term of the quadratic factor is ab-ab, not +ab+ab. Mixing this up produces an incorrect factorization that fails verification.

Stopping too early leaves factors on the table. After obtaining (x2+4)(x24)(x^2 + 4)(x^2 - 4) from x416x^4 - 16, the second factor is itself a difference of squares. Every factor must be inspected for further decomposition before the factorization is considered complete.