If you're seeing this message, it means we're having trouble loading external resources on our website.

If you're behind a web filter, please make sure that the domains *.kastatic.org and *.kasandbox.org are unblocked.

Main content

Factoring by grouping

Learn about a factorization method called "grouping." For example, we can use grouping to write 2x²+8x+3x+12 as (2x+3)(x+4).

What you need to know for this lesson

Factoring a polynomial involves writing it as a product of two or more polynomials. It reverses the process of polynomial multiplication.
We have seen several examples of factoring already. However, for this article, you should be especially familiar with taking common factors using the distributive property. For example, 6, x, squared, plus, 4, x, equals, 2, x, left parenthesis, 3, x, plus, 2, right parenthesis .

What you will learn in this lesson

In this article, we will learn how to use a factoring method called grouping.

Example 1: Factoring 2, x, squared, plus, 8, x, plus, 3, x, plus, 12

First, notice that there is no factor common to all terms in 2, x, squared, plus, 8, x, plus, 3, x, plus, 12. However, if we group the first two terms together and the last two terms together, each group has its own GCF, or greatest common factor:
start underbrace, left parenthesis, 2, x, squared, plus, 8, x, right parenthesis, end underbrace, start subscript, start text, f, i, r, s, t, space, g, r, o, u, p, i, n, g, end text, end subscript, plus, start underbrace, left parenthesis, 3, x, plus, 12, right parenthesis, end underbrace, start subscript, start text, s, e, c, o, n, d, space, g, r, o, u, p, i, n, g, end text, end subscript
In particular, there is a GCF of 2, x in the first grouping and a GCF of 3 in the second grouping. We can factor these out to obtain the following expression:
2, x, left parenthesis, x, plus, 4, right parenthesis, plus, 3, left parenthesis, x, plus, 4, right parenthesis
Notice that this reveals yet another common factor between the two terms: start color #a75a05, x, plus, 4, end color #a75a05. We can use the distributive property to factor out this common factor.
2, x, left parenthesis, start color #a75a05, x, plus, 4, end color #a75a05, right parenthesis, plus, 3, left parenthesis, start color #a75a05, x, plus, 4, end color #a75a05, right parenthesis, equals, left parenthesis, start color #a75a05, x, plus, 4, end color #a75a05, right parenthesis, left parenthesis, 2, x, plus, 3, right parenthesis
Since the polynomial is now expressed as a product of two binomials, it is in factored form. We can check our work by multiplying and comparing it to the original polynomial.

Example 2: Factoring 3, x, squared, plus, 6, x, plus, 4, x, plus, 8

Let's summarize what was done above by factoring another polynomial.
=3x2+6x+4x+8=(3x2+6x)+(4x+8)Group terms=3x(x+2)+4(x+2)Factor out GCFs=3x(x+2)+4(x+2)Common factor!=(x+2)(3x+4)Factor out x+2\begin{aligned}&\phantom{=}3x^2+6x+4x+8\\\\ &=(3x^2+6x)+(4x+8)&&\small{\gray{\text{Group terms}}}\\ \\ &=3x({x+2})+4({x+2})&&\small{\gray{\text{Factor out GCFs}}}\\ \\ &=3x(\goldD{x+2})+4(\goldD{x+2})&&\small{\gray{\text{Common factor!}}}\\\\ &=(\goldD{x+2})(3x+4)&&\small{\gray{\text{Factor out } x+2}} \end{aligned}
The factored form is left parenthesis, x, plus, 2, right parenthesis, left parenthesis, 3, x, plus, 4, right parenthesis.

Check your understanding

1) Factor 9, x, squared, plus, 6, x, plus, 12, x, plus, 8.
Choose 1 answer:
Choose 1 answer:

2) Factor 5, x, squared, plus, 10, x, plus, 2, x, plus, 4.

3) Factor 8, x, squared, plus, 6, x, plus, 4, x, plus, 3.

Example 3: Factoring 3, x, squared, minus, 6, x, minus, 4, x, plus, 8

