Unit 2, lesson 8

Expanding and Factoring for a Purpose

How to tell terms from factors, expand a product or a square without losing the cross terms, factor a difference of squares completely over the reals, and check each rewrite by reversing it.

  • Theory part 15
  • Practice part 16
  • Rewriting Expressions

The same expression can be written in several ways, and each way is good at something different. The factored form (x−2)(x+2)(x - 2)(x + 2) shows at a glance where the expression is zero and where it changes sign. The expanded form x2−4x^2 - 4 is easier to add to or subtract from other polynomials, term by term. Calculus asks you to switch between these forms all the time, so the useful skill is choosing the form that fits the job and checking that nothing changed along the way.

Key terms

Term

Definition The terms of an expression are the parts that are added together at the top level. A subtraction counts as adding the opposite, so in a−ba - b the terms are aa and −b-b. A part inside parentheses belongs to a single term until the parentheses are removed.

In plain words Terms are the pieces separated by plus and minus signs that are not hidden inside parentheses. Each term carries its own sign.

Example The expression 3x2−5x+23x^2 - 5x + 2 has three terms, 3x23x^2, −5x-5x and 22. The expression 3(x+2)3(x + 2) has only one term, a product, even though x+2x + 2 has two terms of its own inside.

Factor

Definition The factors of an expression are the parts that are multiplied together at the top level. For polynomials, a polynomial qq is a factor of a polynomial PP when P=q⋅rP = q \cdot r for some polynomial rr.

In plain words Factors are joined by multiplication, terms are joined by addition. Cancelling in a fraction works only with a factor shared by the whole numerator and the whole denominator, and only where that factor is not zero. It never works with terms.

Example In 3x(x+2)3x(x + 2) the factors are 33, xx and x+2x + 2. In x2+2xx^2 + 2x, by contrast, xx is a factor of each term but the expression as written is a sum. Writing it as x(x+2)x(x + 2) makes xx a factor of the whole expression. This is why

x2+2xx=x+2,x≠0,\frac{x^2 + 2x}{x} = x + 2, \qquad x \ne 0,

works, while cancelling the xx in x+2x\frac{x + 2}{x} would be wrong, because there xx is a term of the numerator, not a factor.

Distributive property

Definition For all real numbers aa, bb and cc,

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

Read left to right it multiplies out a product. Read right to left it pulls out a common factor.

In plain words Multiplying a sum means multiplying each of its terms. Going backwards, a factor that every term shares can be taken outside parentheses.

Example Left to right, 4x(x−3)=4x2−12x4x(x - 3) = 4x^2 - 12x. Right to left, 6x2+9x=3x(2x+3)6x^2 + 9x = 3x(2x + 3). Check the second one by distributing again, since 3x⋅2x+3x⋅3=6x2+9x3x \cdot 2x + 3x \cdot 3 = 6x^2 + 9x.

Expansion

Definition To expand a product is to rewrite it as a sum of terms by applying the distributive property until no product of sums remains, then combining like terms. For two sums, every term of the first is multiplied by every term of the second.

In plain words Multiply everything by everything, then collect what matches.

Example Expanding (x+3)(x−5)(x + 3)(x - 5) gives four products before combining,

(x+3)(x−5)=x2−5x+3x−15=x2−2x−15.\begin{aligned} &(x + 3)(x - 5) \\[0.4em] &\quad = x^2 - 5x + 3x - 15 \\[0.4em] &\quad = x^2 - 2x - 15. \end{aligned}

A quick test at x=1x = 1 gives (4)(−4)=−16(4)(-4) = -16 on the left and 1−2−15=−161 - 2 - 15 = -16 on the right. A test like this can catch a mistake, but agreement at one number does not prove two expressions are equal.

Square of a sum

Definition For all real numbers aa and bb,

(a+b)2=a2+2ab+b2,(a + b)^2 = a^2 + 2ab + b^2,

and, replacing bb by −b-b,

(a−b)2=a2−2ab+b2.(a - b)^2 = a^2 - 2ab + b^2.

The middle term 2ab2ab comes from two separate products, abab and baba, when (a+b)(a+b)(a + b)(a + b) is expanded. A square of side a+ba + b with a>0a > 0 and b>0b > 0 splits into a square of area a2a^2, a square of area b2b^2 and two rectangles of area abab each. That picture needs nonnegative lengths, but the identity itself holds for every real aa and bb.

In plain words Squaring a sum is not squaring each piece. You also get twice the product of the two pieces, the cross term.

Example Expanding gives (x+5)2=x2+10x+25(x + 5)^2 = x^2 + 10x + 25. The tempting wrong answer x2+25x^2 + 25 fails already at x=1x = 1, where (1+5)2=36(1 + 5)^2 = 36 but 1+25=261 + 25 = 26. Calculus uses this identity in difference quotients, for instance

