Free Algebra Solver
Factor by grouping

Factor by Grouping Calculator

Enter a polynomial with four terms, such as x³ + 3x² + 2x + 6, or a trinomial to split with the ac method.

Interpreted as: x^3 + 3x^2 + 2x + 6 (Factor) Ready
Examples
Solution

Worked example: x^3 + 3x^2 + 2x + 6

Worked example. Edit the problem above and press Factor to solve your own.

Problemx^3 + 3x^2 + 2x + 6
  1. Factor by grouping

    Group the first two terms and the last two terms, factor each group, then pull out the shared binomial.

    (x³ + 3x²) + (2x + 6)
    Group the terms in pairs
    x²(x + 3) + 2(x + 3)
    Factor each group
    (x + 3)(x² + 2)
    Factor out the common binomial

    Each group contains the same binomial factor, so the distributive property can be reversed.

  2. Check by multiplying the factors

    Expand the factored form and compare it with the original expression.

    (x + 3)(x² + 2)
    Factored form
    x³ + 3x² + 2x + 6
    Expands back to the original, so it checks out

    Equal coefficients for every power of x prove the factorization is exact.

Answer(x + 3)(x² + 2) (remaining quadratic is irreducible over the rationals)

Grouping guide

How the factor by grouping calculator works

The factor by grouping calculator splits a four-term polynomial into two pairs, factors each pair, and pulls out the shared binomial. Here is how to do the same thing by hand, and how to tell in advance whether grouping will work.

How do you factor by grouping?

To factor by grouping, split the polynomial into two pairs of terms, factor the GCF out of each pair, and then factor out the binomial the pairs share. For x³ + 3x² + 2x + 6, the pairs give x²(x + 3) + 2(x + 3), which becomes (x + 3)(x² + 2).

What is factoring by grouping?

Factoring by grouping is a method for polynomials with four terms. You treat the first two terms and the last two terms as separate groups, factor each one, and hope the same binomial shows up in both.

It relies on the distributive property running backward. If two pieces both contain (x + 3), you can pull (x + 3) out the same way you would pull out a common number. Grouping is also the second half of the ac method for trinomials, so it comes up more often than you might expect.

How to factor by grouping, step by step, like the calculator does

Write the polynomial in descending powers, group the terms in pairs, factor each pair, then factor out the common binomial. Here is x³ + 3x² + 2x + 6, the same example the calculator shows.

Start
x³ + 3x² + 2x + 6
Group in pairs
(x³ + 3x²) + (2x + 6)
Factor each pair
x²(x + 3) + 2(x + 3)
Common binomial
(x + 3)(x² + 2)

Check by multiplying: (x + 3)(x² + 2) = x³ + 2x + 3x² + 6, which matches once you reorder the terms. The factor x² + 2 has no real roots, so the calculator labels it irreducible over the rationals and stops.

If the terms come in a jumbled order, like x³ + 2x + 3x² + 6, put them in descending powers first. The calculator does this for you and gives the same answer, (x + 3)(x² + 2).

How can you tell if grouping will work?

For a cubic ax³ + bx² + cx + d, grouping in the usual order works when a·d = b·c. That quick test tells you whether the two pairs will share a binomial before you do any factoring.

In x³ + 3x² + 2x + 6, a·d = 1 × 6 = 6 and b·c = 3 × 2 = 6. They match, so grouping works. In x³ − 4x² + 4x − 16, a·d = −16 and b·c = −16, so it works too, giving (x − 4)(x² + 4).

Now try x³ + 2x² + 3x + 4. Here a·d = 4 but b·c = 6, so the pairs x²(x + 2) and (3x + 4) share nothing. This one has no rational roots at all, and the calculator reports it as irreducible over the rationals.

