See How Things Work

Factoring out a common factor

Unit
Algebraic Expressions
Part
1. Variables & Expressions
Lesson
1.8

Factoring out a common factor is expanding read backwards: 12x + 18 = 6(2x + 3). This lesson defines factors of terms and the greatest common factor of terms with integer coefficients, proves that it is found from the gcd of the coefficients and the smallest powers of the variables, factors out negative numbers and fractions, and checks every factorization by expanding it.

Factoring is expanding backwards

Lesson 1.7 used the distributive law from left to right, A(B + C) = AB + AC, to remove parentheses (Expanding with the distributive property). Read from right to left, the same identity writes a sum as a product: AB + AC = A(B + C). The first form is used to multiply, the second to factor.⁠[1]

Definition (Factoring).

To factor an expression is to write it as a product of expressions, called its factors.⁠[2] The word is a noun and a verb: one factors an expression, and the result has factors.⁠[3] If every term of a sum is a product with the same expression F as one factor, F is a common factor of the terms, and writing the sum as F times a group is factoring out F.

Theorem (factoring out).

Let F, Q₁, …, Qₙ be expressions. At every value of the variables at which they have values,

FQ₁ + FQ₂ + ⋯ + FQₙ = F(Q₁ + Q₂ + ⋯ + Qₙ),

and the same with any of the signs + replaced by −.

Proof.

This is the Theorem on distributing over several terms (lesson 1.7) read from right to left: an equation between two numbers says the same thing in both directions.

So factoring never changes the value: the factored form is equivalent to the sum (lesson 1.4). It follows that every factorization can be checked by expanding it again; if the expansion gives back the original expression, the factorization is right.⁠[4] Expanding a wrong factorization gives a different expression, and one value at which the two differ shows the mistake.

Example (A first factorization).

Factor 8a + 8b and 6x − 6.

  1. Both terms of 8a + 8b have the factor 8: 8a + 8b = 8(a + b).
  2. In 6x − 6 the second term is 6 itself, which is 6 × 1. So 6x − 6 = 6 · x − 6 · 1 = 6(x − 1).
  3. Check by expanding: 8(a + b) = 8a + 8b and 6(x − 1) = 6x − 6.

Answer: 8(a + b) and 6(x − 1). The 1 cannot be left out: 6(x) is 6x, which has lost the term −6.

In the rational numbers, a common factor is far from unique. Every rational number is d times another one (itself divided by d) for every nonzero d, so 6x + 9 = 2(3x + 92) = 3(2x + 3) = 13(18x + 27), and all three are correct. The useful choice keeps whole-number coefficients inside the parentheses and takes out as much as possible. The next sections make this precise for terms with integer coefficients.

Factors of a term

A term is a coefficient times a variable part (lesson 1.5). Its factors come from both. The variable part needs one fact about powers, which follows from their definition (lesson 1.1).

Proposition (splitting a power).

For every rational number x and counting numbers k < m: xm = xk · xm − k. For example, x⁵ = x² · x³.

Proof.

xm is the product of m factors, each equal to x. By the associative law, group the first k factors together and the remaining m − k together. The first group is xk and the second is xm − k, by the definition of a power. For example, x⁵ = (x · x)(x · x · x) = x² · x³.

Looking ahead.

The general rule xk · xn = xk + n, the product rule for exponents, is the subject of the unit Exponents. This lesson needs only the special case above.

Definition (Factor of a term).

Let T = c · U and F = d · W be terms with integer coefficients c and d ≠ 0 and variable parts U and W. F is a factor of T if |d| divides |c| and every variable of W occurs in U with an exponent at least as large as in W.

Proposition .

If F is a factor of T, then T = F · Q, where Q is the term whose coefficient is c ÷ d, an integer, and whose variable part is U with the exponent of each variable lowered by its exponent in W (a variable whose exponent becomes 0 is left out).

Proof.

