Expanding and Factoring Expressions

Learning goals

  • Expand a product so the factor reaches every term
  • Multiply two expressions by pairing every term with every term
  • Treat FOIL as a name for four products, not a general rule
  • Factor by pulling out the greatest common factor
  • Check any factoring by re-expanding it

Expanding a factor across every term

To expand a product is to multiply it out into a sum, using the distributive law. You met the law for a sum of two terms, a(b+c)=ab+aca(b + c) = ab + ac, but the law is not limited to two terms. The factor out front multiplies every term inside the parentheses, however many there are.

Why a(b+c+d)=ab+ac+ada(b + c + d) = ab + ac + ad#

To expand 2(4+5+7)2(4+5+7) using the two-term law, first group 4+54+5 as one quantity:

2((4+5)+7)=2(4+5)+2⋅7=2⋅4+2⋅5+2⋅7.\begin{aligned} 2\big((4+5)+7\big)&=2(4+5)+2\cdot7\\ &=2\cdot4+2\cdot5+2\cdot7. \end{aligned}

Now use the same grouping with any real numbers a,b,c,da,b,c,d:

a((b+c)+d)=a(b+c)+ad=ab+ac+ad.\begin{aligned} a\big((b+c)+d\big)&=a(b+c)+ad\\ &=ab+ac+ad. \end{aligned}

Each application of the two-term law separates another term. Repeating this for a longer finite sum reaches every term, so the outside factor multiplies them all.

The factor can contain a sign or a variable. Use the same rule, keeping the sign and applying the exponent laws: x⋅x=x2x\cdot x=x^2 and x⋅x2=x3x\cdot x^2=x^3. A negative factor changes each term’s sign, as the leading minus did in the previous lesson.

Worked example 1 Expand three products

In each product, multiply the outside factor against every inside term, keeping each sign.

Distributing a negative number across a difference, the sign of each term flips:

−3(x−4)=(−3)(x)+(−3)(−4)=−3x+12.\begin{aligned}-3(x - 4)&=(-3)(x)+(-3)(-4)\\&=-3x+12.\end{aligned}

Distributing a single variable, the powers add where the variable meets itself:

x(2x+3)=x⋅2x+x⋅3=2x2+3x.x(2x + 3) = x \cdot 2x + x \cdot 3 = 2x^2 + 3x.

Distributing a term that carries both a coefficient and a power, handle the numbers and the exponents separately:

2x2(3x−5)=2x2⋅3x−2x2⋅5=6x3−10x2.\begin{aligned}2x^2(3x - 5)&=2x^2\cdot3x-2x^2\cdot5\\&=6x^3-10x^2.\end{aligned}

A leading minus is an outside factor of −1-1. Thus the previous lesson’s rule a−(b+c)=a−b−ca-(b+c)=a-b-c is another use of distribution.

Check your understanding

Expand −2x(3x−4)-2x(3x - 4).

Answer choices

Multiplying two expressions

To picture (a+b)(c+d)(a+b)(c+d), take positive lengths a,b,c,da,b,c,d. Split a rectangle of width a+ba+b and height c+dc+d along both directions. Each of its four pieces pairs one width with one height.

Area model for multiplying two sumsFor positive lengths a, b, c, and d, a rectangle of width a plus b and height c plus d is divided by one vertical and one horizontal line into four cells with areas ac, bc, ad, and bd, whose sum is the product of the two sums.abcdacbcadbd(a + b)(c + d) = ac + bc + ad + bd
For positive lengths a, b, c, and d, a rectangle with width a plus b and height c plus d splits into four areas: ac, bc, ad, and bd. Their total is the whole area. The product identity also holds for all real values.

The picture shows where the four products come from when the lengths are positive. Using distribution, we get the same rule for all real numbers, including negatives.

Why (a+b)(c+d)=ac+bc+ad+bd(a + b)(c + d) = ac + bc + ad + bd#

Start with (2+3)(4+6)(2+3)(4+6). Treat 2+32+3 as one factor, then distribute again inside each product:

(2+3)(4+6)=(2+3)4+(2+3)6=2⋅4+3⋅4+2⋅6+3⋅6.\begin{aligned}&(2+3)(4+6)\\&=(2+3)4+(2+3)6\\&=2\cdot4+3\cdot4\\&\quad+2\cdot6+3\cdot6.\end{aligned}

The same steps work for any real a,b,c,da,b,c,d:

(a+b)(c+d)=(a+b)c+(a+b)d=ac+bc+ad+bd.\begin{aligned} (a+b)(c+d)&=(a+b)c+(a+b)d\\ &=ac+bc+ad+bd. \end{aligned}

Every term in one factor multiplies every term in the other. Repeated distribution works the same way with longer factors; after forming all the products, combine like terms.

A binomial has two terms. For two binomials, FOIL is a memory aid for the four products: First, Outer, Inner, Last. In (a+b)(c+d)(a+b)(c+d), the first terms give acac, the outer terms aa and dd give adad, the inner terms bb and cc give bcbc, and the last terms give bdbd. These are the same four products that distribution gives, so FOIL is not a separate rule.

With three terms in a factor, four pairings are not enough. Use the general rule, every term times every term. An expression with three terms is a trinomial.

Worked example 2 Multiply two binomials

Multiply every term of the first factor by every term of the second, then gather like terms.

For (x+2)(x+3)(x + 2)(x + 3), the four products are x⋅xx \cdot x, x⋅3x \cdot 3, 2⋅x2 \cdot x, and 2⋅32 \cdot 3:

(x+2)(x+3)=x2+3x+2x+6.(x + 2)(x + 3) = x^2 + 3x + 2x + 6.

The middle terms 3x3x and 2x2x are like terms, so combine them:

x2+3x+2x+6=x2+5x+6.x^2 + 3x + 2x + 6 = x^2 + 5x + 6.

The same method handles coefficients and negatives. For (2x−1)(x+4)(2x - 1)(x + 4),

(2x−1)(x+4)=2x2+8x−x−4=2x2+7x−4,\begin{aligned}(2x - 1)(x + 4)&=2x^2+8x-x-4\\&=2x^2+7x-4,\end{aligned}

where 2x⋅x=2x22x \cdot x = 2x^2, the outer and inner products 8x8x and −x-x combine to 7x7x, and (−1)(4)=−4(-1)(4) = -4.

Check your understanding

Multiply (x+4)(x+2)(x + 4)(x + 2).

Answer choices

Worked example 3 Multiply a binomial by a trinomial

Multiply each of the two terms of x+2x + 2 against all three terms of x2+3x−1x^2 + 3x - 1:

(x+2)(x2+3x−1)=x(x2+3x−1)+2(x2+3x−1).\begin{aligned}&(x + 2)(x^2+3x-1)\\&=x(x^2+3x-1)\\&\quad+2(x^2+3x-1).\end{aligned}

Expand each product:

x(x2+3x−1)=x3+3x2−x,2(x2+3x−1)=2x2+6x−2.\begin{aligned} x(x^2+3x-1)&=x^3+3x^2-x,\\ 2(x^2+3x-1)&=2x^2+6x-2. \end{aligned}

Add them and combine the like x2x^2 terms and the like xx terms:

x3+3x2−x+2x2+6x−2=x3+5x2+5x−2.\begin{aligned}&x^3+3x^2-x+2x^2+6x-2\\&=x^3+5x^2+5x-2.\end{aligned}

That is six products in all, one for each pairing of a term from the first factor with a term from the second.

Check your understanding

How many products does multiplying (x2+4x−3)(x+5)(x^2 + 4x - 3)(x + 5) require, before combining any like terms?

Answer choices

Two products with a shortcut shape

Some binomial products have middle terms that cancel, or two equal middle terms that add. In a sum times a difference of the same two terms, the middle products cancel:

(x+5)(x−5)=x2−5x+5x−25=x2−25.\begin{aligned}&(x + 5)(x - 5)\\&=x^2-5x+5x-25\\&=x^2-25.\end{aligned}

Here −5x+5x=0-5x+5x=0. For a squared binomial, write the square as a product with itself:

(x+3)2=(x+3)(x+3)=x2+3x+3x+9=x2+6x+9.\begin{aligned}(x + 3)^2&=(x + 3)(x + 3)\\&=x^2+3x+3x+9\\&=x^2+6x+9.\end{aligned}

Here 3x+3x=6x3x+3x=6x, so the middle term stays. Both patterns follow from ordinary distribution; you can rebuild them whenever you need them.

Factoring by reversing distribution

Factoring rewrites a sum as a product. Here you will pull out a factor shared by every term, using the distributive law backward.

Why pulling out a common factor is the distributive law reversed#

The numbers 1212 and 1818 both contain a factor of 66. Reading distribution backward gives

12+18=6⋅2+6⋅3=6(2+3).12+18=6\cdot2+6\cdot3=6(2+3).

