Skip to content
Greatest Common Factor and Factor by Grouping

Greatest Common Factor and Factor by Grouping

By the end of this section, you will be able to: find the greatest common factor of two or more expressions, factor the greatest common factor from a polynomial, and factor by grouping.

Find the greatest common factor of two or more expressions

Earlier we multiplied factors together to get a product. Now we reverse this process: we start with a product and break it down into its factors. Splitting a product into factors is called factoring. For example, 87=568 \cdot 7 = 56 and 2x(x+3)=2x2+6x2x(x+3)=2x^2+6x show multiplication; reversing either process finds the factors of the product.

We have already factored numbers to find the least common multiple of two or more numbers. Now we factor expressions and find their greatest common factor. The method is similar to the method used to find the LCM.

Greatest common factor. The greatest common factor (GCF) of two or more expressions is the largest expression that is a factor of all the expressions.

Find the greatest common factor (GCF) of two or more expressions.

  1. Factor each coefficient into primes. Write all variables with exponents in expanded form.
  2. List all factors, matching common factors in a column. In each column, identify the common factors.
  3. Bring down the common factors that all expressions share.
  4. Multiply the factors.

Example. Find the greatest common factor of 21x321x^3, 9x29x^2, and 15x15x.

Factor each coefficient into primes and expand each power. The factors common to all three expressions are 33 and xx:

21x3=37xxx9x2=33xx15x=35x \begin{array}{rcl} 21x^3 &=& 3 \cdot 7 \cdot x \cdot x \cdot x \\[4pt] 9x^2 &=& 3 \cdot 3 \cdot x \cdot x \\[4pt] 15x &=& 3 \cdot 5 \cdot x \end{array}

Bring down and multiply the common factors:

GCF=3x=3x.\text{GCF}=3 \cdot x=3x.

Therefore, the GCF of 21x321x^3, 9x29x^2, and 15x15x is 3x3x.

Find the greatest common factor of 25m425m^4, 35m335m^3, and 20m220m^2.

Find the greatest common factor of 14x314x^3, 70x270x^2, and 105x105x.

Factor the greatest common factor from a polynomial

It is sometimes useful to represent a number as a product of factors. For example, 12=26=3412=2 \cdot 6=3 \cdot 4. In algebra, it is also useful to represent a polynomial in factored form. We can start with the polynomial 3x2+15x3x^2+15x and end with its factors, 3x(x+5)3x(x+5), by applying the Distributive Property in reverse.

Distributive Property. If aa, bb, and cc are real numbers, then

a(b+c)=ab+acandab+ac=a(b+c).a(b+c)=ab+ac \quad\text{and}\quad ab+ac=a(b+c).

The form on the left is used to multiply. The form on the right is used to factor.

To factor a polynomial, find the GCF of all its terms and write the polynomial as a product.

Example. Use the Distributive Property to factor 8m312m2n+20mn28m^3-12m^2n+20mn^2.

First find the GCF. Factoring the coefficients and expanding the variables shows that every term contains 4m4m:

8m3=222mmm12m2n=223mmn20mn2=225mnn \begin{array}{rcl} 8m^3 &=& 2 \cdot 2 \cdot 2 \cdot m \cdot m \cdot m \\[4pt] 12m^2n &=& 2 \cdot 2 \cdot 3 \cdot m \cdot m \cdot n \\[4pt] 20mn^2 &=& 2 \cdot 2 \cdot 5 \cdot m \cdot n \cdot n \end{array}

Rewrite each term as a product using 4m4m, and then use the Distributive Property in reverse:

Rewrite each term.8m312m2n+20mn2=4m2m24m3mn+4m5n2Factor the GCF.=4m(2m23mn+5n2) \begin{array}{lrcl} \text{Rewrite each term.} & 8m^3-12m^2n+20mn^2 &=& 4m \cdot 2m^2-4m \cdot 3mn+4m \cdot 5n^2 \\[4pt] \text{Factor the GCF.} &&=& 4m(2m^2-3mn+5n^2) \end{array}

