All courses › Foundations of Mathematics › The square rules

The square rules

The square rules are shortcuts for expanding common parenthesised expressions, and are used in reverse when factoring. The colours show where each term comes from: the first term a\textcolor{#1D5FC2}{a} is blue, the second term b\textcolor{#A64300}{b} is orange, and the middle term made from both together is magenta.

(a+b)2=a2+2ab+b2(\textcolor{#1D5FC2}{a}+\textcolor{#A64300}{b})^2 = \textcolor{#1D5FC2}{a^2} + \textcolor{#B5177A}{2ab} + \textcolor{#A64300}{b^2}first square rule
(a−b)2=a2−2ab+b2(\textcolor{#1D5FC2}{a}-\textcolor{#A64300}{b})^2 = \textcolor{#1D5FC2}{a^2} - \textcolor{#B5177A}{2ab} + \textcolor{#A64300}{b^2}second square rule
(a+b)(a−b)=a2−b2(\textcolor{#1D5FC2}{a}+\textcolor{#A64300}{b})(\textcolor{#1D5FC2}{a}-\textcolor{#A64300}{b}) = \textcolor{#1D5FC2}{a^2} - \textcolor{#A64300}{b^2}difference of squares (third square rule)

Symbols

a\textcolor{#1D5FC2}{a}first term in the brackets (blue)
b\textcolor{#A64300}{b}second term in the brackets (orange)
2ab\textcolor{#B5177A}{2ab}the middle term: aa times bb, twice (magenta)

Where the rule comes from

First square rule: (a+b)2(a+b)^2

  1. (a+b)2=(a+b)(a+b)(\textcolor{#1D5FC2}{a}+\textcolor{#A64300}{b})^2 = (\textcolor{#1D5FC2}{a}+\textcolor{#A64300}{b})(\textcolor{#1D5FC2}{a}+\textcolor{#A64300}{b})

    Squaring means multiplying by itself. Write the square as two identical brackets.

  2. =a⋅a+a⋅b+b⋅a+b⋅b= \textcolor{#1D5FC2}{a}\cdot \textcolor{#1D5FC2}{a} + \textcolor{#1D5FC2}{a}\cdot \textcolor{#A64300}{b} + \textcolor{#A64300}{b}\cdot \textcolor{#1D5FC2}{a} + \textcolor{#A64300}{b}\cdot \textcolor{#A64300}{b}

    Multiply each term in the first bracket by each term in the second: aa by aa, aa by bb, bb by aa and bb by bb. That gives four terms.

  3. =a2+ab+ab+b2= \textcolor{#1D5FC2}{a^2} + \textcolor{#B5177A}{ab} + \textcolor{#B5177A}{ab} + \textcolor{#A64300}{b^2}

    a⋅a=a2a\cdot a = a^2 and b⋅b=b2b\cdot b = b^2. The two middle terms are both abab, because b⋅a=a⋅bb\cdot a = a\cdot b.

  4. =a2+ab+ab⏟2ab+b2= \textcolor{#1D5FC2}{a^2} + \underbrace{\textcolor{#B5177A}{ab} + \textcolor{#B5177A}{ab}}_{\textcolor{#B5177A}{2ab}} + \textcolor{#A64300}{b^2}

    Collect like terms: ab+ab=2abab + ab = 2ab. So the middle term is one abab from each of the two 'crosses'.

  5. =a2+2ab+b2= \textcolor{#1D5FC2}{a^2} + \textcolor{#B5177A}{2ab} + \textcolor{#A64300}{b^2}

    This is the first square rule. If you write only a2+b2a^2 + b^2, you have forgotten both crosses.

Second square rule: (a−b)2(a-b)^2

  1. (a−b)2=(a−b)(a−b)(\textcolor{#1D5FC2}{a}-\textcolor{#A64300}{b})^2 = (\textcolor{#1D5FC2}{a}-\textcolor{#A64300}{b})(\textcolor{#1D5FC2}{a}-\textcolor{#A64300}{b})

    Write the square as two identical brackets. This time the second term has a minus sign: it is −b-b.

  2. =a⋅a+a⋅(−b)= \textcolor{#1D5FC2}{a}\cdot \textcolor{#1D5FC2}{a} + \textcolor{#1D5FC2}{a}\cdot(\textcolor{#A64300}{-b})+(−b)⋅a+(−b)⋅(−b)+ (\textcolor{#A64300}{-b})\cdot \textcolor{#1D5FC2}{a} + (\textcolor{#A64300}{-b})\cdot(\textcolor{#A64300}{-b})

    Multiply each term by each term, keeping the signs. a⋅(−b)a\cdot({-b}) and (−b)⋅a({-b})\cdot a are negative. (−b)⋅(−b)({-b})\cdot({-b}) is positive, because minus times minus is plus.

  3. =a2−ab−ab+b2= \textcolor{#1D5FC2}{a^2} - \textcolor{#B5177A}{ab} - \textcolor{#B5177A}{ab} + \textcolor{#A64300}{b^2}

    Now there are two like terms with minus: −ab-ab and −ab-ab.

  4. =a2−2ab+b2= \textcolor{#1D5FC2}{a^2} - \textcolor{#B5177A}{2ab} + \textcolor{#A64300}{b^2}

    Collect like terms: −ab−ab=−2ab-ab - ab = {-2ab}. The only difference from the first rule is the minus in front of 2ab2ab. The term b2b^2 is still plus.

Difference of squares: (a+b)(a−b)(a+b)(a-b)

  1. (a+b)(a−b)(\textcolor{#1D5FC2}{a}+\textcolor{#A64300}{b})(\textcolor{#1D5FC2}{a}-\textcolor{#A64300}{b})=a⋅a+a⋅(−b)= \textcolor{#1D5FC2}{a}\cdot \textcolor{#1D5FC2}{a} + \textcolor{#1D5FC2}{a}\cdot(\textcolor{#A64300}{-b})+b⋅a+b⋅(−b)+ \textcolor{#A64300}{b}\cdot \textcolor{#1D5FC2}{a} + \textcolor{#A64300}{b}\cdot(\textcolor{#A64300}{-b})

    The brackets are almost the same: one has +b+b, the other −b-b. Multiply each term by each term.

  2. =a2−ab+ab−b2= \textcolor{#1D5FC2}{a^2} - \textcolor{#B5177A}{ab} + \textcolor{#B5177A}{ab} - \textcolor{#A64300}{b^2}

    The two middle terms are −ab-ab and +ab+ab: the same size, but with opposite signs.

  3. =a2−ab+ab⏟0−b2= \textcolor{#1D5FC2}{a^2} \underbrace{- \textcolor{#B5177A}{ab} + \textcolor{#B5177A}{ab}}_{0} - \textcolor{#A64300}{b^2}

    They cancel each other out, because −ab+ab=0-ab + ab = 0.

  4. =a2−b2= \textcolor{#1D5FC2}{a^2} - \textcolor{#A64300}{b^2}

    Only a2−b2a^2 - b^2 is left. That is why this rule has no middle term.

Example

With a=xa = x and b=3b = 3:

(x+3)2=x2+2⋅x⋅3+32(\textcolor{#1D5FC2}{x}+\textcolor{#A64300}{3})^2 = \textcolor{#1D5FC2}{x^2} + \textcolor{#B5177A}{2\cdot x\cdot 3} + \textcolor{#A64300}{3^2}

=x2+6x+9= \textcolor{#1D5FC2}{x^2} + \textcolor{#B5177A}{6x} + \textcolor{#A64300}{9}

(2x−5)2=4x2−20x+25(\textcolor{#1D5FC2}{2x}-\textcolor{#A64300}{5})^2 = \textcolor{#1D5FC2}{4x^2} - \textcolor{#B5177A}{20x} + \textcolor{#A64300}{25}, because the middle term is 2⋅2x⋅5=20x\textcolor{#B5177A}{2\cdot 2x\cdot 5} = \textcolor{#B5177A}{20x}

In your head: 232=(20+3)223^2 = (\textcolor{#1D5FC2}{20}+\textcolor{#A64300}{3})^2

=400+120+9=529= \textcolor{#1D5FC2}{400} + \textcolor{#B5177A}{120} + \textcolor{#A64300}{9} = 529

Difference of squares: (x+3)(x−3)=x2−9(\textcolor{#1D5FC2}{x}+\textcolor{#A64300}{3})(\textcolor{#1D5FC2}{x}-\textcolor{#A64300}{3}) = \textcolor{#1D5FC2}{x^2} - \textcolor{#A64300}{9}

(a+b)2≠a2+b2(\textcolor{#1D5FC2}{a}+\textcolor{#A64300}{b})^2 \neq \textcolor{#1D5FC2}{a^2} + \textcolor{#A64300}{b^2} - the middle term 2ab\textcolor{#B5177A}{2ab} is often forgotten.
Practise algebra and equations for free →

← Scientific notation · Linear equation →

Part of Foundations of Mathematics: Algebra and equations.