Skip to content
ihateDesmos

Factoring calculator with steps

Type a polynomial in x and get it fully factored, with each step explained: the common factor, the special product it matches, the ac-method for trinomials, or the rational root test for cubics and beyond. Every answer is checked by multiplying the factors back out.

Factor
Result
(2x+1)(x+3)
Steps
  1. ac-method: find two numbers that multiply to a·c = 6 and add to b = 7: 1 and 6
  2. Split the middle term: 2x² + x + 6x + 3
  3. Factor each pair: x(2x + 1) + 3(2x + 1)
  4. (2x + 1) is a common factor: (2x + 1)(x + 3)
  5. Result: (2 x + 1) (x + 3)
Graph the polynomial and its roots

How to use it

  1. 1
    Type the polynomial with ^ for powers: x^2 - 5x + 6, 6x^3 - 4x^2, x^4 - 5x^2 + 4.
  2. 2
    Press Factor. The steps list each method in the order it was used, and the result is the complete factorization over the rational numbers.
  3. 3
    Use the link under the result to graph the polynomial: every linear factor (x − r) is a place where the graph crosses or touches the x-axis.

The methods, in the order to try them

Factoring is a search, and the order matters: always take out the common factor first, because it makes everything after it simpler. Then look for a pattern that matches the number of terms.

MethodPatternExample
Common factorevery term shares a factor6x³ − 4x² = 2x²(3x − 2)
Difference of squaresA² − B² = (A − B)(A + B)x² − 9 = (x − 3)(x + 3)
Perfect squareA² ± 2AB + B² = (A ± B)²x² + 6x + 9 = (x + 3)²
Simple trinomialx² + bx + c with p·q = c, p + q = bx² − 5x + 6 = (x − 2)(x − 3)
ac-methodax² + bx + c with a ≠ 12x² + 7x + 3 = (2x + 1)(x + 3)
Sum or difference of cubesA³ ± B³ = (A ± B)(A² ∓ AB + B²)x³ − 8 = (x − 2)(x² + 2x + 4)
Quadratic in x²ax⁴ + bx² + c, with u = x²x⁴ − 5x² + 4 = (x − 1)(x + 1)(x − 2)(x + 2)
Rational root testcubics and higherx³ − 6x² + 11x − 6 = (x − 1)(x − 2)(x − 3)

The ac-method, worked through

For a trinomial ax² + bx + c with a ≠ 1, guessing the two brackets gets slow. The ac-method turns it into a short search followed by grouping. Take 2x² + 7x + 3:

  1. Multiply a and c: a·c = 2 · 3 = 6.
  2. Find two numbers that multiply to 6 and add to b = 7: they are 1 and 6.
  3. Split the middle term with them: 2x² + x + 6x + 3.
  4. Group in pairs and factor each pair: x(2x + 1) + 3(2x + 1).
  5. The bracket is now a common factor: (2x + 1)(x + 3).

If no pair of whole numbers works, the trinomial doesn’t factor over the rationals. You can tell in advance from the discriminant b² − 4ac: the trinomial factors over the rationals exactly when the discriminant is a perfect square. Here it is 49 − 24 = 25 = 5².

The rational root test for cubics and beyond

For a polynomial with whole-number coefficients, any rational root p/q must have p dividing the constant term and q dividing the leading coefficient. That gives a short list of candidates to try. For x³ − 6x² + 11x − 6 the candidates are ±1, ±2, ±3 and ±6.

Substituting x = 1 gives 1 − 6 + 11 − 6 = 0, so (x − 1) is a factor. Synthetic division by (x − 1) leaves the quadratic x² − 5x + 6, which factors as (x − 2)(x − 3). Altogether, x³ − 6x² + 11x − 6 = (x − 1)(x − 2)(x − 3).

The calculator repeats this until what’s left is a quadratic, then finishes with the quadratic methods above.

When a polynomial won’t factor

Some polynomials have no rational factors. x² − 2 has roots ±√2, so over the real numbers it is (x − √2)(x + √2), but those aren’t rational. x² + 1 has no real roots at all, so it can’t be split into real linear factors either.

This calculator factors over the rational numbers, which is what “factor completely” means in most algebra courses. To find irrational or complex roots, use the equation solver or the quadratic equation solver.

Checking a factorization

Multiply the factors back out and you should get the original polynomial. The calculator does exactly that before showing any steps, so the explanation is always consistent with the answer.

A graph is a faster sanity check. The factored form shows where the polynomial is zero:

(x−1)(x−2)(x−3)
crosses the x-axis at 1, 2 and 3, and a squared factor like (x + 3)² touches the axis at −3 without crossing.

Examples to try

1234−220
Three rational roots
y = x^3 - 6x^2 + 11x - 6
(x − 1)(x − 2)(x − 3): the graph crosses the axis at each root.
Open this example
−6−4−250
A squared factor
y = x^2 + 6x + 9
(x + 3)²: a repeated root, where the graph touches the axis and turns back.
Open this example
−2−112−2240
A quadratic in x²
y = x^4 - 5x^2 + 4
(x − 1)(x + 1)(x − 2)(x + 2): four roots, symmetric about the y-axis.
Open this example

Frequently asked questions

Does the factoring calculator show steps?
Yes. It shows the common factor it takes out, the pattern it recognises (difference of squares, perfect square, sum or difference of cubes), the ac-method for trinomials, and the rational root test with synthetic division for higher degrees.
How do I factor a trinomial?
For x² + bx + c, find two numbers that multiply to c and add to b. For ax² + bx + c with a ≠ 1, use the ac-method: find two numbers that multiply to a·c and add to b, split the middle term with them, and factor by grouping.
How do I know if a quadratic can be factored?
Work out the discriminant b² − 4ac. If it is a perfect square (0, 1, 4, 9, 16, …), the quadratic factors over the rational numbers; if not, it doesn’t.
Can it factor cubic and quartic polynomials?
Yes. It uses sums and differences of cubes, substitution for quadratics in x², and the rational root test with synthetic division, then factors the remaining quadratic.
What does “factor over the rationals” mean?
The factors only use rational numbers as coefficients. x² − 2 is irreducible over the rationals even though it equals (x − √2)(x + √2) over the reals.

Related tools and guides

Factor inside the calculator

The Algebra tab factors, expands and solves any expression in the graph, with the same steps.

Open the calculator