Factor by Grouping Calculator

All steps are free — no sign-up, no paywall.

Integer coefficients · degree ≤4 · up to 2 of x/y/z/w/p/c/d · + − * ^ ( )

Examples & math keys

Use ^ for powers; 5x works too. Limits: 220 characters and coefficient magnitude up to 1 trillion.

Worked example

FACTORED FORM
(x-7)*(4*x+5)*(4*x-5)

from 16*x^3-112*x^2-25*x+175

✓ Checked

Show steps

Grouping + Difference of squares

  1. Group terms with a common factor

    16*x^3-112*x^2-25*x+175 = (16*x^3-112*x^2)+(-25*x+175)

    Choose two pairs so that factoring each pair leaves the same expression.

  2. Factor each group

    16*x^2*(x-7)+(-25)*(x-7)

    Each group has its own greatest common factor; the remaining expressions match.

  3. Take out the common expression

    16*x^3-112*x^2-25*x+175 = (x-7)*(16*x^2-25)

    A*B+C*B=(A+C)*B is the distributive property in reverse.

  4. Recognize a prime linear polynomial

    x-7

    A linear polynomial with no integer common factor cannot split into lower-degree polynomial factors.

  5. Recognize a difference of squares

    16*x^2-25 = (4*x)^2-(5)^2

    Both terms are perfect squares, and they are subtracted: A^2-B^2=(A+B)(A-B).

  6. Multiply the conjugate factors

    16*x^2-25 = (4*x+5)*(4*x-5)

    The cross terms cancel when a sum and a difference are multiplied.

  7. Recognize a prime linear polynomial

    4*x+5

    A linear polynomial with no integer common factor cannot split into lower-degree polynomial factors.

  8. Recognize a prime linear polynomial

    4*x-5

    A linear polynomial with no integer common factor cannot split into lower-degree polynomial factors.

  9. Put the factors together

    (x-7)*(4*x+5)*(4*x-5)

    Combine the factors obtained in the preceding steps. Repeated factors are written as powers.

  10. Check by expanding

    (x-7)*(4*x+5)*(4*x-5) = 16*x^3-20*x^2+20*x^2-25*x-112*x^2+140*x-140*x+175 = 16*x^3-112*x^2-25*x+175

    Expanding and collecting like terms reproduces the original polynomial, so the factorization is equal to the input. ✓

How to Factor by Grouping

Start by taking out any factor common to the whole expression. For four remaining terms, arrange two pairs and extract each pair’s greatest common factor. If the two remainders match, take that shared expression outside another set of parentheses. This reverses the distributive property: AB + CB = (A + C)B.

Keep a minus sign with its term. A negative common factor changes every sign inside its group. If the first pairing does not work, check the other two pairings. Finally, factor any remaining difference of squares or repeated factor and multiply everything back to verify the original expression.

Common mistakes

  • Losing the third term’s minus sign: Keep the sign attached when making groups. Taking out −5 from −5x + 10 leaves x − 2, not x + 2.
  • Missing the whole-expression GCF: Extract it before splitting the terms into pairs, and keep it in the final answer.
  • Stopping after one pairing: Four terms have three possible pairings. A different arrangement may expose a common binomial.
  • Stopping too soon: A grouped result can still contain a difference of squares. Finish factoring each part, then expand every factor to check all coefficients and signs.

FAQ

How do you factor by grouping?

Take out the whole-expression GCF, then split four terms into two pairs. Factor each pair and look for the same remaining binomial; take it out and check whether either factor can split again.

What if the groups have opposite signs?

Take a negative factor out of one group so the remainders match. Change every sign inside that group, then multiply back to check the step.

Does grouping work for every polynomial?

No; a failed pairing does not prove that a polynomial is prime. This tool checks alternative pairings and uses an exact factoring check when another method is needed, explaining the method actually used.

Worked examples with steps

16x^3-112x^2-25x+175

FACTORED FORM
(x-7)*(4*x+5)*(4*x-5)

from 16*x^3-112*x^2-25*x+175

✓ Checked

Show steps

Grouping + Difference of squares

  1. Group terms with a common factor

    16*x^3-112*x^2-25*x+175 = (16*x^3-112*x^2)+(-25*x+175)

    Choose two pairs so that factoring each pair leaves the same expression.

  2. Factor each group

    16*x^2*(x-7)+(-25)*(x-7)

    Each group has its own greatest common factor; the remaining expressions match.

  3. Take out the common expression

    16*x^3-112*x^2-25*x+175 = (x-7)*(16*x^2-25)

    A*B+C*B=(A+C)*B is the distributive property in reverse.

  4. Recognize a prime linear polynomial

    x-7

    A linear polynomial with no integer common factor cannot split into lower-degree polynomial factors.

  5. Recognize a difference of squares

    16*x^2-25 = (4*x)^2-(5)^2

    Both terms are perfect squares, and they are subtracted: A^2-B^2=(A+B)(A-B).

  6. Multiply the conjugate factors

    16*x^2-25 = (4*x+5)*(4*x-5)

    The cross terms cancel when a sum and a difference are multiplied.

  7. Recognize a prime linear polynomial

    4*x+5

    A linear polynomial with no integer common factor cannot split into lower-degree polynomial factors.

  8. Recognize a prime linear polynomial

    4*x-5

    A linear polynomial with no integer common factor cannot split into lower-degree polynomial factors.

  9. Put the factors together

    (x-7)*(4*x+5)*(4*x-5)

    Combine the factors obtained in the preceding steps. Repeated factors are written as powers.

  10. Check by expanding

    (x-7)*(4*x+5)*(4*x-5) = 16*x^3-20*x^2+20*x^2-25*x-112*x^2+140*x-140*x+175 = 16*x^3-112*x^2-25*x+175

    Expanding and collecting like terms reproduces the original polynomial, so the factorization is equal to the input. ✓