Extra care should be taken when using the grouping method to factor a polynomial with negative coefficients.
For example, the steps below can be used to factor 3, x, squared, minus, 6, x, minus, 4, x, plus, 8.
0=3x26x4x+8(1)=(3x26x)+(4x+8)Group terms(2)=3x(x2)+(4)(x2)Factor out GCFs(3)=3x(x2)4(x2)Simplify(4)=3x(x2)4(x2)Common factor!(5)=(x2)(3x4)Factor out x2\begin{aligned}\phantom{0}&&&\phantom{=}3x^2-6x-4x+8\\\\ \small{\blueD{(1)}}&&&=(3x^2-6x)+(-4x+8)&&\small{\gray{\text{Group terms}}}\\\\ \small{\blueD{(2)}}&&&=3x(x-2)+(-4)(x-2)&&\small{\gray{\text{Factor out GCFs}}}\\\\ \small{\blueD{(3)}}&&&=3x(x-2)-4(x-2)&&\small{\gray{\text{Simplify}}}\\\\ \small{\blueD{(4)}}&&&=3x(\goldD{x-2})-4(\goldD{x-2})&&\small{\gray{\text{Common factor!}}}\\\\ \small{\blueD{(5)}}&&&=(\goldD{x-2})(3x-4)&&\small{\gray{\text{Factor out $x-2$}}}\\\\ \end{aligned}
The factored form of the polynomial is left parenthesis, x, minus, 2, right parenthesis, left parenthesis, 3, x, minus, 4, right parenthesis. We can multiply the binomials to check our work.
A few of the steps above may seem different than what you saw in the first example, so you may have a few questions.
Where did the "+" sign between the groupings come from?
In step start color #11accd, left parenthesis, 1, right parenthesis, end color #11accd, a "+" sign was added between the groupings left parenthesis, 3, x, squared, minus, 6, x, right parenthesis and left parenthesis, minus, 4, x, plus, 8, right parenthesis. This is because the third term left parenthesis, minus, 4, x, right parenthesis is negative, and the sign of the term must be included within the grouping.
Keeping the minus sign outside the second grouping is tricky. For example, a common error is to group 3, x, squared, minus, 6, x, minus, 4, x, plus, 8 as left parenthesis, 3, x, squared, minus, 6, x, right parenthesis, minus, left parenthesis, 4, x, plus, 8, right parenthesis. This grouping, however, simplifies to 3, x, squared, minus, 6, x, minus, 4, x, start color #ca337c, minus, 8, end color #ca337c, which is not the same as the original expression.
Why factor out minus, 4 instead of 4?
In step start color #11accd, left parenthesis, 2, right parenthesis, end color #11accd, we factored out a minus, 4 to reveal a common factor of left parenthesis, x, minus, 2, right parenthesis between the terms. If we instead factored out a positive 4, we would not obtain that common binomial factor seen above:
(3x26x)+(4x+8)=3x(x2)+4(x+2)\begin{aligned}(3x^2-6x)+(-4x+8)&=3x(\goldD{x-2})+4(\purpleC{-x+2})\\ \end{aligned}
When the leading term in a group is negative, we will often need to factor out a negative common factor.

Check your understanding

4) Factor 2, x, squared, minus, 3, x, minus, 4, x, plus, 6.
Choose 1 answer:
Choose 1 answer:

5) Factor 3, x, squared, plus, 3, x, minus, 10, x, minus, 10.

6) Factor 3, x, squared, plus, 6, x, minus, x, minus, 2.

Challenge problem

7*) Factor 2, x, cubed, plus, 10, x, squared, plus, 3, x, plus, 15.

When can we use the grouping method?

The grouping method can be used to factor polynomials whenever a common factor exists between the groupings.
For example, we can use the grouping method to factor 3, x, squared, plus, 9, x, plus, 2, x, plus, 6 since it can be written as follows:
(3x2+9x)+(2x+6)=3x(x+3)+2(x+3)\begin{aligned}(3x^2+9x)+(2x+6)&=3x(\goldD{x+3})+2(\goldD{x+3})\\ \end{aligned}
We cannot, however, use the grouping method to factor 2, x, squared, plus, 3, x, plus, 4, x, plus, 12 because factoring out the GCF from both groupings does not yield a common factor!
(2x2+3x)+(4x+12)=x(2x+3)+4(x+3)\begin{aligned}(2x^2+3x)+(4x+12)&=x(\goldD{2x+3})+4(\purpleC{x+3})\\ \end{aligned}

Using grouping to factor trinomials

You can also use grouping to factor certain three termed quadratics (i.e. trinomials) like 2, x, squared, plus, 7, x, plus, 3. This is because we can rewrite the expression as follows:
2, x, squared, plus, start color #11accd, 7, end color #11accd, x, plus, 3, equals, 2, x, squared, plus, start color #11accd, 1, end color #11accd, x, plus, start color #11accd, 6, end color #11accd, x, plus, 3
Then we can use grouping to factor 2, x, squared, plus, start color #11accd, 1, end color #11accd, x, plus, start color #11accd, 6, end color #11accd, x, plus, 3 as left parenthesis, x, plus, 3, right parenthesis, left parenthesis, 2, x, plus, 1, right parenthesis.
For more on factoring quadratic trinomials like these using the grouping method, check out our next article.

