Factoring Calculator (Factor, Expand & Simplify)
Complete factorisation over the integers with named steps, plus expand and simplify.
Result
This is the last answer worked out. Fix the input above to update it.
General term
Sum of coefficients
Step-by-step
Why the factors stop here
Multiplied out
Excluded values
Full expansion
Pascal’s triangle
About the Factoring Calculator (Factor, Expand & Simplify)
Type a polynomial — 3x³ − 12x, 6x² + 11x + 3, ax + ay + bx + by, x⁴ + 4 — and get its complete factorisation over the integers, with the technique named at every step: common factor, grouping, difference of squares, perfect-square trinomial, splitting the middle term (AC method), sum or difference of cubes, adding and subtracting a square, and the rational root theorem. Several variables, fractions and repeated factors are handled.
The same page expands products (FOIL, special products and the binomial theorem), finds the general term, a particular term or coefficient, the middle terms and Pascal’s triangle for (a + b)ⁿ, and simplifies rational expressions by cancelling common factors or combining fractions over the lowest common denominator. Every factorisation is checked by multiplying it back out exactly, and everything runs in your browser.
How to use it
- Choose what to do: Factor, Expand / FOIL, Binomial (a + b)ⁿ or Simplify fraction.
- Type the expression with ^ for powers (x^2 or x²). Multiplication signs can be left out: 2xy, 3(x + 1), (x + 1)(x − 2).
- Press Enter or the main button (the result also updates as you type). For a binomial power you can also ask for a term number, or for the term with a given power of x — 0 finds the term independent of x.
- Read the result and the steps, each labelled with its technique. Copy or download the working as text.
Examples
3x³ − 12x
3x(x + 2)(x − 2)
3x³ − 12x = 3x(x² − 4) and x² − 4 = x² − 2² = (x − 2)(x + 2).
6x² + 11x + 3
(3x + 1)(2x + 3)
a·c = 18; 9 + 2 = 11 and 9 × 2 = 18, so 6x² + 9x + 2x + 3 = 3x(2x + 3) + 1(2x + 3).
ax + ay + bx + by
(a + b)(x + y)
x³ + 8
(x + 2)(x² − 2x + 4)
x⁴ + 4
(x² + 2x + 2)(x² − 2x + 2)
x⁴ + 4 = (x² + 2)² − (2x)², a difference of squares (the Sophie Germain identity).
x³ − 6x² + 11x − 6
(x − 1)(x − 2)(x − 3)
(x² + 1/x)⁹, power 0
T₇ = C(9, 6) = 84
T_(r+1) = C(9, r)·x^(18 − 3r), and 18 − 3r = 0 gives r = 6.
(x² − 1)/(x² + 2x + 1)
(x − 1)/(x + 1), x ≠ −1
Common uses
- Checking factorisation homework and seeing which technique the textbook expects at each step.
- Factoring cubic and quartic polynomials with the rational root theorem and synthetic division.
- Expanding products of brackets and binomial powers, or finding one coefficient without expanding everything.
- Simplifying algebraic fractions and adding fractions with different denominators.
How the factorisation is found and checked
The complete factorisation is computed by a factoriser over the integers: the polynomial is split into square-free parts, factored modulo a small prime (distinct-degree factorisation and Cantor–Zassenhaus splitting), the factors are lifted with Hensel lifting and recombined by trial division — the method described by von zur Gathen & Gerhard, Modern Computer Algebra (3rd ed.), chapter 15. Polynomials in several variables are reduced to one variable by Kronecker’s substitution (or, when every term has the same degree, by setting one variable to 1). The answer is then multiplied back out and compared with your polynomial exactly.
This matters: general-purpose JavaScript algebra libraries that we tested returned wrong factorisations of x¹² − 1, which is (x + 1)(x − 1)(x² + x + 1)(x² − x + 1)(x² + 1)(x⁴ − x² + 1).
The techniques, in the order they are tried
- Common factor: take out the greatest common factor of all terms, including powers of the variables (and −1 when the leading coefficient is negative).
- Difference of squares: a² − b² = (a − b)(a + b).
- Sum and difference of cubes: a³ + b³ = (a + b)(a² − ab + b²) and a³ − b³ = (a − b)(a² + ab + b²).
- Perfect-square trinomial: a² ± 2ab + b² = (a ± b)².
- Splitting the middle term (AC method): for ax² + bx + c, find two whole numbers with product ac and sum b; this also works for quadratics in disguise such as x⁴ − 5x² + 4 or 6x² + 11xy + 3y².
- Adding and subtracting a square: for x⁴ + 4 or x⁴ + x² + 1, complete a square and use the difference of squares.
- Grouping: for four terms, pair them so the brackets match; or group three terms into a perfect square and use the difference of squares.
- Rational root theorem: a rational root p/q has p dividing the constant term and q dividing the leading coefficient; each root r gives a factor (x − r) (factor theorem), found by synthetic division.
- General method: if the polynomial still splits but no pattern applies, the factors from the algorithm above are shown and the page says so.
The binomial theorem
(a + b)ⁿ = Σ C(n, r)·aⁿ⁻ʳ·bʳ for r = 0 … n, so the general term is T_(r+1) = C(n, r)·aⁿ⁻ʳ·bʳ (NCERT Class 11 Mathematics, Binomial Theorem). To find the term with a given power of x, write the power of x in the general term in terms of r and solve; if r is not a whole number from 0 to n, no such term exists. When n is even there is one middle term, T_(n/2 + 1); when n is odd there are two. Putting every variable equal to 1 gives the sum of the coefficients. The coefficients C(n, r) form row n of Pascal’s triangle.
Limitations
- Factorisation is over the integers (rational coefficients are allowed and taken out as a fraction). Factors with irrational or complex coefficients — such as x² − 2 = (x − √2)(x + √2) — are not produced; use the Equation Solver to find such roots.
- Up to 6 variables and powers up to 120. Very large polynomials in several variables can exceed the size limit; the page then says so.
- Simplify handles quotients and sums of polynomials (up to 4 variables). Roots, logarithms and trigonometric functions are not simplified.
- The binomial mode needs exactly two terms, each a single term such as 2x, −3y² or 1/x; use Expand for three or more terms.
Privacy
Everything happens in your browser. What you enter or open here is not uploaded or stored by MySmartCoPilot.
Frequently asked questions
How do I know when a polynomial is fully factored?
When none of its factors can be written as a product of polynomials of lower degree with integer coefficients. For a quadratic ax² + bx + c this happens exactly when b² − 4ac is not a perfect square; the tool explains why each remaining factor stops there. Every result is checked by multiplying it back out.
Which technique should I try first?
Always take out the common factor first. Then count the terms: two terms — difference of squares or sum/difference of cubes; three terms — perfect square or splitting the middle term; four terms — grouping. For cubics and higher, use the rational root theorem to find a linear factor.
Why does x² + 4 not factor?
A sum of two squares has no real roots — x² + 4 is never 0 for real x — so it has no linear factors with real coefficients. Over the complex numbers it is (x − 2i)(x + 2i). But some sums do factor: x⁴ + 4 = (x² + 2x + 2)(x² − 2x + 2).
What is the AC method?
To factor ax² + bx + c, multiply a and c, find two numbers whose product is ac and whose sum is b, split bx into two terms with those coefficients, and factor by grouping. For 6x² + 11x + 3: ac = 18, and 9 + 2 = 11, so 6x² + 9x + 2x + 3 = 3x(2x + 3) + 1(2x + 3) = (3x + 1)(2x + 3).
How do I find the term independent of x in a binomial expansion?
Write the general term T_(r+1) = C(n, r)·aⁿ⁻ʳ·bʳ, collect the powers of x, set the total power to 0 and solve for r. For (x² + 1/x)⁹ the power is 18 − 3r, so r = 6 and the term is C(9, 6) = 84. Choose Binomial, type the expression and enter 0 as the power of x.
Why does simplifying a fraction list excluded values?
Cancelling a common factor can hide a value where the original expression is undefined. (x² − 5x + 6)/(x² − 4) simplifies to (x − 3)/(x + 2), but the original is undefined at x = 2 as well as at x = −2, so the two are equal only for x ≠ 2 and x ≠ −2. The excluded values are those that make an original denominator 0.