|d| divides |c|, so |c| = |d| · e for a whole number e (divisibility, absolute value), and c = d · e or c = d · (−e) according to the signs: so c ÷ d is an integer (Integers 3.4) and c = d · (c ÷ d). For each variable of W, with exponent k in W and m ≥ k in U, the Proposition on splitting a power gives xm = xk · xm − k (if m = k, simply xm = xk · 1). Reordering all these factors (lesson 1.2) collects d and the powers of W into F, and the rest into Q.

Example (Is it a factor?).

Is 4x² a factor of 12x³y? Is it a factor of 6x²? Is 3y a factor of 9x²?

  1. 4 divides 12, and x occurs in 12x³y with exponent 3 ≥ 2. Yes: 12x³y = 4x² · 3xy. Check: 4x² · 3xy = (4 × 3)x² · x · y = 12x³y.
  2. 4 does not divide 6. No: 6x² = 4x² · 32, and 32 is not an integer.
  3. 9x² has no y. No.

Answer: yes, no, no.

The greatest common factor

A common factor of several terms is a factor of each of them. Among the common factors one is the largest: its coefficient is the greatest common divisor of the coefficients, the largest integer that divides all of them (Factors, Multiples & Primes 3.1).⁠[5][6]

Definition (Greatest common factor).

Let T₁, …, Tₙ be nonzero terms with integer coefficients c₁, …, cₙ. Their greatest common factor (GCF) is the term g · V, where g is the gcd of |c₁|, …, |cₙ|, and V is the product of the variables that occur in every one of the terms, each raised to the smallest exponent with which it occurs in them.⁠[7][8][9]

Theorem (the GCF is the greatest common factor).
  1. The GCF is a common factor of the terms.
  2. Every common factor d · W has |d| dividing g, so |d| ≤ g, and every variable of W occurs in V with at least the same exponent. In other words, every common factor is a factor of the GCF.
  3. After the GCF is factored out, the terms left in the parentheses have coefficients with gcd 1 and no variable in common: they have no common factor except 1 and −1.
Proof.

(1) g divides each |cₖ|, by its definition, and each variable of V occurs in every term with at least the smallest exponent.

(2) |d| divides every |cₖ|, so it is a common divisor, and every common divisor divides the gcd (Factors, Multiples & Primes 3.2, for two numbers and, by the same proof, for more). A variable of W must occur in every term, with at least its exponent in W; so it occurs in V, with the smallest of those exponents, which is at least its exponent in W.

(3) The coefficients left are cₖ ÷ g. If an integer e ≥ 2 divided all their sizes, then e · g would divide every |cₖ|, a common divisor larger than the gcd, which is impossible. A variable occurring in every term left would occur in every original term with an exponent larger than the smallest one, which is also impossible.

To factor out the GCF:

  1. Find the gcd of the sizes of the coefficients, for example from their prime factorizations.⁠[8]
  2. For each variable that occurs in every term, take the smallest exponent with which it occurs; the GCF is the product.⁠[9]
  3. Divide each term by the GCF, by the Proposition above, and write the sum of the results in parentheses after the GCF.
  4. Check by expanding.⁠[4]

6x + 9

xxxxxx111111111

3(2x + 3)

xx1112x + 3xx1112x + 3xx1112x + 3
Figure. Factoring 6x + 9: the six tiles for x and nine tiles for 1 split into 3 equal rows, each 2x + 3, because 3 divides both 6 and 9. No larger number of equal rows is possible, since gcd(6, 9) = 3. Tiles as in lesson 1.2 (schematic).
Figure. The area model read backwards (lesson 1.7): the parts 8x² and 12x are given, and the common side 4x is found; the other sides are the parts divided by it, 2x and 3. Schematic.
Example (Two terms).

Factor out the GCF of 12x + 18.

  1. 12 = 2 × 2 × 3 and 18 = 2 × 3 × 3, so gcd(12, 18) = 2 × 3 = 6. The variable x is not in the term 18.
  2. The GCF is 6. Divide: 12x ÷ 6 = 2x, and 18 ÷ 6 = 3.
  3. Check: 6(2x + 3) = 12x + 18. At x = 1: 12 + 18 = 30 and 6 × 5 = 30.

