This site is a work in progress. New lessons are added regularly. Contact us

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 nothing about it stops at two terms. The factor out front reaches every term inside the parentheses, however many there are.

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

The distributive law is stated for a sum of two terms, a(b+c)=ab+aca(b + c) = ab + ac, but a sum can have more terms than that. To see that the factor still reaches each one, group the extra terms and apply the two-term law twice. Treat b+c+db + c + d as (b+c)+d(b + c) + d, a sum of the single quantity b+cb + c and the term dd:

a((b+c)+d)=a(b+c)+ad.a\big((b + c) + d\big) = a(b + c) + ad.

That is the two-term law with b+cb + c playing the role of the first term. Now distribute across the remaining pair:

a(b+c)+ad=ab+ac+ad.a(b + c) + ad = ab + ac + ad.

The factor aa has multiplied every term inside. The same grouping works for a sum of any length, so a factor outside a parenthesis multiplies each term within it, one at a time. That is the whole content of expanding: no term is ever skipped.

The factor out front need not be a bare number. It can carry a sign or a variable, and the rule does not change: multiply it against each term, following the sign and exponent rules you already know. When two powers of the same base meet, their exponents add, so xx=x2x \cdot x = x^2 and xx2=x3x \cdot x^2 = x^3. A negative factor flips the sign of each term it lands on, exactly as a leading minus did in the last lesson. The flip happens because a minus sign in front is the factor 1-1 waiting to be distributed.

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(x4)=(3)(x)+(3)(4)=3x+12.-3(x - 4) = (-3)(x) + (-3)(-4) = -3x + 12.

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

x(2x+3)=x2x+x3=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(3x5)=2x23x2x25=6x310x2.2x^2(3x - 5) = 2x^2 \cdot 3x - 2x^2 \cdot 5 = 6x^3 - 10x^2.

In each case the factor reached both terms. The second term is never left behind.

One case deserves a second look, because the factor is hidden. Subtracting a whole group, as in a(b+c)a - (b + c), is the same as multiplying that group by 1-1 and adding, so every term inside changes sign:

a(b+c)=abc,(ab)=a+b.a - (b + c) = a - b - c, \qquad -(a - b) = -a + b.

This is the leading-minus rule from the last lesson seen as one more case of expanding, with the hidden factor being 1-1.

Check your understanding

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

Answer choices

Multiplying two expressions

Multiplying two multi-term expressions, such as (a+b)(c+d)(a + b)(c + d), looks like a new problem, but it is the distributive law applied twice. The idea is to treat the first factor as a single quantity for a moment. Nothing in the distributive law requires the outside factor to be short, so let the whole of a+ba + b play that role.

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

Treat the first factor a+ba + b as a single quantity, and call it QQ while it plays that part. The product becomes Q(c+d)Q(c + d), and the distributive law spreads QQ across the second sum:

Q(c+d)=Qc+Qd.Q(c + d) = Qc + Qd.

Now restore Q=a+bQ = a + b and distribute each piece the other way, spreading cc and then dd across a+ba + b:

Qc=(a+b)c=ac+bc,Qd=(a+b)d=ad+bd.Qc = (a + b)c = ac + bc, \qquad Qd = (a + b)d = ad + bd.

Adding the four pieces gives

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

Every term of the first factor has multiplied every term of the second, producing one product for each pairing. Reordered, that is ac+ad+bc+bdac + ad + bc + bd, the four pairwise products. Because the argument used nothing but the distributive law, it does not stop at two terms each. So to multiply any two expressions, multiply every term of the first by every term of the second, then combine like terms.

The picture behind this is a rectangle again. Give it a width of a+ba + b and a height of c+dc + d. The two splits carve it into four smaller rectangles, and their areas are exactly the four products.

Area model for multiplying two sumsA 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 + ad + bc + bd
A rectangle with width a plus b and height c plus d splits into four smaller rectangles with areas ac, bc, ad, and bd. Their total is the whole area, so the product of the two sums equals the sum of the four pairwise products.

For the common case of two two-term factors, the four products come in a memorable order. Reading (a+b)(c+d)(a + b)(c + d) left to right, they are the product of the First terms acac and the Outer terms adad. Then come the Inner terms bcbc and the Last terms bdbd, so the four initials spell the mnemonic FOIL. It is a handy way to be sure you have all four products, but it is only a name for what the distributive law already told you. FOIL works only when each factor has exactly two terms. The underlying rule, every term times every term, is what you fall back on the moment a factor has three terms or more.

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 xxx \cdot x, x3x \cdot 3, 2x2 \cdot x, and 232 \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 (2x1)(x+4)(2x - 1)(x + 4),

(2x1)(x+4)=2x2+8xx4=2x2+7x4,(2x - 1)(x + 4) = 2x^2 + 8x - x - 4 = 2x^2 + 7x - 4,

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

Worked example 3 Multiply a binomial by a trinomial

When a factor has three terms, FOIL no longer applies, but every term times every term still does. Multiply each of the two terms of x+2x + 2 against all three terms of x2+3x1x^2 + 3x - 1:

(x+2)(x2+3x1)=x(x2+3x1)+2(x2+3x1).(x + 2)(x^2 + 3x - 1) = x(x^2 + 3x - 1) + 2(x^2 + 3x - 1).

Expand each product:

x(x2+3x1)=x3+3x2x,2(x2+3x1)=2x2+6x2.x(x^2 + 3x - 1) = x^3 + 3x^2 - x, \qquad 2(x^2 + 3x - 1) = 2x^2 + 6x - 2.

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

