Skip to main content
Mathematics LibreTexts

1.2.6: The Greatest Common Factor and Factoring by Grouping

  • Page ID
    93966
  • \( \newcommand{\vecs}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} } \) \( \newcommand{\vecd}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash {#1}}} \)\(\newcommand{\id}{\mathrm{id}}\) \( \newcommand{\Span}{\mathrm{span}}\) \( \newcommand{\kernel}{\mathrm{null}\,}\) \( \newcommand{\range}{\mathrm{range}\,}\) \( \newcommand{\RealPart}{\mathrm{Re}}\) \( \newcommand{\ImaginaryPart}{\mathrm{Im}}\) \( \newcommand{\Argument}{\mathrm{Arg}}\) \( \newcommand{\norm}[1]{\| #1 \|}\) \( \newcommand{\inner}[2]{\langle #1, #2 \rangle}\) \( \newcommand{\Span}{\mathrm{span}}\) \(\newcommand{\id}{\mathrm{id}}\) \( \newcommand{\Span}{\mathrm{span}}\) \( \newcommand{\kernel}{\mathrm{null}\,}\) \( \newcommand{\range}{\mathrm{range}\,}\) \( \newcommand{\RealPart}{\mathrm{Re}}\) \( \newcommand{\ImaginaryPart}{\mathrm{Im}}\) \( \newcommand{\Argument}{\mathrm{Arg}}\) \( \newcommand{\norm}[1]{\| #1 \|}\) \( \newcommand{\inner}[2]{\langle #1, #2 \rangle}\) \( \newcommand{\Span}{\mathrm{span}}\)\(\newcommand{\AA}{\unicode[.8,0]{x212B}}\)

    Learning Objectives

    By the end of this section, you will be able to:

    • Find the greatest common factor of two or more polynomials
    • Factor the greatest common factor from a polynomial
    • Factor by grouping
    Be Prepared

    Before you get started, take this readiness quiz.

    1. Factor \(56\) into primes.

    2. Find the least common multiple (LCM) of \(18\) and \(24\).

    3. Multiply \(−3a(7a+8b)\).

    Introduction to Factoring

    We saw in the last section that we may reduce fractions if the numerator and denominator have the same factor.

    For example,

    \(\dfrac{3\cdot 5}{2\cdot 3}=\dfrac{5}{2}\),

    \( \dfrac{xy^2z}{yz}=xy\)

    and

    \(\dfrac{(x-2)(3x-4)}{2(3x-4)}=\dfrac{x-2}{2}=\dfrac{x}{2}-1.\)

    Note that in the last example the numerator is actually of degree 2 since \((x-2)(3x-4)=3x^2-10x+8\) and we can also see then that

    \(\dfrac{3x^2-10x+8}{6x-8}=\dfrac{(x-2)(3x-4)}{2(3x-4)}=\dfrac{x-2}{2}=\dfrac{x}{2}-1.\)

    So, if we were given the expression \(\dfrac{3x^2-10x+8}{6x-8}\) to simplify, the best way to go about it is to recognize the numerator and denominator are products of binomials! This is the same as it is with numbers. For example, to reduce \(\dfrac{121}{77}\) you can recognize the factors of the numerator and denominator:

    \(\dfrac{121}{77}=\dfrac{11\cdot 11}{7\cdot 11}=\dfrac{11}{7} \).

    Writing a polynomial as a product of other polynomials (of smaller degree) is the key to reducing fractions. We will spend some time practicing writing them in such a way (which is called factoring). Factoring will have other applications as we will see later. This section focuses writing a polynomial in an equivalent factored form.

    Finding the Greatest Common Factor of a Polynomial

    Earlier we multiplied factors together to get a product. Now, we will reverse this process; we will start with a product and then break it down into its factors. Splitting a product into factors is called factoring.

    8 times 7 is 56. Here 8 and 7 are factors and 56 is the product. An arrow pointing from 8 times 7 to 56 is labeled multiply. An arrow pointing from 56 to 8 times 7 is labeled factor. 2x open parentheses x plus 3 close parentheses equals 2x squared plus 6x. Here the left side of the equation is labeled factors and the right side is labeled products.

    Above, we have recalled how to factor numbers to find the least common multiple (LCM) of two or more numbers. Our goal is to be able to factor polynomials. The first step is to find the greatest common factor of a given polynomial. The method we use is similar to what we can use to find the LCM.

    Definition \(\PageIndex{1}\)

    1. If we write a polynomial \(P\) as a product of polynomials, we say that we have factored \(P\).
    2. A polynomial \(F\) is a factor of \(P\) if we can write \(P\) as \(P=F\cdot G\) for some polynomial \(G\).
    3. The greatest common factor (GCF) of two or more monomials is a monomial \(F\) that satisfies the following conditions:
      • \(F\) is a factor of all the monomials, that is, \(F\) is a common factor, and
      • any other common factor of all the monomials is a factor of \(F\).
    4. The greatest common factor (GCF) of a polynomial is the GCF of its terms.

    While we say the greatest common factor, there are actually two: one with a positive coefficient and one with a negative coefficient.

    Factor as a noun and a verb

    We use “factor” as both a noun and a verb:

    \[\begin{array} {ll} \text{Noun:} &\hspace{30mm} 7 \text{ is a factor of }14 \\ \text{Verb:} &\hspace{30mm} \text{factor }3 \text{ from }3a+3\end{array}\nonumber\]

    We summarize the steps we use to find the greatest common factor.

    Finding the Greatest Common Factor (GCF) of polynomials
    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, circle the common factors (this is suggested as a way of 'book-keeping').
    3. Collect the factors (including repeats) that all polynomials share.
    4. Multiply the factors.

    The next example will show us the steps to find the greatest common factor of three monomials.

    Example \(\PageIndex{2}\)

    Find the greatest common factor of \(21x^3\), \(9x^2\), and \(15x\).

    Solution
      \(21x^3\), \( 9x^2\), \(15x\)
    Factor each coefficient into primes and write the
    variables with exponents in expanded form.
    Circle the common factors in each column.
    Bring down the common factors.

    \(\begin{align*}21x^3 &= {\color{red}{3}}\cdot \quad \quad 7\cdot {\color{red}{x}}\cdot x\cdot x\\9x^2 &= {\color{red}{3}}\cdot 3\cdot \quad\quad {\color{red}{x}}\cdot x \\ 15x &= {\color{red}{3}}\cdot \quad 5 \cdot \quad {\color{red}{x}}\\ \text{GCF}&={\color{red}{3}}\cdot \quad \quad  \quad {\color{red}{x}}\end{align*}\)

    Multiply the factors. \(\text{GCF }=3x\)
    Answer the question. The GCF of \(21x^3\), \(9x^2\), and \(15x\) is \(3x\).
    Try It \(\PageIndex{3}\)

    Find the greatest common factor of \(25m^4\), \(35m^3\), and \(20m^2.\)

    Answer

    The GCF is \(5m^2\).

    Try It \(\PageIndex{4}\)

    Find the greatest common factor of \(14x^3\), \(70x^2\), and \(105x\).

    Answer

    The GCF is \(7x\).

    Factoring the Greatest Common Factor from a Polynomial

    It is sometimes useful to represent a number as a product of factors, for example, \(12\) as \(2\cdot 6\) or \(3\cdot 4\). In algebra, it can also be useful to represent a polynomial in factored form. We will start with a product, such as \(3x^2+15x\), and end with a product of its factors, \(3x(x+5)\). To do this we apply the Distributive Property “in reverse.”

    We state the Distributive Property here just as you saw it in earlier chapters and “in reverse.”

    Distributive Property

    If \(a\), \(b\), and \(c\) are real numbers, then

    \[a(b+c)=ab+ac\nonumber\]

    and

    \[ab+ac=a(b+c).\nonumber\]

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

    So how do you use the Distributive Property to (partially) factor a polynomial? You just find the GCF of all the terms and write the polynomial as a product!

    Example \(\PageIndex{5}\)

    Factor \(8m^3−12m^2n+20mn^2\).

    Solution
      \(8m^3−12m^2n+20mn^2\)
    Find the GCF of all the termsof the polynomial. Find the GCF of \(8m^3\), \(12m^2n\), and \(20mn^2\). Screen Shot 2021-08-03 at 9.02.02 PM.png
    Rewrite each term as a product using the GCF. Rewrite \(8m^3\), \(12m^2n\), and \(20mn^2\) as products of their GCF, \(4m\).

    \(\quad 8m^3−12m^2n+20mn^2\)

    \(= {\color{red}4m\cdot} 2m^2 - {\color{red}4m\cdot} 3mn +{\color{red} 4m\cdot} 5n^2\)

    Use the "reverse" Distributive Property to factor the expression.   \(={\color{red} 4m}(2m^2-3mn+5n^2)\)
    Check by multiplying the factors.  

    \(\quad 4m(2m^2-3mn+5n^2)\)

    \(= 4m\cdot 2m^2-4m\cdot 3mn+4m\cdot 5n^2\)

    \(= 8m^3-12m^2n+20n^2\quad\checkmark\)

    Try It \(\PageIndex{6}\)

    Factor \(9xy^2+6x^2y^2+21y^3\).

    Answer

    \(3y^2(3x+2x^2+7y)\)

    Try It \(\PageIndex{7}\)

    Factor \(3p^3−6p^2q+9pq^3\).

    Answer

    \(3p(p^2−2pq+3q^2)\)

    Factoring the Greatest Common Factor (GCF) 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 polynomial.
    4. Check by multiplying the factors.
    Example \(\PageIndex{8}\)

    Factor out the GCF of \(5x^3−25x^2\).

    Solution
      \(5x^3−25x^2\)
    Find the GCF of \(5x^3\) and \(25x^2\).

    .

    The GCF is \(5x^2\).

    Rewrite each term.

    \(\quad 5x^3−25x^2\)

    \(={\color{red}{5x^2}}\cdot x-{\color{red}{5x^2}}\cdot 5\)

    Factor the GCF. \(=5x^2(x-5)\)

    Check.
     

    \(\quad 5x^2(x−5) \)

    \(=5x^2\cdot x−5x^2\cdot 5 \)

    \(=5x^3−25x^2 \quad\checkmark\)

    Try It \(\PageIndex{9}\)

    Factor out the GCF of \(2x^3+12x^2\).

    Answer

    \(2x^2(x+6)\)

    Try It \(\PageIndex{10}\)

    Factor out the GCF of \(6y^3−15y^2\).

    Answer

    \(3y^2(2y−5)\)

    Example \(\PageIndex{11}\)

    Factor out the GCF of \(8x^3y−10x^2y^2+12xy^3\).

    Solution
      \(8x^3y−10x^2y^2+12xy^3\)
    The GCF of \(8x^3y,\space −10x^2y^2,\) and \(12xy^3\)
    is \(2xy\).

    .

    The GCF is \(2xy\).

    Rewrite each term using the GCF, \(2xy\).

    \(\quad 8x^3y−10x^2y^2+12xy^3\)

    \(={\color{red}{2xy}}\cdot 4x^2-{\color{red}{2xy}}\cdot 5xy + {\color{red}{2xy}}\cdot 6y^2\)

    Factor the GCF. \(=2xy(4x^2−5xy+6y^2)\)     

    Check.
     

    \(\quad 2xy(4x^2−5xy+6y^2)\)

    \(=2xy\cdot 4x^2−2xy\cdot 5xy+2xy\cdot 6y^2\)

    \(=8x^3y−10x^2y^2+12xy^3\quad\checkmark\)

    Try It \(\PageIndex{12}\)

    Factor out the GCF of \(15x^3y−3x^2y^2+6xy^3\).

    Answer

    \(3xy(5x^2−xy+2y^2)\)

    Try It \(\PageIndex{13}\)

    Factor out the GCF of \(8a^3b+2a^2b^2−6ab^3\).

    Answer

    \(2ab(4a^2+ab−3b^2)\)

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

    Example \(\PageIndex{14}\)

    Factor out the GCF of \(−4a^3+36a^2−8a\).

    Solution

    The leading coefficient is negative, so the GCF will be negative.

      \(\quad −4a^3+36a^2−8a\)
    Rewrite each term using the GCF, \(−4a\). \(={\color{red}{-4a}}\cdot a^2 {\color{red}{-4a}}\cdot(-9a) {\color{red}{-4a}}\cdot 2\)
    Factor the GCF. \(=−4a(a^2−9a+2)\)

    Check.
     

    \(\quad −4a(a^2−9a+2)\)

    \(=−4a\cdot a^2−(−4a)\cdot 9a+(−4a)\cdot 2\)

    \(=−4a^3+36a^2−8a\quad\checkmark\)

    Try It \(\PageIndex{15}\)

    Factor out the GCF of \(−4b^3+16b^2−8b\).

    Answer

    \(−4b(b^2−4b+2)\)

    Try It \(\PageIndex{16}\)

    Factor out the GCF of \(−7a^3+21a^2−14a\).

    Answer

    \(−7a(a^2−3a+2)\)

    In the next example, we extend the idea of factoring out the GCF to a binomial.

    Example \(\PageIndex{17}\)

    Factor out the common factor of the two terms of \(3y(y+7)−4(y+7)\).

    Solution
      \(\quad 3y(y+7)−4(y+7)\)

    The binomial \(y+7\) is a common factor of the two terms.

    \(=3y{\color{red}{(y+7)}}−4{\color{red}{(y+7)}}\)
    Factor \((y+7)\). \(=(y+7)(3y-4)\)
    Check.

    \(\quad 3y(y+7)−4(y+7)\)

    \(=3y\cdot y + 3y \cdot 7 -4y-4\cdot 7\)

    \(=3y^2+21y-4y-28\)

    \(=3y^2+17y -28\)

     

    \(\quad (y+7)(3y-4)\)

    \(=y\cdot 3y +y(-4)+7\cdot 3y +7\cdot (-4)\)

    \(=3y^2-4y+21y-28\)

    \(=3y^2+17y-28\quad\checkmark\)

    Try It \(\PageIndex{18}\)

    Factor out the common factor of the two terms of \(4m(m+3)−7(m+3)\).

    Answer

    \((m+3)(4m−7)\)

    Try It \(\PageIndex{19}\)

    Factor out the common factor of the two terms of \(8n(n−4)+5(n−4)\).

    Answer

    \((n−4)(8n+5)\)

    Factoring by Grouping

    Sometimes there is no common factor of all the terms of a polynomial. When there are four terms we separate the polynomial into two parts with two terms in each part. Then look for the GCF in each part. If the polynomial can be factored, you will find a common factor emerges from both parts. Not all polynomials can be factored. 

    Example \(\PageIndex{20}\)

    Factor \(xy+3y+2x+6\) by grouping.

    Solution
      \(xy+3y+2x+6\)
    Group terms with common factors.

    Is there a greatest common factor of all four terms?

    No, so let's separate the first two terms from the second two.

    \(\quad xy+3y+2x+6\)

    \(=\underbrace{xy+3y}{}+\underbrace{2x+6}{}\)

    Factor out the common factor in each group.

    Factor the GCF from the first two terms.

    Factor the GCF from the second two terms.

    \(=y(x+3)+\underbrace{2x+6}{}\)

    \(=y(x+3)+2(x+3)\)

    Factor the common factor from the expression. Notice that each terms has a common factor of \(x+3\).

    \(=y{\color{red}{(x+3)}}+2{\color{red}{(x+3)}}\)

    \(=(x+3)(y+2)\)

    Check. Multiply \((x+3)(y+2)\). Is the product the original expression?

    \(\quad (x+3)(y+2)\)

    \(=xy+2x+3y+6\)

    \(=xy+3y+2x+6\quad \checkmark\)

    Try It \(\PageIndex{21}\)

    Factor \(xy+8y+3x+24\) by grouping.

    Answer

    \((x+8)(y+3)\)

    Try It \(\PageIndex{22}\)

    Factor \(ab+7b+8a+56\) by grouping.

    Answer

    \((a+7)(b+8)\)

    Factoring by grouping
    1. Group terms with common factors.
    2. Factor out the common factor in each group.
    3. Factor the common factor from the polynomial.
    4. Check by multiplying the factors.
    Example \(\PageIndex{23}\)

    Factor by grouping:

    a. \(x^2+3x−2x−6\)

    b. \(6x^2−3x−4x+2\)

    Solution

    a.

      \(\quad x^2+3x−2x−6\)
    There is no GCF in all four terms. \(=x^2+3x−2x−6\)
    Separate into two parts. \(=\underbrace{x^2+3x}{}\underbrace{−2x−6}{}\)
    Factor the GCF from both parts. Be careful with the signs when factoring the GCF from the last two terms. \(=x(x+3)−2(x+3)\)
    Factor out the common factor, \(x+3\). \(=(x+3)(x−2)\)
    Check.

    \(\quad (x+3)(x−2)\)

    \(=x^2-2x+3x-6\)

    \(=x^2+x-6\)



    b.

      \(\quad 6x^2−3x−4x+2\)
    There is no GCF in all four terms. \(=6x^2−3x−4x+2\)
    Separate into two parts. \(=\underbrace{6x^2−3x}{}\underbrace{−4x+2}{}\)
    Factor the GCF from both parts. Be careful with the signs when factoring the GCF from the last two terms. \(=3x(2x−1)−2(2x−1)\)
    Factor out the common factor, \(2x-1\). \(=(2x−1)(3x−2)\)
    Check.

    \(\quad (2x−1)(3x−2)\)

    \(=6x^2-4x-3x+2\)

    \(=6x^2-3x-4x+2\)

    Try It \(\PageIndex{24}\)

    Factor by grouping:

    a. \(x^2+2x−5x−10\)

    b. \(20x^2−16x−15x+12\)

    Answer

    a. \((x−5)(x+2)\)
    b. \((5x−4)(4x−3)\)

    Try It \(\PageIndex{25}\)

    Factor by grouping:

    a. \(y^2+4y−7y−28\)

    b. \(42m^2−18m−35m+15\)

    Answer

    a. \((y+4)(y−7)\)
    b. \((7m−3)(6m−5)\)

    Writing Exercises \(\PageIndex{26}\)
    1. What does it mean to say a polynomial is in factored form?
    2. What is a GCF? 
    3. Give your own example of factoring out the greatest common factor from a polynomial with two variables.
    4. In your example above, factor out the negative of your GCF.
    5. Explain how you know you have the greatest common factor.
    6. How can you check your factoring process?  Give an example.
    7. When might you find it useful to factor a polynomial?
    8. The greatest common factor of 3636 and 6060 is 1212. Explain what this means.
    9. When should you look to factor by grouping?  Is it always possible?
    Exit Problem 

    a. Factor the GCF out \(100x^3y^2-6xy\).

    b. Factor \(10x^2+5x-4x-2\) by grouping.

    Key Concepts

    • Factor as a Noun and a Verb: We use “factor” as both a noun and a verb.

      \[\begin{array} {ll} \text{Noun:} &\quad 7 \text{ is a factor of } 14\\ \text{Verb:} &\quad \text{factor }3 \text{ from }3a+3\end{array}\nonumber\]

    • How to find the greatest common factor (GCF) of two polynomials.
      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, circle the common factors.
      3. Bring down the common factors that all polynomials share.
      4. Multiply the factors.
    • Distributive Property: If \(a\), \(b\) and \(c\) are real numbers, then

      \[a(b+c)=ab+ac\quad \text{and}\quad ab+ac=a(b+c)\nonumber\]


      The form on the left is used to multiply. The form on the right is used to factor.
    • How to 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 polynomial.
      4. Check by multiplying the factors.
    • How to 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 polynomial.
      4. Check by multiplying the factors.

    This page titled 1.2.6: The Greatest Common Factor and Factoring by Grouping is shared under a CC BY license and was authored, remixed, and/or curated by OpenStax.

    • Was this article helpful?