Answer: 6(2x + 3). Inside the parentheses, gcd(2, 3) = 1: nothing more can be taken out.

Example (Three terms, two variables).

Factor out the GCF of 15a²b − 10ab² + 25ab.

  1. gcd(15, 10, 25) = 5.
  2. a occurs in every term, with exponents 2, 1, 1: take a. b occurs with exponents 1, 2, 1: take b. The GCF is 5ab.
  3. Divide each term: 15a²b ÷ 5ab = 3a; 10ab² ÷ 5ab = 2b; 25ab ÷ 5ab = 5.
  4. Check at a = b = 1: 15 − 10 + 25 = 30, and 5 × (3 − 2 + 5) = 5 × 6 = 30.

Answer: 5ab(3a − 2b + 5). Inside the parentheses gcd(3, 2, 5) = 1 and no variable is in all three terms.

Example (Edge cases: the GCF is a whole term, or 1).

Factor out the GCF of 7y² + 7y and of 4x + 9.

  1. gcd(7, 7) = 7, and y occurs with exponents 2 and 1: the GCF is 7y, which is the second term itself.
  2. 7y² ÷ 7y = y, and 7y ÷ 7y = 1. So 7y² + 7y = 7y(y + 1). Check at y = 2: 28 + 14 = 42 and 14 × 3 = 42.
  3. For 4x + 9: gcd(4, 9) = 1 and x is not in the term 9. The GCF is 1.

Answer: 7y(y + 1), where the 1 is needed; and 4x + 9 has no common factor other than 1 and −1.

Example (A common mistake: a common factor that is not the greatest).

Someone factors 18x² + 12x as 3x(6x + 4). Is it right? Is it finished?

  1. Expand: 3x(6x + 4) = 18x² + 12x. The factorization is correct.
  2. But 6 and 4 still have the common factor 2: 3x was a common factor, not the greatest one. gcd(18, 12) = 6, and x occurs in both terms, so the GCF is 6x.
  3. 18x² + 12x = 6x(3x + 2). Check at x = 1: 18 + 12 = 30 and 6 × 5 = 30.

Answer: correct but not finished; factoring out the GCF gives 6x(3x + 2), and by part (3) of the Theorem nothing more comes out.

Factoring out a negative factor

The factor −1 can always be taken out: −A − B = −(A + B) and −A + B = −(A − B), as expanding the right sides shows (lesson 1.7). So if F is a common factor, so is −F, and a factorization may take out either. By convention, when the first term is negative the negative is factored out as part of the GCF, so that the first term in the parentheses is positive.⁠[10] This is a choice, not a rule of arithmetic: both signs give a correct factorization.

Example (A negative first term).

Factor −14m − 21 and −9x² + 6x, taking out the negative of the GCF.

  1. gcd(14, 21) = 7 and no variable is common: take out −7. −14m ÷ (−7) = 2m, and −21 ÷ (−7) = 3: −7(2m + 3).
  2. gcd(9, 6) = 3 and x occurs in both: take out −3x. −9x² ÷ (−3x) = 3x, and 6x ÷ (−3x) = −2: −3x(3x − 2).
  3. Check at m = x = 1: −14 − 21 = −35 = −7 × 5; −9 + 6 = −3 = −3 × 1.

Answer: −7(2m + 3) and −3x(3x − 2). The sign of every term inside changed, as it must when −1 comes out.

Example (Reversing a difference).

Write 3 − x as −1 times a difference that starts with x.

  1. Take out −1: 3 − x = −(−3 + x), since expanding gives −(−3) − x = 3 − x.
  2. Reorder the sum inside: −3 + x = x − 3. So 3 − x = −(x − 3).
  3. Check at x = 10: 3 − 10 = −7, and −(10 − 3) = −7.

Answer: 3 − x = −(x − 3). A difference and the reversed difference are opposites.

Game

Factor out the greatest common factor

Round
1
Score
0
Streak
0

Build the greatest common factor of the terms: type its coefficient and choose the power of each variable. If the first term is negative, take the factor negative.

24x³ − 48x² + 56x
Power of x

Your factor: type a coefficient

Factoring out a fraction