Multiplying the factors returns the original polynomial, so the factorization checks.

Factor 9xy2+6x2y2+21y39xy^2+6x^2y^2+21y^3 by taking out the greatest common factor.

Factor 3p36p2q+9pq33p^3-6p^2q+9pq^3 by taking out the greatest common factor.

Factor the greatest common factor from a polynomial.

  1. Find the GCF of all the terms of the polynomial.
  2. Rewrite each term as a product using the GCF.
  3. Use the reverse Distributive Property to factor the expression.
  4. Check by multiplying the factors.

Factor as a noun and a verb

We use factor as both a noun and a verb. In the statement “77 is a factor of 1414,” factor is a noun. In the instruction “factor 33 from 3a+33a+3,” it is a verb.

Example. Factor 5x325x25x^3-25x^2.

The GCF of 5x35x^3 and 25x225x^2 is 5x25x^2. Rewrite each term using the GCF, then factor:

Rewrite each term.5x325x2=5x2x5x25Factor the GCF.=5x2(x5) \begin{array}{lrcl} \text{Rewrite each term.} & 5x^3-25x^2 &=& 5x^2 \cdot x-5x^2 \cdot 5 \\[4pt] \text{Factor the GCF.} &&=& 5x^2(x-5) \end{array}

Check: 5x2(x5)=5x325x25x^2(x-5)=5x^3-25x^2.

Factor 2x3+12x22x^3+12x^2 by taking out the greatest common factor.

Factor 6y315y26y^3-15y^2 by taking out the greatest common factor.

Example. Factor 8x3y10x2y2+12xy38x^3y-10x^2y^2+12xy^3.

The GCF of the three terms is 2xy2xy. Rewrite each term using the GCF and factor:

Rewrite each term.8x3y10x2y2+12xy3=2xy4x22xy5xy+2xy6y2Factor the GCF.=2xy(4x25xy+6y2) \begin{array}{lrcl} \text{Rewrite each term.} & 8x^3y-10x^2y^2+12xy^3 &=& 2xy \cdot 4x^2-2xy \cdot 5xy+2xy \cdot 6y^2 \\[4pt] \text{Factor the GCF.} &&=& 2xy(4x^2-5xy+6y^2) \end{array}

Check: multiplying 2xy2xy through the trinomial gives the original polynomial.

Factor 15x3y3x2y2+6xy315x^3y-3x^2y^2+6xy^3 by taking out the greatest common factor.

Factor 8a3b+2a2b26ab38a^3b+2a^2b^2-6ab^3 by taking out the greatest common factor.

When the leading coefficient is negative, factor the negative out as part of the GCF.

Example. Factor 4a3+36a28a-4a^3+36a^2-8a.

Because the leading coefficient is negative, use the negative GCF 4a-4a:

Rewrite each term.4a3+36a28a=4aa2+(4a)(9a)+(4a)2Factor the GCF.=4a(a29a+2) \begin{array}{lrcl} \text{Rewrite each term.} & -4a^3+36a^2-8a &=& -4a \cdot a^2+(-4a)(-9a)+(-4a) \cdot 2 \\[4pt] \text{Factor the GCF.} &&=& -4a(a^2-9a+2) \end{array}

Check: 4a(a29a+2)=4a3+36a28a-4a(a^2-9a+2)=-4a^3+36a^2-8a.

Factor 4b3+16b28b-4b^3+16b^2-8b by taking out a negative greatest common factor.

Factor 7a3+21a214a-7a^3+21a^2-14a by taking out a negative greatest common factor.

So far the greatest common factors have been monomials. A GCF can also be a binomial.

Example. Factor 3y(y+7)4(y+7)3y(y+7)-4(y+7).

The binomial y+7y+7 is the common factor:

3y(y+7)4(y+7)=(y+7)(3y4).3y(y+7)-4(y+7)=(y+7)(3y-4).

