Factoring Calculator
Factors a polynomial step by step: common factor, difference of squares, perfect squares, cubes, grouping and the rational root theorem. Also finds prime factors.
What does the factoring calculator do?
It rewrites the polynomial you type as a product of simpler factors and shows which rule it used at every step. It takes out the common factor first and then tries the standard identities: difference of squares, perfect squares, sum of cubes and difference of cubes. For trinomials it looks for two numbers with the right product and sum, and for four terms it factors by grouping. When none of these apply it uses the rational root theorem, tests each candidate root and divides out the factor it finds. The second tab gives the prime factors of a whole number with the division steps.
Identities used
- Difference of squares: a² − b² = (a − b)(a + b)
- Perfect squares: a² + 2ab + b² = (a + b)² and a² − 2ab + b² = (a − b)²
- Sum of cubes: a³ + b³ = (a + b)(a² − ab + b²)
- Difference of cubes: a³ − b³ = (a − b)(a² + ab + b²)
- Trinomials: in x² + bx + c, if m and n multiply to c and add up to b, the result is (x + m)(x + n).
Example
Type x^2 - 5x + 6. The two numbers with product 6 and sum −5 are −2 and −3, so the result is (x − 2)(x − 3). Check by expanding: x² − 3x − 2x + 6 = x² − 5x + 6. When the leading coefficient is not 1, as in 6x^2 - 7x - 3, multiply 6 by −3 and look for two numbers with product −18 and sum −7, which are −9 and 2. Splitting the middle term with them and grouping gives (2x − 3)(3x + 1).
More than one letter
A common factor is taken out for any number of letters: 6x^2y + 9xy^2 becomes 3xy(2x + 3y). Two-letter expressions in which every term has the same degree are factored with the identities: x^2 - y^2, a^3 + b^3, x^2 + 5xy + 6y^2. Four-term expressions are tried by grouping: ax + ay + bx + by becomes (a + b)(x + y). Every letter is a separate variable, except e, which is read as Euler's number.
Reading the result
Factors are written with whole number coefficients and any fractional or negative common factor is placed in front. A factor marked as not factorable cannot be split further with rational coefficients, like x² + 1 or x² − 2. For polynomials in one letter the real roots are listed as well.
Limits
The tool works over the rational numbers: it does not split x² − 2 into (x − √2)(x + √2), although it lists the roots. For polynomials of degree four or higher with no rational root, factors with integer coefficients are found by a bounded search. If the search cannot be completed the tool says plainly that it could not decide whether the factor splits further. For several letters only the cases listed above are supported. The prime factor tab accepts whole numbers from 2 to 10¹⁵.
Related calculators
-
Mathematics
Equation Solver
Type an equation and see the roots step by step: linear, quadratic and cubic, discriminant, complex roots, numeric roots and systems in 2, 3 or 4 unknowns. -
Mathematics
Scientific Calculator
Type an expression and see the result at once: trigonometry, logarithms, powers, roots, factorials. Degree and radian modes, memory and history, all in your browser. -
Mathematics
Function Graph Plotter
Type f(x) and see its graph: several functions at once, zoom and pan, roots and intersection points. Download the graph as SVG or PNG. -
Mathematics
Derivative Calculator
Type a function and see its derivative step by step: sum, product, quotient and chain rules, a simplified result, the value at a point and a graph.
Found a mistake or something missing?
If a value looks wrong, a size is missing or you need a feature, write to us and we will fix it.