The GCF of this lesson is defined for integer coefficients. When the coefficients are fractions, a fraction can be factored out so that the coefficients left are integers, which are easier to work with.⁠[11] Which fraction to take out is again a choice; a common one is 1 over a common denominator, or that times an integer common factor.

Example (Taking out a fraction).

Factor 23y − 4 and 0.6p + 1.2 so that the coefficients in the parentheses are integers.

  1. Take out 23: 23y ÷ 23 = y, and 4 ÷ 23 = 4 × 32 = 6. So 23y − 4 = 23(y − 6).
  2. 0.6 = 35 and 1.2 = 65 = 2 × 0.6. So 0.6p + 1.2 = 0.6(p + 2).
  3. Check: 23 × (−6) = −4, and 0.6 × 2 = 1.2. At y = 3: 2 − 4 = −2, and 23 × (−3) = −2.

Answer: 23(y − 6) and 0.6(p + 2).

Looking ahead.

Factoring rewrites a sum as an equivalent product; expanding does the reverse.⁠[12] A factored form shows things the sum hides: 12x + 18 = 6(2x + 3) shows at once that the value is a multiple of 6 whenever x is an integer. The unit Factoring goes on to factor sums whose terms have no common factor, such as x² + 5x + 6, and lesson 1.9, “Simplifying expressions”, puts expanding and combining together.

Exercises

Exercise .

Factor out the GCF: (a) 9a + 27; (b) 20m − 8; (c) 14x² + 21x; (d) 6pq − 9q.

▸ Show solution

(a) 9(a + 3); (b) gcd(20, 8) = 4: 4(5m − 2); (c) gcd(14, 21) = 7 and x is common: 7x(2x + 3); (d) gcd(6, 9) = 3 and only q is in both terms: 3q(2p − 3). Each expands back to the original.

Exercise .

Find the GCF of 18x³y², 24x²y⁴ and 30x⁴y³.

▸ Show solution

gcd(18, 24, 30) = 6 (18 = 2 × 3 × 3, 24 = 2 × 2 × 2 × 3, 30 = 2 × 3 × 5). x occurs with exponents 3, 2, 4: take x². y occurs with exponents 2, 4, 3: take y². The GCF is 6x²y².

Exercise .

Factor −8t² − 12t + 4, taking out the negative of the GCF, and check.

▸ Show solution

gcd(8, 12, 4) = 4, and t is not in the term 4. The first term is negative, so take out −4: −8t² − 12t + 4 = −4(2t² + 3t − 1). Check at t = 1: −8 − 12 + 4 = −16, and −4 × (2 + 3 − 1) = −16.

Exercise .

Which of these are correct factorizations, and which take out the GCF? (a) 10x + 5 = 5(2x); (b) 10x + 5 = 5(2x + 1); (c) 12y² − 8y = 2y(6y − 4); (d) 12y² − 8y = 4y(3y − 2).

▸ Show solution

(a) Wrong: 5(2x) expands to 10x, not 10x + 5; at x = 0 the values are 0 and 5. (b) Right, and complete: 5(2x + 1) = 10x + 5, gcd(2, 1) = 1.

(c) Correct, since 2y(6y − 4) = 12y² − 8y, but not complete: 6 and 4 still share 2. (d) Right and complete: the GCF of 12y² and 8y is 4y.

Exercise .

Factor so that the coefficients in the parentheses are integers: (a) 35a + 65; (b) 1.5k − 4.5.

▸ Show solution

(a) 65 = 2 × 35, so 35a + 65 = 35(a + 2). (b) 4.5 = 3 × 1.5, so 1.5k − 4.5 = 1.5(k − 3). Check (b) at k = 1: 1.5 − 4.5 = −3, and 1.5 × (−2) = −3.

Exercise .

Prove that the sum of any four consecutive odd whole numbers is a multiple of 8.

▸ Show solution

An odd whole number is 2k + 1 for a whole number k (Factors, Multiples & Primes 1.3), and the next odd numbers after it are 2 more each time. So four consecutive odd whole numbers are 2k + 1, 2k + 3, 2k + 5 and 2k + 7. Their sum is 8k + 16 by combining like terms, and factoring out 8 gives 8(k + 2).

