Factoring calculator
Type a polynomial in x with whole-number coefficients, such as 2x^3 - 12x^2 + 22x - 12, or a product like (x+1)(x-2). The tool takes out the common factor and finds every rational root.
Runs in your browser: nothing you enter is sent anywhere.
How to use it
- Type the polynomial. Implicit multiplication works:
2x^2, 3(x+1).
- Read the factored form, the roots and the numbered steps.
- Compare the expanded form with what you typed to be sure it was read as you meant.
How it works
By the rational root theorem, any rational root p/q of an integer polynomial has p dividing the constant term and q dividing the leading coefficient. For every candidate the exact value q^n · P(p/q) is computed in integers; a zero means (qx − p) divides the polynomial, and the division is exact by Gauss’s lemma. The step repeats for multiple roots.
Worked example
2x³ − 12x² + 22x − 12. The common factor is 2, leaving x³ − 6x² + 11x − 6. The constant −6 has divisors 1, 2, 3, 6; x = 1, 2 and 3 are roots, so the result is 2(x − 1)(x − 2)(x − 3).
Tips
- Typing a product such as
(x+1)(x-2) shows its expansion, handy for checking homework.
- If the leftover factor is quadratic, the quadratic equation solver gives its irrational or complex roots.
Frequently asked questions
How does it find the factors?
It removes the greatest common divisor of the coefficients, then any power of x, then tests every rational number p/q where p divides the constant term and q divides the leading coefficient. Each root p/q gives a factor (qx − p), exactly, using big-integer arithmetic.
What is not covered?
Only factoring over the integers (rational roots). It does not find irrational or complex roots, and it does not look for products of higher-degree factors. It handles one variable only. A quadratic such as x² − 2 is reported as irreducible over the integers although its roots are ±√2.
Does it do difference of squares and perfect squares?
Yes, as a consequence of finding rational roots: x² − 9 becomes (x + 3)(x − 3) and x² + 6x + 9 becomes (x + 3)². Sums of squares like x² + 1 have no real roots and stay as they are.
Why is a minus sign put in front?
The leading coefficient of the linear factors is kept positive, so a negative leading coefficient is carried by the common factor: −x² + 1 becomes −(x + 1)(x − 1).