9x^3-54x^2-4x+24

FACTORED FORM
(x-6)*(3*x+2)*(3*x-2)

from 9*x^3-54*x^2-4*x+24

✓ Checked

Show steps

Grouping + Difference of squares

  1. Group terms with a common factor

    9*x^3-54*x^2-4*x+24 = (9*x^3-54*x^2)+(-4*x+24)

    Choose two pairs so that factoring each pair leaves the same expression.

  2. Factor each group

    9*x^2*(x-6)+(-4)*(x-6)

    Each group has its own greatest common factor; the remaining expressions match.

  3. Take out the common expression

    9*x^3-54*x^2-4*x+24 = (x-6)*(9*x^2-4)

    A*B+C*B=(A+C)*B is the distributive property in reverse.

  4. Recognize a prime linear polynomial

    x-6

    A linear polynomial with no integer common factor cannot split into lower-degree polynomial factors.

  5. Recognize a difference of squares

    9*x^2-4 = (3*x)^2-(2)^2

    Both terms are perfect squares, and they are subtracted: A^2-B^2=(A+B)(A-B).

  6. Multiply the conjugate factors

    9*x^2-4 = (3*x+2)*(3*x-2)

    The cross terms cancel when a sum and a difference are multiplied.

  7. Recognize a prime linear polynomial

    3*x+2

    A linear polynomial with no integer common factor cannot split into lower-degree polynomial factors.

  8. Recognize a prime linear polynomial

    3*x-2

    A linear polynomial with no integer common factor cannot split into lower-degree polynomial factors.

  9. Put the factors together

    (x-6)*(3*x+2)*(3*x-2)

    Combine the factors obtained in the preceding steps. Repeated factors are written as powers.

  10. Check by expanding

    (x-6)*(3*x+2)*(3*x-2) = 9*x^3-6*x^2+6*x^2-4*x-54*x^2+36*x-36*x+24 = 9*x^3-54*x^2-4*x+24

    Expanding and collecting like terms reproduces the original polynomial, so the factorization is equal to the input. ✓

x^3+2x^2+x+2

FACTORED FORM
(x+2)*(x^2+1)

from x^3+2*x^2+x+2

✓ Checked

Show steps

Grouping

  1. Group terms with a common factor

    x^3+2*x^2+x+2 = (x^3+2*x^2)+(x+2)

    Choose two pairs so that factoring each pair leaves the same expression.

  2. Factor each group

    x^2*(x+2)+(1)*(x+2)

    Each group has its own greatest common factor; the remaining expressions match.

  3. Take out the common expression

    x^3+2*x^2+x+2 = (x+2)*(x^2+1)

    A*B+C*B=(A+C)*B is the distributive property in reverse.

  4. Recognize a prime linear polynomial

    x+2

    A linear polynomial with no integer common factor cannot split into lower-degree polynomial factors.

  5. Check whether rational factors exist

    D=(0)^2-4*(1)*(1)=-4

    The discriminant is negative, so this quadratic has no real linear factors and therefore no rational linear factors.

  6. Put the factors together

    (x+2)*(x^2+1)

    Combine the factors obtained in the preceding steps. Repeated factors are written as powers.

  7. Check by expanding

    (x+2)*(x^2+1) = x^3+x+2*x^2+2 = x^3+2*x^2+x+2

    Expanding and collecting like terms reproduces the original polynomial, so the factorization is equal to the input. ✓

-12p^3+21p^2

FACTORED FORM
3*p^2*(-4*p+7)

from -12*p^3+21*p^2

✓ Checked

Show steps

GCF

  1. Take out the greatest common factor

    -12*p^3+21*p^2 = 3*p^2*(-4*p+7)

    Use the positive GCF and divide every term by it. A negative term keeps its sign inside the parentheses.

  2. Check the remaining linear factor

    -4*p+7

    The remaining coefficients have GCF 1, and a linear factor cannot split into lower-degree polynomial factors.

  3. Check by expanding

    3*p^2*(-4*p+7) = -12*p^3+21*p^2

    Expanding and collecting like terms reproduces the original polynomial, so the factorization is equal to the input. ✓