k + 2 is a whole number, so the sum is a multiple of 8. Check with k = 0: 1 + 3 + 5 + 7 = 16 = 8 × 2.

Exercise .

Explain why x³ is the GCF of x⁵ and x³, and factor x⁵ − x³.

▸ Show solution

By the Proposition on splitting a power, x⁵ = x³ · x², so x³ is a factor of x⁵, and x³ = x³ · 1: it is a common factor. A common factor xk needs k ≤ 3, so x³ is the greatest: x⁵ − x³ = x³(x² − 1).

Check at x = 2: 32 − 8 = 24, and 8 × (4 − 1) = 24.

Summary

  1. Factoring writes an expression as a product. Factoring out a common factor is the distributive law read backwards, FA + FB = F(A + B), and the result is equivalent to the sum.
  2. For terms with integer coefficients, the greatest common factor is the gcd of the sizes of the coefficients times each variable common to all the terms, raised to its smallest exponent. Every common factor divides it, and after it is taken out nothing but 1 and −1 is common.
  3. A whole term may be the GCF; then 1 is left in its place. If the GCF is 1, no common factor other than ±1 can be taken out.
  4. By convention, when the first term is negative the negative of the GCF is taken out. Fractions can be taken out too, to leave integer coefficients.
  5. Every factorization is checked by expanding it; a value at which the two forms differ proves a mistake.

