Prerequisites: lines, exponents, logs, trig

Expanding (a+b)² and (a+b)³

The expansions of (a+b)2(a+b)^2 and (a+b)3(a+b)^3 are the groundwork for computing f(x+h)f(x+h) in the definition of the derivative.

(a+b)2=a2+2ab+b2,(a+b)3=a3+3a2b+3ab2+b3\begin{gathered} (a+b)^2=a^2+2ab+b^2, \\[4pt] (a+b)^3=a^3+3a^2b+3ab^2+b^3 \end{gathered}

Don't drop the middle term 2ab2ab in (a+b)2=a2+2ab+b2(a+b)^2=a^2+2ab+b^2. For example, (x+5)2=x2+10x+25(x+5)^2=x^2+10x+25.

The coefficients of the cube are 1, 3, 3, 11,\ 3,\ 3,\ 1. When bb is negative, the signs alternate +, −, +, −+,\ -,\ +,\ -.

(x−1)3=x3−3x2+3x−1(x-1)^3=x^3-3x^2+3x-1

With f(x)=x2f(x)=x^2, f(x+h)=(x+h)2=x2+2xh+h2f(x+h)=(x+h)^2=x^2+2xh+h^2. Then f(x+h)−f(x)h=2x+h\frac{f(x+h)-f(x)}{h}=2x+h, and letting h→0h\to 0 gives f′(x)=2xf'(x)=2x.

Examples

  1. 01Expand:(x+3)3\displaystyle (x+3)^3AnswerHide
    Answerx3+9x2+27x+27\displaystyle x^3+9x^2+27x+27

    Steps

    1. (x+3)3\displaystyle (x+3)^3=(x+3)2(x+3)\displaystyle = (x+3)^2(x+3)=(x2+6x+9)(x+3)\displaystyle = (x^2+6x+9)(x+3)
    2. Multiply term by term, then collect like terms
    3. =x3+3x2+6x2+18x+9x+27\displaystyle = x^3+3x^2+6x^2+18x+9x+27=x3+9x2+27x+27\displaystyle = x^3+9x^2+27x+27
  2. 02Which expression expands to this?x2+4x+4\displaystyle x^2+4x+4AnswerHide
    Answer(x+2)2\displaystyle (x+2)^2

    Steps

    1. x2+2⋅2x+22\displaystyle x^2 + 2 \cdot 2 x + 2^2=(x+2)2\displaystyle = (x+2)^2
  3. 03With f(x)=x2f(x)=x^2, what goes in □?f(x+h)=x2+□h+h2\displaystyle f(x+h) = x^2 + \square h + h^2AnswerHide
    Answer2x\displaystyle 2x
  4. 04After expanding, what number goes in □?(x+5)2=x2+□x+25\displaystyle (x+5)^2 = x^2 + \square x+25AnswerHide
    Answer10\displaystyle 10
  5. 05Expand:(x−2)2\displaystyle (x-2)^2AnswerHide
    Answerx2−4x+4\displaystyle x^2-4x+4

    Steps

    1. (x−2)2\displaystyle (x-2)^2=(x−2)(x−2)\displaystyle = (x-2)(x-2)=x2−2x−2x+4\displaystyle = x^2-2x-2x+4=x2−4x+4\displaystyle = x^2-4x+4
  6. 06Expand:(x−1)3\displaystyle (x-1)^3AnswerHide
    Answerx3−3x2+3x−1\displaystyle x^3-3x^2+3x-1

    Steps

    1. (x−1)3\displaystyle (x-1)^3=(x−1)2(x−1)\displaystyle = (x-1)^2(x-1)=(x2−2x+1)(x−1)\displaystyle = (x^2-2x+1)(x-1)
    2. Multiply term by term, then collect like terms
    3. =x3−x2−2x2+2x+x−1\displaystyle = x^3-x^2-2x^2+2x+x-1=x3−3x2+3x−1\displaystyle = x^3-3x^2+3x-1

FAQ

Q1Isn't (x+3)2(x+3)^2 equal to x2+9x^2+9?AnswerHide
A
No. (x+3)2=(x+3)(x+3)=x2+6x+9(x+3)^2=(x+3)(x+3)=x^2+6x+9; the middle term 2⋅3⋅x=6x2\cdot 3\cdot x=6x is included.
Q2How do I get the coefficients of (x+3)3(x+3)^3?AnswerHide
A
Put a=xa=x and b=3b=3 into (a+b)3=a3+3a2b+3ab2+b3(a+b)^3=a^3+3a^2b+3ab^2+b^3: x3+3⋅3x2+3⋅9x+27=x3+9x2+27x+27x^3+3\cdot 3x^2+3\cdot 9x+27=x^3+9x^2+27x+27.

Published 2026-10-14 · Updated 2026-10-14