Check by multiplying the factors.

Factor 4m(m+3)7(m+3)4m(m+3)-7(m+3) by taking out the common binomial factor.

Factor 8n(n4)+5(n4)8n(n-4)+5(n-4) by taking out the common binomial factor.

Factor by grouping

Sometimes there is no common factor of all the terms of a polynomial. When there are four terms, separate the polynomial into two groups of two terms. Then look for the GCF in each group. If the polynomial can be factored, a common factor emerges from the two groups. Not all polynomials can be factored; just as some numbers are prime, some polynomials are prime.

Example. Factor by grouping: xy+3y+2x+6xy+3y+2x+6.

There is no GCF of all four terms. Group the first two terms and the last two terms, then factor the GCF from each group:

Group the terms.(xy+3y)+(2x+6)Factor each group.y(x+3)+2(x+3)Factor the common binomial.(x+3)(y+2) \begin{array}{lrcl} \text{Group the terms.} &&& (xy+3y)+(2x+6) \\[4pt] \text{Factor each group.} &&& y(x+3)+2(x+3) \\[4pt] \text{Factor the common binomial.} &&& (x+3)(y+2) \end{array}

Check: (x+3)(y+2)=xy+2x+3y+6(x+3)(y+2)=xy+2x+3y+6, which is the original polynomial with its middle terms reordered.

Factor by grouping: xy+8y+3x+24xy+8y+3x+24.

Factor by grouping: ab+7b+8a+56ab+7b+8a+56.

Factor by grouping.

  1. Group terms with common factors.
  2. Factor out the common factor in each group.
  3. Factor the common factor from the expression.
  4. Check by multiplying the factors.

Example. Factor each polynomial by grouping.

(a) x2+3x2x6x^2+3x-2x-6

There is no GCF in all four terms. Separate the polynomial into two groups. Be careful with the signs when factoring the GCF from the last group:

Group the terms.(x2+3x)+(2x6)Factor each group.x(x+3)2(x+3)Factor the common binomial.(x+3)(x2) \begin{array}{lrcl} \text{Group the terms.} &&& (x^2+3x)+(-2x-6) \\[4pt] \text{Factor each group.} &&& x(x+3)-2(x+3) \\[4pt] \text{Factor the common binomial.} &&& (x+3)(x-2) \end{array}

(b) 6x23x4x+26x^2-3x-4x+2

Again, group the terms, factor each group, and then factor out the common binomial:

Group the terms.(6x23x)+(4x+2)Factor each group.3x(2x1)2(2x1)Factor the common binomial.(2x1)(3x2) \begin{array}{lrcl} \text{Group the terms.} &&& (6x^2-3x)+(-4x+2) \\[4pt] \text{Factor each group.} &&& 3x(2x-1)-2(2x-1) \\[4pt] \text{Factor the common binomial.} &&& (2x-1)(3x-2) \end{array}

Check both results by multiplying their factors.

Factor by grouping: x2+2x5x10x^2+2x-5x-10.

Factor by grouping: 20x216x15x+1220x^2-16x-15x+12.

Factor by grouping: y2+4y7y28y^2+4y-7y-28.

Key terms

factoring — splitting a product into its factors. greatest common factor (GCF) — the largest expression that is a factor of every expression in a given collection. factored form — an expression written as a product of factors. factor by grouping — factor a four-term polynomial by grouping terms, factoring each group, and then factoring the common binomial.


This section is adapted from Intermediate Algebra 2e, Section 6.1: Greatest Common Factor and Factor by Grouping by Lynn Marecek and Andrea Honeycutt Mathis, © OpenStax, licensed under CC BY-NC-SA 4.0. Access the original for free at openstax.org. Changes: reformatted the worked-example tables as accessible aligned math, omitted the Be Prepared quiz, media links, and end-of-section exercises, and converted the practice problems (“Try Its”) into interactive exercises with instant feedback.