Algebra

Factoring Calculator

Enter a polynomial in x. The calculator pulls out the GCD of the coefficients, then uses the rational-root theorem to peel off linear factors (qx − p) one at a time. The output combines those factors with any leftover irreducible part of the polynomial.

Factoring Calculator

Factor a polynomial over the rationals into linear and irreducible factors.

Try:
Answer(x − 2)·(x − 3)
  1. Polynomialx² − 5x + 6
  2. Factored form(x − 2)·(x − 3)

Formula and method

f(x) = a·(x − r₁)(x − r₂)··· [if all roots rational] Rational-root candidates: p/q where p | constant term, q | leading coefficient

Extracts the integer GCD of all coefficients as a common scalar factor, then applies the rational-root theorem: any rational root p/q must have p dividing the constant term and q dividing the leading coefficient. Each root found is stripped as a linear factor (qx − p) by polynomial division, and the process repeats on the reduced quotient. The remainder after exhausting all rational roots is irreducible over the rationals and left as a single factor. Polynomials with no rational roots are returned unchanged with a clear explanation.

Worked examples

Frequently asked questions

Which polynomials can it factor?

Polynomials with integer (or convertible-to-integer) coefficients. Linear factors over the rationals are found via the rational-root theorem; any irreducible quadratic or higher remainder is left as a single factor.

Does it work for high-degree polynomials?

Yes, in principle. The rational-root search runs over divisors of the constant term and the leading coefficient, so the cost grows with their size.

What if there are no rational roots?

The polynomial is irreducible over the rationals and is returned unchanged. Use the Quadratic Equation Solver for irrational or complex roots.