The same reasoning works for expressions. Since 6x=3⋅2x6x=3\cdot2x and 9=3⋅39=3\cdot3,

6x+9=3⋅2x+3⋅3=3(2x+3).6x+9=3\cdot2x+3\cdot3=3(2x+3).

For x2+3xx^2+3x, the shared factor is xx:

x2+3x=x⋅x+x⋅3=x(x+3).x^2+3x=x\cdot x+x\cdot3=x(x+3).

In general, ab+ac=a(b+c)ab+ac=a(b+c), the distributive law read in reverse. The common factor moves outside; the remaining factors stay inside. Expanding the product returns the original sum, which checks the factoring.

The greatest common factor, or GCF, contains all the numerical and variable factors shared by every term. For terms with integer coefficients, its numerical part is the greatest common divisor of the coefficients’ absolute values, and the variable part is each common variable raised to the smallest power that appears. For 4x2+6x4x^2 + 6x the coefficients 44 and 66 share the factor 22, and both terms contain at least one xx, so the GCF is 2x2x. Pulling it out,

4x2+6x=2x⋅2x+2x⋅3=2x(2x+3).4x^2 + 6x = 2x \cdot 2x + 2x \cdot 3 = 2x(2x + 3).

If you take out less than the full GCF, you are not finished yet. The forms 2(2x2+3x)2(2x^2 + 3x) and x(4x+6)x(4x + 6) are both correct, but each still has a common factor left inside. In this lesson, factoring completely means removing the full GCF; later chapters develop other factoring methods.

For x>0x>0, the area model reads backward too. A rectangle whose area is 6x+96x + 9 and whose height is the common factor 33 must have width 2x+32x + 3.

Area model for factoring out a common factorFor x greater than zero, a rectangle of height 3 is split into a left cell of area 6x below the top width 2x and a right cell of area 9 below the top width 3, so the total area 6x plus 9 equals 3 times the quantity 2x plus 3.2x336x96x + 9 = 3(2x + 3)
For x greater than zero, a rectangle of height 3 and width 2x plus 3 is split into parts with areas 6x and 9. Pulling out their common height gives 6x plus 9 equals 3 times the quantity 2x plus 3. The identity also holds for all real x.

Worked example 4 Factor out the greatest common factor

Find the GCF, lift it out, then confirm the answer by expanding it again.

For 12x2−8x12x^2 - 8x, the coefficients 1212 and 88 share 44 and both terms contain xx, so the GCF is 4x4x:

12x2−8x=4x(3x−2).12x^2 - 8x = 4x(3x - 2).

To check, expand the answer and compare it with the original: 4x(3x−2)=12x2−8x4x(3x - 2) = 12x^2 - 8x.

Check your understanding

Factor out the greatest common factor of 8x2+12x8x^2 + 12x.

Answer choices

Check your understanding

A student claims that 9x2+6x=3x(3x+6)9x^2 + 6x = 3x(3x + 6). Which result do you get by expanding the right side to check the claim?

Answer choices

Common mistakes

Practice

Multiple Choice Questions (MCQ)

Progressively harder sets of questions. Each opens on its own page.

Core practice

Practice problems at the level of the course, to be worked out on paper. Hints one at a time, then the answer or the full worked solution, with your progress kept in this browser.

Core practice Work it out on paper 10 problems Start →
More practice (optional)

Extra sets, as hard as the Challenge set. Each one opens on its own page.

More resources (optional)

Other explanations of this lesson, if you want a second take.

A bit of history (optional)

The rectangle argument is more than two thousand years old. Around 300 BCE, Euclid collected geometric results in the Elements. Book II describes relationships among lines, rectangles, and squares without our modern algebraic notation. Letters label points in diagrams rather than unknown numbers.

Its first proposition starts with two line segments and cuts one into pieces. The rectangle made from the two original segments has the same area as the smaller rectangles made from the pieces and the uncut segment. With two pieces, modern symbols express this as a(b+c)=ab+aca(b+c)=ab+ac. Euclid proved it by drawing the rectangles and showing how they fit together.

The same picture still helps us expand (a+b)(c+d)(a+b)(c+d) into four areas. Reading an area as a product of side lengths also helps us see factoring: an area 6x+96x+9 with height 33 has width 2x+32x+3. The word factor comes from Latin for a maker or doer; factors are the quantities whose product makes the expression.

Sources: Euclid, Book II, Proposition 1; the origin of factor.

Your progress

See all your progress →