PolynomialTest a·d = b·cResult
x³ + 3x² + 2x + 61 × 6 = 3 × 2(x + 3)(x² + 2)
2x³ + 6x² + 5x + 152 × 15 = 6 × 5(x + 3)(2x² + 5)
x³ − 5x² − 2x + 101 × 10 = (−5)(−2)(x − 5)(x² − 2)
x³ + 2x² + 3x + 44 ≠ 6Does not group

What if the third term is negative?

Factor a negative out of the second pair so the binomials match. This is where most sign errors happen when factoring by grouping.

Look at 2x³ + 4x² − x − 2. The first pair gives 2x²(x + 2). For the second pair, take out −1, not 1: −x − 2 = −1(x + 2). Now both pieces share (x + 2), and the answer is (x + 2)(2x² − 1).

If you had written the second pair as 1(−x − 2), the binomials would not match and it would look like grouping failed. When the third term is negative, pull out the negative.

How is grouping used to factor trinomials?

In the ac method, you split the middle term of a trinomial into two terms, which turns it into a four-term polynomial you can group. So learning to factor by grouping also teaches you the last step of trinomial factoring.

Take 6x² + 7x + 2. Multiply a·c = 6 × 2 = 12, then find two numbers that multiply to 12 and add to 7. Those are 3 and 4.

Start
6x² + 7x + 2
Split 7x
6x² + 3x + 4x + 2
Factor each pair
3x(2x + 1) + 2(2x + 1)
Answer
(3x + 2)(2x + 1)

The split always passes the a·d = b·c test, because you chose the two middle numbers to multiply to a·c. Here 6 × 2 = 3 × 4 = 12. The order of 3x and 4x does not matter: 6x² + 4x + 3x + 2 groups to the same answer.

What are common mistakes when factoring by grouping?

The most common mistake is stopping at x²(x + 3) + 2(x + 3). That is still a sum of two terms, so it is not factored yet. You have to pull out (x + 3) to get a product.

Another mistake is skipping the GCF of the whole polynomial. In 4x³ + 12x² + 8x + 24, take out 4 first to get 4(x³ + 3x² + 2x + 6), then group. Last, check the leftover factor. If it is a difference of squares like x² − 4, keep factoring.

Frequently asked questions

Short answers to the questions people ask most about this topic.

When should I use factoring by grouping?

Use it when a polynomial has four terms and no single pattern fits, or as the final step of the ac method for a trinomial. Always take out the GCF of all four terms first.

Does factoring by grouping always work?

No. It only works when the two pairs share a binomial. For a cubic ax³ + bx² + cx + d in standard order, that happens when a·d = b·c. If the test fails, try another method such as the rational root theorem.

What is the first step in factoring by grouping?

Take out the GCF of all four terms, then write the terms in descending powers. Only after that should you split them into pairs.

Can I group the terms in a different order?

Yes. Sometimes pairing the first and third terms works when the usual order does not. The answer is the same polynomial factored, as long as each pair shares a binomial in the end.

Why does the factor by grouping calculator leave x² + 2 unfactored?

x² + 2 has no rational roots, so it cannot be split using whole numbers or fractions. The calculator marks it irreducible over the rationals, which is the expected final form in most algebra classes.

How do I check my answer?

Multiply the two factors back together. For (x + 3)(x² + 2) you should get x³ + 3x² + 2x + 6. The expand calculator can do this multiplication for you.

Can the calculator group polynomials with more than four terms?

The grouping step is built for four terms. For longer polynomials up to degree 6, the general factoring calculator uses the rational root theorem and other methods instead.

Math keypad

Factor mode

Use the keypad below or tap the expression to use your phone keyboard.

Keyboard tips

Ctrl + Enter
Run the selected operation
^
Enter a power, such as x^2
sqrt(
Calculate an exact or simplified square root
a:b
Separate quantities in a ratio
12, 18
Separate integers in an LCM and GCD calculation
@ x =
Assign x when evaluating an expression
y =
Enter a polynomial function to graph
|
Wrap an absolute-value expression