x3+3x2x+2x2+6x2=x3+5x2+5x2.x^3 + 3x^2 - x + 2x^2 + 6x - 2 = x^3 + 5x^2 + 5x - 2.

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

Worked example 4 Expand two products that look special

Some products have a tidy shape, and expanding them is the same distribution as always. Take a sum times a difference of the same two terms:

(x+5)(x5)=x25x+5x25=x225.(x + 5)(x - 5) = x^2 - 5x + 5x - 25 = x^2 - 25.

The two middle terms 5x-5x and 5x5x cancel, leaving only x225x^2 - 25. A squared binomial is a product with itself:

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

Here the middle terms add rather than cancel, giving the 6x6x. Both results come straight from multiplying every term by every term; there is nothing to memorize beyond the method you already have.

Check your understanding

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

Answer choices

Factoring by reversing distribution

Expanding turns a product into a sum. Factoring runs the machine backward: it turns a sum into a product by pulling out a factor shared by every term. The tool is the distributive law read from right to left, ab+ac=a(b+c)ab + ac = a(b + c), which says a factor common to each term can be lifted outside a parenthesis.

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

The distributive law, read left to right, expands: a(b+c)=ab+aca(b + c) = ab + ac. Every equation can be read in either direction, so read this one right to left:

ab+ac=a(b+c).ab + ac = a(b + c).

This says that if a factor aa appears in every term of a sum, it can be pulled out to the front. The other factors of each term stay behind inside the parenthesis. Nothing new is needed; it is the same identity, used in reverse.

To factor 6x+96x + 9, look for a factor common to both terms. Since 6x=32x6x = 3 \cdot 2x and 9=339 = 3 \cdot 3, the number 33 divides each, so lift it out:

6x+9=32x+33=3(2x+3).6x + 9 = 3 \cdot 2x + 3 \cdot 3 = 3(2x + 3).

For x2+3xx^2 + 3x the shared factor is the variable xx, because x2=xxx^2 = x \cdot x and 3x=x33x = x \cdot 3:

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

In both cases you can check the result at once by expanding it again: 3(2x+3)=6x+93(2x + 3) = 6x + 9 and x(x+3)=x2+3xx(x + 3) = x^2 + 3x, right back to where you started.

The factor worth pulling out is the greatest common factor, or GCF: the largest factor every term shares. It has two parts. The numerical part is the greatest common divisor of the coefficients, 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=2x2x+2x3=2x(2x+3).4x^2 + 6x = 2x \cdot 2x + 2x \cdot 3 = 2x(2x + 3).

Taking out less than the full GCF leaves the job unfinished. The forms 2(2x2+3x)2(2x^2 + 3x) and x(4x+6)x(4x + 6) are both correct as far as they go, but each still hides a shared factor inside, so neither is fully factored.

The area model reads backward here too. A rectangle whose area is 6x+96x + 9 and whose height is the common factor 33 must have width 2x+32x + 3. So factoring is just naming the side lengths of the rectangle you already drew when expanding.

Area model for factoring out a common factorA rectangle of height 3 is split into a left cell of area 6x above the width 2x and a right cell of area 9 above the width 3, so the total area 6x plus 9 equals 3 times the quantity 2x plus 3.2x336x96x + 9 = 3(2x + 3)
A rectangle of height 3 and width 2x plus 3 has area 6x plus 9, split into a part of area 6x and a part of area 9. Reading the common height 3 as a factor pulled out front shows 6x plus 9 equals 3 times the quantity 2x plus 3.

Worked example 5 Factor out the greatest common factor

In each expression, find the GCF and lift it out, then confirm the answer by expanding it again.

For 6x+96x + 9, the coefficients 66 and 99 share 33 and there is no common variable, so the GCF is 33:

6x+9=3(2x+3).6x + 9 = 3(2x + 3).

For x2+3xx^2 + 3x, both terms contain xx while the coefficients 11 and 33 share only 11, so the GCF is xx:

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

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

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

Expanding each answer returns the original, which is the check that the factoring is right: 4x(3x2)=12x28x4x(3x - 2) = 12x^2 - 8x, as it should.

Check your understanding

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

Answer choices

Common mistakes

Practice

Multiple Choice Questions (MCQ)

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

Free Response Questions (FRQ)

Longer questions in parts, to be worked out on paper. Progressive hints, the answer on its own so you can check yourself and try again, then the full worked solution, plus a rubric to mark your own work against.

Free response Work it out on paper 5 questions 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 you cut apart in this lesson is about twenty-three centuries old.

Around 300 BCE, Euclid gathered the geometry of his day into a work called the Elements. Book II of it reads oddly to a modern eye. Its propositions mention no numbers and no letters whatever. They concern lines, rectangles and squares, and nothing else. One of them says this. Cut a straight line into two parts. Then the rectangle standing on the whole line equals the two rectangles standing on the parts. Rewrite that sentence in symbols and you have the distributive law, a(b+c)=ab+aca(b + c) = ab + ac.

Euclid could not have written it that way. Algebraic notation was still nineteen centuries in his future. So he proved the fact by the only route available to him, which was drawing the rectangle and dividing it.

The picture never left. Slicing a rectangle into acac, adad, bcbc and bdbd to expand (a+b)(c+d)(a + b)(c + d) is Book II with modern labels. Reading that same rectangle backward is equally Book II. You were handed a height of 33 and an area of 6x+96x + 9, and you recovered the width 2x+32x + 3. A Greek geometer would have described that as naming a side, and you described it as factoring. Factor is Latin for one who makes, so the factors of an expression are simply its makers.