Factor by Grouping Calculator

Factoring by grouping is one of the most important techniques in algebra — used in high school math across the US, UK, Canada, and Australia, and tested on the SAT, ACT, GCSE, A-Level, and college entrance exams worldwide. This free calculator factors both trinomials (ax² + bx + c) and four-term polynomials (ax³ + bx² + cx + d) using the grouping method, and shows every step so you can learn the process, not just get the answer.

Quick Answer — How Factoring by Grouping Works
Trinomial ax² + bx + c: Find p, q where p·q = ac and p+q = b → split bx → group → factor GCF from each pair → factor common binomial.
Four-term ax³ + bx² + cx + d: Group into two pairs → factor GCF from each → factor the common binomial factor.
Use the calculator below — enter your coefficients, pick a mode, and get step-by-step results instantly.
▼ Factor by Grouping — choose your polynomial type

Enter coefficients for ax² + bx + c. The AC method will be used to split the middle term, then factor by grouping.

Coefficient a (of x²):
cannot be 0
Coefficient b (of x):
Coefficient c (constant):

Example: 6x² + 11x + 4 → a=6, b=11, c=4

Enter coefficients for ax³ + bx² + cx + d. The calculator will try standard grouping and alternate grouping.

Coefficient a (of x³):
Coefficient b (of x²):
Coefficient c (of x):
Coefficient d (constant):

Example: 2x³ + 6x² + x + 3 → a=2, b=6, c=1, d=3

Factored Form:
Step-by-Step Solution:

What Is Factoring by Grouping?

Factoring by grouping is an algebraic technique that reverses the process of polynomial multiplication. When you expand (x + 3)(2x² + 1), you get 2x³ + x + 6x² + 3 — a four-term polynomial. Factoring by grouping is how you work backwards from that four-term expression to recover the original product of two factors.

The core idea is simple: split the polynomial into two or more groups, factor the Greatest Common Factor (GCF) out of each group separately, and then recognise the common binomial that appears in all groups — and factor it out as well. The result is a factored product.

  • Works on polynomials with 4 terms (and sometimes 6 terms with three pairs)
  • Also works on trinomials ax² + bx + c via the AC method to create 4 terms first
  • Taught in Algebra 1, Algebra 2, and Pre-Calculus across US, UK, Canada, Australia
  • Required for SAT, ACT, GCSE, A-Level, IB, and AP Calculus prerequisite topics
  • The result always multiplies back to the original polynomial — check by expanding

When to Use the Grouping Method

Not every polynomial can or should be factored by grouping. Here is when it applies:

  • Four-term polynomials: Grouping is usually the first method to try when a polynomial has exactly four terms and no overall pattern like difference of squares.
  • Trinomials where a ≠ 1: When ax² + bx + c has a leading coefficient other than 1, simple inspection doesn't work — the AC method uses grouping to handle these.
  • After factoring out the GCF: Once you've divided out the common factor, the remaining polynomial often has four terms suited for grouping.
  • When synthetic division or the quadratic formula would be overkill: Grouping gives an exact integer factorisation without trial and error, when integer factors exist.
When NOT to use grouping: If the polynomial is a difference of squares (a² − b²), a perfect square trinomial (a² + 2ab + b²), or a sum/difference of cubes (a³ ± b³), use those specific patterns instead — they are faster and always work for those forms.

Step 0 — Always Factor Out the Overall GCF First

Before attempting any grouping, check whether all terms share a common factor (a number, a variable, or both). Factoring out the GCF first makes every subsequent step easier and avoids carrying unnecessary large numbers through the grouping process.

EXAMPLE — Factor the overall GCF first 4x³ + 8x² + 6x + 12

GCF of 4, 8, 6, 12 is 2. Factor it out:
= 2(2x³ + 4x² + 3x + 6)

Now factor the bracket by grouping:
= 2[ (2x³ + 4x²) + (3x + 6) ]
= 2[ 2x²(x + 2) + 3(x + 2) ]
= 2(x + 2)(2x² + 3)

If you had skipped the GCF step, you would have worked with larger numbers throughout and risked missing a factor of 2 at the end. Always factor the GCF first — it's not optional.

Factoring Trinomials by Grouping (AC Method)

