Skip to content

Factoring Calculator

Enter a polynomial and get its complete factorization over the integers, with each step written out: the greatest common factor, then difference of squares, perfect squares, sums and differences of cubes, the AC method for ax² + bx + c, grouping, or the rational root theorem. The factors are multiplied back out as a check, and a polynomial that cannot be factored is called prime. Free, no sign-up.

One letter, for example 6x^2 + x − 12, x^3 + 8 or 2x^3 − 3x^2 − 11x + 6. Powers use ^ or superscripts.

Try an example

Factored form

(3x − 4)(2x + 3)

Factorization

Factored completely

Status

Step by step

  1. AC method: multiply a × c = 6 × (−12) = −72. Find two numbers that multiply to −72 and add to b = 1: they are −8 and 9.

  2. Split the middle term using those two numbers.

    6x² + x − 12 = 6x² − 8x + 9x − 12

  3. Group the terms in pairs and take the common factor out of each pair.

    2x(3x − 4) + 3(3x − 4)

  4. Both pairs now share a bracket; factor it out.

    (3x − 4)(2x + 3)

Check by expanding

Multiplying the factors back out gives 6x² + x − 12, the polynomial you entered.

How to Use the Factoring Calculator

  1. 1. Type the polynomial. For example 6x^2 + x − 12 or x^3 + 8. Use one letter; powers can be written with ^ or as superscripts, and brackets are expanded first.
  2. 2. Read the factored form. It appears as a product, with repeated factors written as powers, and the calculator says whether the polynomial is prime.
  3. 3. Follow the steps. Each line names the method used and shows the polynomial before and after, in the order a teacher would try them.
  4. 4. Check. The factors are expanded and compared with what you typed.

The Order to Try Methods In

Look forPatternFactors as
A common factor in every termab + aca(b + c) — always first, including a minus sign if the leading term is negative
Two terms, both perfect squares, subtractedA² − B²(A − B)(A + B)
Two terms, both perfect cubesA³ + B³ or A³ − B³(A + B)(A² − AB + B²) or (A − B)(A² + AB + B²)
Three terms, first and last perfect squaresA² ± 2AB + B²(A ± B)²
Three terms, ax² + bx + cTwo numbers with product ac and sum bThe AC method, below
Four termsPairs share a bracketFactor by grouping
Anything elseA rational root p/qDivide out (qx − p) and repeat

The AC Method: 6x² + x − 12

  1. Multiply a and c. 6 × (−12) = −72.
  2. Find two numbers that multiply to −72 and add to b = 1: they are −8 and 9.
  3. Split the middle term. 6x² + x − 12 = 6x² − 8x + 9x − 12.
  4. Group and factor each pair. 2x(3x − 4) + 3(3x − 4).
  5. Factor out the shared bracket. (3x − 4)(2x + 3).

When a = 1 the method collapses to the familiar shortcut: for x² + 5x + 6 find two numbers with product 6 and sum 5 — 2 and 3 — and write (x + 2)(x + 3). If no such integer pair exists, the discriminant b² − 4ac is not a perfect square and the quadratic is prime over the integers.

Other Worked Examples

PolynomialMethodFactored form
12x³ − 27xGCF 3x, then difference of squares (2x)² − 3²3x(2x − 3)(2x + 3)
27x³ − 1Difference of cubes (3x)³ − 1³(3x − 1)(9x² + 3x + 1)
x³ + 2x² + 3x + 6Grouping: x²(x + 2) + 3(x + 2)(x + 2)(x² + 3)
2x³ − 3x² − 11x + 6Rational root x = 1/2, then the quadratic(x − 3)(2x − 1)(x + 2)
x⁴ + 4Two quadratics (Sophie Germain's identity)(x² − 2x + 2)(x² + 2x + 2)

What “Prime” Means Here

A polynomial is prime (or irreducible) over the integers when it cannot be written as a product of lower-degree polynomials with whole-number coefficients. x² + 4 and x² + x + 1 are prime. Prime is relative to the number system: x² − 2 is prime over the integers but factors as (x − √2)(x + √2) over the real numbers, and x² + 4 factors as (x − 2i)(x + 2i) over the complex numbers. This calculator factors over the rationals, which for whole-number polynomials gives the same result as factoring over the integers.

Limits

Quadratics and cubics are always factored completely. For degree 4 and above the calculator uses patterns, grouping, rational roots and a search for two quadratic factors. A factor that none of these splits is reported as left over, with a note, rather than called prime.

Common Mistakes

  • Skipping the GCF. 2x² + 10x + 12 is easier as 2(x² + 5x + 6) = 2(x + 2)(x + 3). Always take the common factor out first.
  • Sign errors in the AC step. If c is negative the two numbers have opposite signs; if c is positive they share a sign — the sign of b.
  • Trying to factor a sum of squares. x² + 9 is prime over the integers; only a difference of squares factors.
  • Mixing up the cube formulas. The middle sign of the second bracket is always the opposite of the sign in the first: A³ + B³ = (A + B)(A² − AB + B²) and A³ − B³ = (A − B)(A² + AB + B²).
  • Stopping early. x⁴ − 16 = (x² − 4)(x² + 4) is not finished: x² − 4 factors again.

Frequently Asked Questions

How do you factor a trinomial ax² + bx + c?
Use the AC method. Multiply a and c, find two numbers that multiply to ac and add to b, split the middle term with them, factor each pair, and take out the shared bracket. When a = 1 you only need two numbers with product c and sum b.
What is the difference of squares formula?
A² − B² = (A − B)(A + B). It applies when a binomial is a perfect square minus a perfect square, such as 9x² − 25 = (3x − 5)(3x + 5). A sum of squares such as x² + 25 does not factor over the integers.
What are the sum and difference of cubes formulas?
A³ + B³ = (A + B)(A² − AB + B²) and A³ − B³ = (A − B)(A² + AB + B²). For 27x³ − 1, A = 3x and B = 1, so it factors as (3x − 1)(9x² + 3x + 1).
How do I know if a polynomial is prime?
For a quadratic, check the discriminant b² − 4ac: if it is not a perfect square, there are no rational roots and the quadratic is prime over the integers. A cubic is prime when it has no rational root. For higher degrees, no simple test exists.
What is factoring by grouping?
For four terms, split them into two pairs, take the greatest common factor out of each, and if the brackets match, factor the bracket out. x³ + 2x² + 3x + 6 becomes x²(x + 2) + 3(x + 2) = (x + 2)(x² + 3).
Why is the common factor negative sometimes?
When the leading coefficient is negative the calculator takes out a negative common factor, so the polynomial inside the bracket starts positive. −2x² + 8 becomes −2(x² − 4) = −2(x − 2)(x + 2). Either convention is correct; check which your course expects.
Can I check a factorization myself?
Yes, multiply the factors back out. If you get the original polynomial, the factorization is right. The calculator does this for you in the final check.

Related Tools

More in Math Calculators

See all Math Calculators