Want to join the conversation?

  • duskpin tree style avatar for user Nin
    This may sound a bit dumb, but is there any significant difference between factoring, grouping trinomials, difference of squares, and GCF?
    (27 votes)
    Default Khan Academy avatar avatar for user
  • blobby green style avatar for user daleighellison
    How would you work out the problem if there were only 3 terms?
    (13 votes)
    Default Khan Academy avatar avatar for user
    • primosaur seed style avatar for user Ian Pulizzotto
      Find two numbers that add to the middle coefficient and multiply to give the product of the first and last coefficients (or constants). This is called the ac method.

      Example: Factor 6x^2 + 19x + 10.
      6*10 = 60, so we need to find two numbers that add to 19 and multiply to give 60. These numbers (after some trial and error) are 15 and 4. So split up 19x into 15x + 4x (or 4x + 15x), then factor by grouping:

      6x^2 + 19x + 10 = 6x^2 + 15x + 4x + 10
      = 3x(2x + 5) + 2(2x + 5)
      = (3x + 2)(2x + 5).

      Have a blessed, wonderful day!
      (59 votes)
  • blobby green style avatar for user Nikkia Metsker
    What is the point of this? I'm not going to use it when i do daily life things.
    (0 votes)
    Default Khan Academy avatar avatar for user
    • duskpin ultimate style avatar for user J E
      You might be surprised! If you decide to go into a career like engineering or to work on cool projects like an autonomous car or a rocket, you will use polynomials on a daily basis to solve problems like how to control the car using different sensor inputs. Knowing how to manipulate polynomials like this is therefore extremely useful when designing these systems!
      (17 votes)
  • primosaur seed style avatar for user Hafsa Mohamed
    In problem 3, I solved the expression and got the answer (4x+2)(2x+1.5). It said my answer was correct, but when I checked my answer, I got the same expression. What did I do wrong?
    (5 votes)
    Default Khan Academy avatar avatar for user
  • purple pi purple style avatar for user louisaandgreta
    Why are they called quadratics? They are typically trinomials with a leading term raised to the second degree.
    (2 votes)
    Default Khan Academy avatar avatar for user
    • stelly yellow style avatar for user lemonomadic
      Quadratics actually are derived from the Latin word, 'quadratum', which literally means 'square'.
      A quadratic is basically a type of problem that deals with a variable multiplied by itself — an operation known as squaring.
      So, you could relate the word quadratic to Latin, not mathematics
      (6 votes)
  • blobby green style avatar for user katelynn Rodriguez
    so for your polynomials that you can not use the grouping method for what do you do to solve them ?
    (2 votes)
    Default Khan Academy avatar avatar for user
  • starky sapling style avatar for user Aaishahali
    can someone help me with these type of questions
    Factor as the product of two binomials.
    x​​ +8x+12
    (0 votes)
    Default Khan Academy avatar avatar for user
    • piceratops ultimate style avatar for user David Matisko
      Is it supposed to be: X^2 +8x +12 ?
      I just noticed that the power of 2 is missing.
      The first step is the hardest step. Look at the 12 and break it down to pairs of factors. The pairs are 1*12, 2*6, or 3*4. Now find the pair that adds to 8; That is 2*6! okay that was the hard part, now to finish it:
      x^2+8x+12 first step, change the 8 to a 2&6:
      x^2+2x+6x+12 see how this is equivalent? Now factor by grouping.
      x(x+2)+6(x+2) got the same factor! (x+2)
      (x+2)(x+6) all done. (If we FOIL this we get back to the start.)
      Note: if there is at least one negative sign we might have to subtract instead of adding.


      Here is one with a negative sign ( a little harder ):
      x^2+10x-24
      The pairs of factors that make 24 are 1*24, 2*12, 3*8, or 4*6. Because the 24 is negative we need the pair that subtracts to 10; Which is 2*12 (not 4*6)
      X^2-2x+12x-24 (note that we need a negative 2 and positive 12 to make 10) Now factor by grouping
      x(x-2)+12(x-2) Now factor the polynomial with a common binomial
      (x-2)(x+12) (FOIL this to get back to the start)

      Note: Need to know (factor by grouping) & (factor polynomials with a common binomial)
      before tackling this kind of problem
      I found a video on this called: Factoring quadratics by grouping
      (6 votes)
  • blobby green style avatar for user Dan Madsen
    How does one factor by grouping when their is more than one letter in the equation. For example: 8ax+18a+20x+45
    (1 vote)
    Default Khan Academy avatar avatar for user
    • mr pink green style avatar for user David Severin
      well, if you factor the first two to get 2a (4x + 9) and the second two as 5 (4x+9), you can see that an equivalent would be (2a + 5)(4x+9). Or if you factored first and third tern and second and fourth, you get 4x(2a+5) + 9(2a+5) and get the same answer
      (3 votes)
  • aqualine ultimate style avatar for user dayton.bishop
    does it matter if the order is switched around with the answer
    (2 votes)
    Default Khan Academy avatar avatar for user
  • female robot grace style avatar for user rama
    what the meaning of GCF?
    (2 votes)
    Default Khan Academy avatar avatar for user