Factoring by Grouping

Factoring by grouping factors four-term polynomials by pairing terms and extracting common factors—use it when you cannot factor out a GCF from all terms.

ax+ay+bx+by=(a+b)(x+y)ax + ay + bx + by = (a + b)(x + y)

Solve a problem with Factoring by Grouping

Type the problem. The solver will use Factoring by Grouping where Factoring by Grouping is the right tool, and tell you when it is not.

Drag one in or paste from the clipboard. JPEG, PNG or WebP. You get the transcription to check before anything is solved.

How to get a better answer
  • Paste the whole problem, including the instruction word — "simplify", "solve for x" and "factor" lead to three different answers.
  • Say what you have already tried. "I got x = 4 and the book says 2" turns a solution into a diagnosis.
  • Set the level in the settings button. A calculus shortcut is not a better answer if you have not met derivatives yet.
  • For a photo, get the whole problem in frame and hold the page flat — you get the transcription to fix before anything is solved.

What each symbol means

What Factoring by Grouping takes
aa
bb
xx
yy
Factoring by Grouping
SymbolMeaning
aaA number, variable, or product that is the common factor in the first group of terms you create.
bbA number, variable, or product that is the common factor in the second group of terms; overlooking this shared factor breaks the method.
xxA number or variable that appears as a factor in multiple terms across both groups; if read as exclusive to one term, the binomial factor (x+y)(x+y) will not appear.
yyA number or variable that appears as a factor in multiple terms across both groups; confusing it with a term-specific factor prevents successful factorization.

When to use it

Reach for factoring by grouping when a four-term polynomial has no overall common factor but groups of terms do.

Level

Usually taught in: Algebra I

Worked examples

1. Factor a basic four-term polynomial

Problem

Factor x2+3x+2x+6x^2 + 3x + 2x + 6.
  1. (x2+3x)+(2x+6)(x^2 + 3x) + (2x + 6)

    We pair terms that we'll be able to factor separately.

  2. x(x+3)+2(x+3)x(x + 3) + 2(x + 3)

    From the first group, xx is the common factor; from the second group, 22 is the common factor.

  3. (x+3)(x+2)(x + 3)(x + 2)

    The binomial (x+3)(x+3) appears in both terms, so we factor it out to get the final factorization.

Answer: (x+3)(x+2)(x + 3)(x + 2)

This polynomial has four terms with no overall common factor across all terms, making factoring by grouping the ideal approach. By recognizing that certain pairs of terms share common factors, we can systematically extract them and arrive at the binomial factorization.

2. Factor with negative coefficients

Problem

Factor 2a22a3a+32a^2 - 2a - 3a + 3.
  1. (2a22a)+(3a+3)(2a^2 - 2a) + (-3a + 3)

    We separate the polynomial into two groups that we can factor individually.

  2. 2a(a1)3(a1)2a(a - 1) - 3(a - 1)

    From the first group, 2a2a is common; from the second group, 3-3 is common (which gives us the negative sign).

  3. (a1)(2a3)(a - 1)(2a - 3)

    The binomial (a1)(a-1) is the shared factor, so we factor it out as the first binomial in the answer.

Answer: (a1)(2a3)(a - 1)(2a - 3)

Even though some coefficients are negative, the factoring by grouping method still works: we treat the negative coefficient as part of the common factor for that group. This handles the signs correctly in a single, organized approach.

3. Model a coffee shop's quarterly revenue

Problem

A coffee shop's quarterly sales from two product lines can be modeled by the polynomial 2p2+6p+5p+152p^2 + 6p + 5p + 15, where pp is the number of promotional periods. Factor this expression.
  1. (2p2+6p)+(5p+15)(2p^2 + 6p) + (5p + 15)

    We pair the terms so that each group has a common factor.

  2. 2p(p+3)+5(p+3)2p(p + 3) + 5(p + 3)

    From the first group, 2p2p is the common factor; from the second group, 55 is the common factor.

  3. (p+3)(2p+5)(p + 3)(2p + 5)

    The binomial (p+3)(p+3) appears as a factor in both terms, so we factor it out to complete the factorization.

Answer: (p+3)(2p+5)(p + 3)(2p + 5)

Real-world models often produce four-term polynomials that naturally split into two groups. Factoring by grouping exposes the underlying structure: the binomial factor (p+3)(p+3) might represent a shared quantity (like a customer-count offset), while the other factor (2p+5)(2p+5) is a combined rate or volume.

Common mistakes