Sources

  1. 1.
    Lynn Marecek, MaryAnne Anthony-Smith and Andrea Honeycutt Mathis, Elementary Algebra (2nd ed., OpenStax, Rice University, 2020).
    Chapter 7, “Factoring”, section 7.1, “Greatest Common Factor and Factor by Grouping” (“Factor the Greatest Common Factor from a Polynomial”), p. 811 (the whole topic: pp. 810–811).
    “The form on the left is used to multiply. The form on the right is used to factor.”
    Used for: the distributive law a(b + c) = ab + ac is used to multiply (expand), and read backwards, ab + ac = a(b + c), to factor.
  2. 2.
    Lynn Marecek, MaryAnne Anthony-Smith and Andrea Honeycutt Mathis, Elementary Algebra (2nd ed., OpenStax, Rice University, 2020).
    Chapter 7, “Factoring”, section 7.1, “Greatest Common Factor and Factor by Grouping” (“Find the Greatest Common Factor of Two or More Expressions”), p. 808 (the whole topic: pp. 808–810).
    “Splitting a product into factors is called factoring.”
    Used for: to factor an expression is to write it as a product of factors.
  3. 3.
    Lynn Marecek, MaryAnne Anthony-Smith and Andrea Honeycutt Mathis, Elementary Algebra (2nd ed., OpenStax, Rice University, 2020).
    Chapter 7, “Factoring”, section 7.1, “Greatest Common Factor and Factor by Grouping” (“Factor as a Noun and a Verb”), p. 811 (the whole topic: pp. 811).
    “We use “factor” as both a noun and a verb.”
    Used for: the word factor is a noun and a verb.
  4. 4.
    Lynn Marecek, MaryAnne Anthony-Smith and Andrea Honeycutt Mathis, Elementary Algebra (2nd ed., OpenStax, Rice University, 2020).
    Chapter 7, “Factoring”, section 7.1, “Greatest Common Factor and Factor by Grouping” (“Factor the Greatest Common Factor from a Polynomial”), p. 811 (the whole topic: pp. 810–815).
    “Check by multiplying the factors.”
    Used for: a factorization is checked by expanding it (the last step of the source’s procedure).
  5. 5.
    Kenneth H. Rosen, Discrete Mathematics and Its Applications (8th ed., McGraw-Hill, 2019).
    Chapter 4, “Number Theory and Cryptography”, section 4.3, “Primes and Greatest Common Divisors” (4.3.6, “Greatest Common Divisors and Least Common Multiples”), p. 280 (the whole topic: pp. 280–281).
    “The largest integer that divides both of two integers is called the greatest common divisor of these integers.”
    Used for: the greatest common divisor of two integers is the largest integer dividing both.
  6. 6.
    David M. Burton, Elementary Number Theory (7th ed., McGraw-Hill, 2011).
    Chapter 2, “Divisibility Theory in the Integers”, section 2.4, “The Euclidean Algorithm”, p. 30 (the whole topic: pp. 30–31).
    “In the case of three integers, a, b, c, not all zero, gcd(a, b, c) is defined to be the positive integer d having the following properties”
    Used for: the gcd of three or more integers, not all 0, is defined in the same way.
  7. 7.
    Lynn Marecek, MaryAnne Anthony-Smith and Andrea Honeycutt Mathis, Elementary Algebra (2nd ed., OpenStax, Rice University, 2020).
    Chapter 7, “Factoring”, section 7.1, “Greatest Common Factor and Factor by Grouping” (“Find the Greatest Common Factor of Two or More Expressions”), p. 808 (the whole topic: pp. 808–810).
    “The greatest common factor (GCF) of two or more expressions is the largest expression that is a factor of all the expressions.”
    Used for: the name greatest common factor (GCF): the largest expression that is a factor of all the terms.
  8. 8.
    Lynn Marecek, MaryAnne Anthony-Smith and Andrea Honeycutt Mathis, Elementary Algebra (2nd ed., OpenStax, Rice University, 2020).
    Chapter 7, “Factoring”, section 7.1, “Greatest Common Factor and Factor by Grouping” (“Find the Greatest Common Factor of Two or More Expressions”), p. 809 (the whole topic: pp. 808–810).
    “Factor each coefficient into primes. Write all variables with exponents in expanded form.”
    Used for: the GCF of terms is found from the prime factorizations of the coefficients and from the variables written out as products (the source’s procedure).
  9. 9.
    Lynn Marecek, MaryAnne Anthony-Smith and Andrea Honeycutt Mathis, Elementary Algebra (2nd ed., OpenStax, Rice University, 2020).
    Chapter 7, “Factoring”, section 7.1, “Greatest Common Factor and Factor by Grouping” (“Factor the Greatest Common Factor from a Polynomial”), p. 812 (the whole topic: pp. 810–815).
    “Remember to write the GCF as the product of all the common factors.”
    Used for: the GCF is the product of all the common factors: the gcd of the coefficients and each common variable to its smallest power.
  10. 10.
    Lynn Marecek, MaryAnne Anthony-Smith and Andrea Honeycutt Mathis, Elementary Algebra (2nd ed., OpenStax, Rice University, 2020).
    Chapter 7, “Factoring”, section 7.1, “Greatest Common Factor and Factor by Grouping” (“Factor the Greatest Common Factor from a Polynomial”), p. 815 (the whole topic: pp. 815–816).
    “When the leading coefficient is negative, we factor the negative out as part of the GCF.”
    Used for: the convention: when the first term is negative, the negative of the GCF is factored out.
  11. 11.
    H. Wu, Introduction to School Algebra (draft of July 24, 2010, Department of Mathematics, University of California, Berkeley, 2010).
    Chapter 1, “Symbolic Expressions”, section “Polynomials and order of operations”, p. 26 (the whole topic: pp. 25–26).
    “we rewrite the polynomial by using the distributive law to take out the denominators of all the coefficients, as follows.”
    Used for: a fraction can be factored out so that the coefficients left are integers, which are easier to deal with (p. 26: “it is much easier to deal with integers rather than rational numbers”).
  12. 12.
    National Governors Association Center for Best Practices and Council of Chief State School Officers, “Common Core State Standards for Mathematics”, Common Core State Standards Initiative (2010).
    Section “Expressions and Equations, standard 6.EE.3 (p. 44)”. corestandards.org/wp-content/uploads/2023/09/Math_Standards1.pdf · open at the quoted passage.
    “apply the distributive property to the expression 24x + 18y to produce the equivalent expression 6 (4x + 3y)”
    Used for: factoring by the distributive property produces an equivalent expression.