When you have a trinomial ax² + bx + c where a ≠ 1, use the AC method to convert it into a four-term polynomial, then factor by grouping. This is the standard approach taught in algebra courses in the United States, United Kingdom, Canada, and most international curricula.

THE AC METHOD — 6 STEPS Given: ax² + bx + c

Step 1. Multiply a × c. Call the result the target product.
Step 2. Find two integers p and q such that: p × q = ac and p + q = b
Step 3. Rewrite bx as px + qx: ax² + px + qx + c
Step 4. Group: (ax² + px) + (qx + c)
Step 5. Factor GCF from each group: x(ax + p) + ... (adjust signs as needed)
Step 6. Factor out the common binomial. Done.
WORKED EXAMPLE 1 — 6x² + 11x + 4 a = 6, b = 11, c = 4
Step 1. ac = 6 × 4 = 24
Step 2. Find p, q: p × q = 24 and p + q = 11
  Try pairs: 1×24=24 (sum 25), 2×12=24 (sum 14), 3×8=24 (sum 11) ✓
  So p = 3, q = 8 (or p = 8, q = 3 — either works)
Step 3. Rewrite: 6x² + 3x + 8x + 4
Step 4. Group: (6x² + 3x) + (8x + 4)
Step 5. Factor GCF from each:
  3x(2x + 1) + 4(2x + 1)
Step 6. Common binomial is (2x + 1):
  = (2x + 1)(3x + 4)

Check: (2x + 1)(3x + 4) = 6x² + 8x + 3x + 4 = 6x² + 11x + 4 ✓
WORKED EXAMPLE 2 — 2x² − 7x + 3 a = 2, b = −7, c = 3
Step 1. ac = 2 × 3 = 6
Step 2. Find p, q: p × q = 6 and p + q = −7
  Both must be negative (product positive, sum negative): p = −6, q = −1
  (−6)(−1) = 6 ✓ and (−6) + (−1) = −7 ✓
Step 3. Rewrite: 2x² − 6x − x + 3
Step 4. Group: (2x² − 6x) + (−x + 3)
Step 5. Factor GCF: 2x(x − 3) − 1(x − 3)
Step 6. Factor binomial: (x − 3)(2x − 1)
SIGN WARNING When the last group has a negative GCF, be careful: factoring −1 from (−x + 3) gives −1(x − 3), not −1(x + 3). Always distribute back to verify the sign matches the original term.

Factoring Four-Term Polynomials by Grouping

For a polynomial with exactly four terms — most commonly of the form ax³ + bx² + cx + d — factor by grouping directly without needing the AC method first.

FOUR-TERM METHOD — 5 STEPS Given: ax³ + bx² + cx + d

Step 1. Factor out any overall GCF (if none, skip).
Step 2. Group: (ax³ + bx²) + (cx + d)
Step 3. Factor GCF from first pair: x²(ax + b)
Step 4. Factor GCF from second pair: look for a number or variable that divides cx and d.
Step 5. If both groups contain the same binomial (ax + b), factor it out.
WORKED EXAMPLE 3 — 2x³ + 6x² + x + 3 Step 1. No overall GCF.
Step 2. Group: (2x³ + 6x²) + (x + 3)
Step 3. GCF of first pair: 2x²
  2x²(x + 3) + (x + 3)
Step 4. GCF of second pair: 1 (nothing to factor out, keep as is)
Step 5. Common binomial is (x + 3):
  = (x + 3)(2x² + 1)
WORKED EXAMPLE 4 — 3x³ − 2x² + 9x − 6 Step 1. No overall GCF.
Step 2. Group: (3x³ − 2x²) + (9x − 6)
Step 3. GCF of first pair: x²
  x²(3x − 2) + (9x − 6)
Step 4. GCF of second pair: 3
  x²(3x − 2) + 3(3x − 2)
Step 5. Common binomial is (3x − 2):
  = (3x − 2)(x² + 3)

Alternate Groupings — When the First Try Fails

Standard grouping (first two + last two) does not always work. If you factor GCF from each pair and they do not share a common binomial, try rearranging the terms and grouping differently. There are two other standard arrangements to try:

  • Arrangement 2: Group as (ax³ + cx) + (bx² + d) → factor x from first pair: x(ax² + c), then find GCF of second pair and check for common factor.
  • Arrangement 3: Group as (ax³ + d) + (bx² + cx) → less common, but worth trying if others fail.