(3+h)2=9+6h+h2.(3 + h)^2 = 9 + 6h + h^2.

Factorization

Definition To factor an expression is to rewrite it as a product. A polynomial with real coefficients is factored completely over the reals when it is written as a constant times nonconstant polynomials with real coefficients, none of which can be written as a product of two real polynomials of lower degree. Over the reals such unbreakable factors are the linear ones and the quadratics with no real zero. A quadratic factor px2+qx+rpx^2 + qx + r with p≠0p \ne 0 can be split further over the reals exactly when it has a real zero, that is, when q2−4pr≥0q^2 - 4pr \ge 0.

In plain words Factoring is expansion run backwards. Keep going until no piece can be broken down further using real numbers.

Example Start with 2x3−8x2x^3 - 8x. Pull out the common factor 2x2x, then split the difference of squares that remains,

2x3−8x=2x(x2−4)=2x(x−2)(x+2).\begin{aligned} 2x^3 - 8x &= 2x(x^2 - 4) \\[0.4em] &= 2x(x - 2)(x + 2). \end{aligned}

Now the zeros x=0x = 0, x=2x = 2 and x=−2x = -2 can be read straight off the factors.

Difference of squares

Definition For all real numbers aa and bb,

a2−b2=(a−b)(a+b).a^2 - b^2 = (a - b)(a + b).

A sum of squares x2+c2x^2 + c^2 with c≠0c \ne 0 does not factor over the reals, because it is at least c2>0c^2 > 0 for every real xx and so has no real zero.

In plain words Something squared minus something else squared always splits into a minus version times a plus version. A plus between two squares does not split this way.

Example Factor x4−16x^4 - 16 completely over the reals. It is a difference of squares with a=x2a = x^2 and b=4b = 4, and one of the new factors is again a difference of squares,

x4−16=(x2−4)(x2+4)=(x−2)(x+2)(x2+4).\begin{aligned} x^4 - 16 &= (x^2 - 4)(x^2 + 4) \\[0.4em] &= (x - 2)(x + 2)(x^2 + 4). \end{aligned}

The factor x2+4x^2 + 4 is at least 44 for every real xx, so it stays as it is. Stopping at (x2−4)(x2+4)(x^2 - 4)(x^2 + 4) would leave the job unfinished.

Equivalent expressions

Definition Two expressions in xx are equivalent on a set of real numbers when they are defined and have the same value for every xx in that set. Unless a set is named, it is the set of all xx where both expressions are defined. The polynomial identities on this page are equivalences for every real xx. Checking a rewrite by reversing it, such as expanding a factored form, confirms equivalence. Agreement at a few sample values does not, though a single disagreement proves two expressions are not equivalent.

In plain words Equivalent means the same value every single time, not just sometimes. The safest check is to undo your step and see the original come back.

Example The factored form (x−3)(x+3)(x - 3)(x + 3) expands back to x2−9x^2 - 9, so the two are equivalent for every real xx. On the other hand (x+3)2(x + 3)^2 and x2+9x^2 + 9 are not equivalent, because at x=1x = 1 they give 1616 and 1010. Watch the domain as well. The expressions x2−9x−3\frac{x^2 - 9}{x - 3} and x+3x + 3 agree for every x≠3x \ne 3, but only the second is defined at x=3x = 3, so they are equivalent on the set x≠3x \ne 3 and not on all real numbers.

Check yourself

  1. Expand (2x−3)2(2x - 3)^2.
Show the answer

With a=2xa = 2x and b=3b = 3 in the square of a difference,

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

The cross term −12x-12x is twice the product 2x⋅32x \cdot 3, with a minus sign.

  1. Factor x4−81x^4 - 81 completely over the reals.
Show the answer

It is a difference of squares twice over,

x4−81=(x2−9)(x2+9)=(x−3)(x+3)(x2+9).\begin{aligned} x^4 - 81 &= (x^2 - 9)(x^2 + 9) \\[0.4em] &= (x - 3)(x + 3)(x^2 + 9). \end{aligned}

The factor x2+9x^2 + 9 is at least 99 for every real xx, so it has no real zero and does not factor further.

  1. For h≠0h \ne 0, simplify
(x+h)2−x2h.\frac{(x + h)^2 - x^2}{h}.
Show the answer

Expanding the square gives x2+2xh+h2x^2 + 2xh + h^2, so the numerator is 2xh+h2=h(2x+h)2xh + h^2 = h(2x + h). Since hh is now a factor and h≠0h \ne 0, it cancels,

(x+h)2−x2h=2x+h,h≠0.\begin{gathered} \frac{(x + h)^2 - x^2}{h} = 2x + h, \\[0.4em] h \ne 0. \end{gathered}

How this lesson connects