Where Factoring by Grouping usually goes wrong
Answer came out wrong
In x2+3x+2x+6x^2 + 3x + 2x + 6, a student groups it as (x2+2x)+(3x+6)(x^2 + 2x) + (3x + 6) instead of the correct grouping.
Group consecutive or strategic terms so that each group shares a common factor: (x2+3x)+(2x+6)(x^2 + 3x) + (2x + 6).
A student writes x(x+3)+2(x+3)x(x+3) + 2(x+3) and stops, or incorrectly simplifies to something like 3x(x+3)+2(x+3)3x(x+3) + 2(x+3).
Factor out the binomial: x(x+3)+2(x+3)=(x+3)(x+2)x(x+3) + 2(x+3) = (x+3)(x+2).
In 2a22a3a+32a^2 - 2a - 3a + 3, a student writes 2a(a1)+3(a1)2a(a - 1) + 3(a - 1), dropping the negative from 3a+3-3a + 3.
Carefully write 2a(a1)3(a1)2a(a - 1) - 3(a - 1) and then factor to (a1)(2a3)(a-1)(2a-3).
The mistakeWhy it is wrongThe fix
In x2+3x+2x+6x^2 + 3x + 2x + 6, a student groups it as (x2+2x)+(3x+6)(x^2 + 2x) + (3x + 6) instead of the correct grouping.This grouping does not create common factors that can be extracted from both resulting groups, so the pattern breaks.Group consecutive or strategic terms so that each group shares a common factor: (x2+3x)+(2x+6)(x^2 + 3x) + (2x + 6).
A student writes x(x+3)+2(x+3)x(x+3) + 2(x+3) and stops, or incorrectly simplifies to something like 3x(x+3)+2(x+3)3x(x+3) + 2(x+3).The method is incomplete without recognizing (x+3)(x+3) as the shared factor and using the distributive property to factor it out.Factor out the binomial: x(x+3)+2(x+3)=(x+3)(x+2)x(x+3) + 2(x+3) = (x+3)(x+2).
In 2a22a3a+32a^2 - 2a - 3a + 3, a student writes 2a(a1)+3(a1)2a(a - 1) + 3(a - 1), dropping the negative from 3a+3-3a + 3.When the leading term in the second group is negative, the common factor is also negative: 3(a1)-3(a-1), not +3(a1)+3(a-1).Carefully write 2a(a1)3(a1)2a(a - 1) - 3(a - 1) and then factor to (a1)(2a3)(a-1)(2a-3).

Tips and when to use something else

  • Factoring by grouping works only when the polynomial has exactly four terms and can be split into two pairs with a common factor in each pair. If you have fewer or more terms, or the terms don't have this structure, use a different method like Greatest Common Factor, Factoring Trinomials, or recognizing special patterns like Difference of Squares.
  • The order in which you group terms matters: choose your groups so that each pair has a true common factor. Trial and error may be needed if the grouping is not immediately obvious.
  • Always check your answer by multiplying the factors back to the original polynomial; this catches errors in grouping or factoring.
  • If no grouping of a four-term polynomial yields a common binomial factor, the polynomial may not be factorable using this method—try Factoring Trinomials or the Rational Root Theorem instead.

Frequently asked questions

Why don't all four-term polynomials factor by grouping?
Not every four-term polynomial has the structure needed for factoring by grouping. The terms must be arranged (or rearrangeable) so that exactly two pairs share a common factor each, and those two pairs share a common binomial. Some four-term polynomials factor using other methods, and some do not factor over the integers at all.
What if I rearrange the terms and then factor by grouping—is that allowed?
Yes, absolutely. You can rearrange the four terms into a different order before grouping, as long as you do not change signs (except when using properties like commutativity). Sometimes rearranging reveals the grouping structure more clearly.
Does factoring by grouping work for polynomials with more than four terms?
Yes, you can extend this idea to six-term or eight-term polynomials by creating more pairs or groups. For example, a six-term polynomial can be split into three pairs, each factored first, and then a common binomial extracted from all three results. However, the core idea remains: create groups with common factors, then find and extract the overall common factor.
What is the relationship between factoring by grouping and the distributive property?
Factoring by grouping is the reverse of the distributive property. The distributive property says a(x+y)+b(x+y)=(a+b)(x+y)a(x+y) + b(x+y) = (a+b)(x+y), which is exactly the pattern we use in factoring by grouping. By recognizing this pattern, we reverse the distributive property to go from a(x+y)+b(x+y)a(x+y) + b(x+y) back to (a+b)(x+y)(a+b)(x+y).

Need a different method?

The full solver is not scoped to one formula — type any problem and it will pick the method.

Open the math solver

Reviewed 2026-09-18