WORKED EXAMPLE — Alternate grouping x³ + 2x² + 3x + 6

Standard grouping: (x³ + 2x²) + (3x + 6)
  = x²(x + 2) + 3(x + 2)
  = (x + 2)(x² + 3) ✓ — works first try!

x³ + 3x² + 2x + 6 — same structure, works the same way:
  = x²(x + 3) + 2(x + 3) = (x + 3)(x² + 2)
IMPORTANT If all three grouping arrangements fail to produce a common binomial factor, the polynomial may be prime over the integers — meaning it cannot be factored using integer coefficients. In that case, you would need irrational roots (via the quadratic formula or rational root theorem) or the polynomial is truly irreducible.

Worked Examples — Mixed Difficulty

EASY — x² + 5x + 6 (a = 1) ac = 1 × 6 = 6. Find p, q: p×q=6, p+q=5 → p=2, q=3
Rewrite: x² + 2x + 3x + 6
Group: (x² + 2x) + (3x + 6)
Factor GCF: x(x + 2) + 3(x + 2)
Result: (x + 2)(x + 3)
MEDIUM — 12x² − x − 6 a=12, b=−1, c=−6. ac = 12 × (−6) = −72
Find p, q: p×q=−72, p+q=−1 → p=8, q=−9 (8×(−9)=−72, 8+(−9)=−1)
Rewrite: 12x² + 8x − 9x − 6
Group: (12x² + 8x) + (−9x − 6)
Factor GCF: 4x(3x + 2) − 3(3x + 2)
Result: (3x + 2)(4x − 3)
MEDIUM — 5x³ + 10x² + 3x + 6 Group: (5x³ + 10x²) + (3x + 6)
Factor GCF from each: 5x²(x + 2) + 3(x + 2)
Result: (x + 2)(5x² + 3)
HARD — 6x³ − 4x² + 9x − 6 No overall GCF.
Group: (6x³ − 4x²) + (9x − 6)
Factor GCF: 2x²(3x − 2) + 3(3x − 2)
Result: (3x − 2)(2x² + 3)
HARD — 4x³ − 6x² − 10x + 15 No overall GCF.
Group: (4x³ − 6x²) + (−10x + 15)
Factor GCF: 2x²(2x − 3) + (−5)(2x − 3)
Result: (2x − 3)(2x² − 5)
WITH OVERALL GCF — 6x³ + 12x² + 3x + 6 Overall GCF = 3: 3(2x³ + 4x² + x + 2)
Group inside bracket: (2x³ + 4x²) + (x + 2)
Factor GCF: 2x²(x + 2) + 1(x + 2)
Factor binomial: 3(x + 2)(2x² + 1)
Result: 3(x + 2)(2x² + 1)

Quick Reference Table

Polynomial Method Factored Form
x² + 5x + 6AC: p=2, q=3(x + 2)(x + 3)
2x² + 7x + 3AC: p=6, q=1 (ac=6)(2x + 1)(x + 3)
6x² + 11x + 4AC: p=3, q=8 (ac=24)(2x + 1)(3x + 4)
2x² − 7x + 3AC: p=−6, q=−1 (ac=6)(2x − 1)(x − 3)
3x² + x − 10AC: p=6, q=−5 (ac=−30)(3x − 5)(x + 2)
x³ + 3x² + 2x + 6Group (1,2)+(3,4)(x + 3)(x² + 2)
2x³ + 6x² + x + 3Group (1,2)+(3,4)(x + 3)(2x² + 1)
3x³ − 2x² + 9x − 6Group (1,2)+(3,4)(3x − 2)(x² + 3)
4x³ − 6x² − 10x + 15Group (1,2)+(3,4)(2x − 3)(2x² − 5)
x³ − x² − x + 1Group → x²(x−1) − (x−1)(x − 1)(x² − 1) = (x−1)²(x+1)

Common Mistakes to Avoid

  • Skipping the overall GCF check: Always factor out the GCF of all terms before grouping. Missing it means your final answer won't be fully factored.
  • Wrong sign after factoring a negative GCF: Factoring −3 from (−3x + 9) gives −3(x − 3), not −3(x + 3). Always verify the sign by distributing back.
  • Only trying one grouping: If the first grouping doesn't give a common binomial, try rearranging. Don't assume the polynomial is prime after one failed attempt.
  • Not checking the answer: Always expand your factored answer to confirm it equals the original polynomial. This catches sign errors and arithmetic mistakes.
  • Confusing AC with the simple case (a = 1): When a = 1, you can use simple inspection (find p, q with p×q=c and p+q=b directly). The AC method still works but adds an unnecessary step when a = 1.
  • Leaving the binomial factor inside the bracket: The whole point is to factor out the common binomial. Students sometimes stop at x(ax + b) + c(ax + b) and forget to write it as (ax + b)(x + c).
  • Arithmetic errors finding p and q: Be systematic — list factor pairs of ac in order (1×ac, 2×ac/2, …) and check each sum. Don't guess randomly.

Glossary of Key Terms

Polynomial
An algebraic expression with one or more terms, each consisting of a constant multiplied by a variable raised to a non-negative integer power. Examples: 3x² + 2x − 5 (trinomial), 4x³ − x + 7 (three-term cubic).
Factor (noun)
An expression that divides another expression exactly. The factors of 6x² + 11x + 4 are (2x + 1) and (3x + 4) because their product equals the original polynomial.
GCF (Greatest Common Factor)
The largest factor — numerical and/or variable — that divides every term of a polynomial. Always factor this out before applying any other technique.
Binomial
A polynomial with exactly two terms, such as (x + 3), (2x − 5), or (3x + 2). In grouping, the common binomial factor is what you factor out in the final step.
Trinomial
A polynomial with exactly three terms. ax² + bx + c is the standard form. When a ≠ 1, use the AC method with grouping to factor it.
AC Method
The technique of multiplying a and c in ax² + bx + c to find a product, then finding factor pairs that also sum to b. Used to split the middle term and enable grouping.
Leading Coefficient
The coefficient of the highest-degree term. In 6x² + 11x + 4, the leading coefficient is 6. When it equals 1, simpler inspection methods work instead of AC.
Prime Polynomial
A polynomial that cannot be factored into lower-degree polynomials with integer coefficients. Analogous to a prime number. Example: x² + x + 1 is prime over the integers.
Fully Factored
A polynomial written as a product where no factor can be factored further (other than multiplying out the GCF). Always check that each factor in your answer is fully simplified.

Frequently Asked Questions

Q: What is factor by grouping in algebra?

A: It is a technique where you split a polynomial into groups, factor the GCF out of each group, and then factor out the common binomial that results. It is used primarily on four-term polynomials and on trinomials via the AC method.

Q: How do you factor a trinomial ax² + bx + c by grouping?

A: Use the AC method: compute ac, find two numbers p and q where p×q = ac and p+q = b, rewrite bx as px + qx, then group the four terms and factor each pair. The common binomial in both pairs is your first factor.

Q: How do you factor a four-term polynomial by grouping?

A: Group the first two terms together and the last two together, factor the GCF from each pair, then identify and factor out the common binomial. If the first grouping fails, rearrange the terms and try again.

Q: When does factor by grouping NOT work?

A: When no rearrangement of terms produces a common binomial after GCF extraction, the polynomial is prime over the integers — it cannot be factored with integer coefficients using this method.

Q: What is the GCF and why must I find it first?

A: The GCF is the largest factor shared by all terms. Factoring it out first simplifies the polynomial, makes grouping possible, and ensures your final answer is fully factored.

Q: What is the AC method and how does it relate to factoring by grouping?

A: The AC method converts a trinomial into a four-term polynomial by splitting the middle term, which can then be factored by grouping. It is the standard bridge between trinomial factoring and the grouping technique.

Q: Does the order of grouping matter?

A: The order matters in that different groupings may or may not work. If the standard grouping (first two + last two) fails, try other arrangements. The final factored result is the same whichever valid grouping you use.

Q: Can factoring by grouping be used for 6-term polynomials?

A: Yes — group into three pairs of two, or two groups of three, factor GCF from each, then look for a common binomial or trinomial. This is less common in standard courses but appears in higher-level algebra.