Square of Sum and Difference

Square of sum and difference:

(a±b)2=a2±2ab+b2\color{purple}{\left(a\pm b\right)^2=a^2\pm 2ab+b^2}

Let's see how to derive it.

Recall, that exponent is just repeating multiplication.

Thus, we can write that (a+b)2=(a+b)(a+b){{\left({a}+{b}\right)}}^{{2}}={\left({a}+{b}\right)}{\left({a}+{b}\right)}.

Now, apply FOIL: (a+b)(a+b)=aa+ab+ba+bb=a2+2ab+b2{\left({a}+{b}\right)}{\left({a}+{b}\right)}={a}\cdot{a}+{a}\cdot{b}+{b}\cdot{a}+{b}\cdot{b}={{a}}^{{2}}+{2}{a}{b}+{{b}}^{{2}}.

square of sum and differenceSimilarly, it can be shown, that (ab)2=a22ab+b2{{\left({a}-{b}\right)}}^{{2}}={{a}}^{{2}}-{2}{a}{b}+{{b}}^{{2}}.

Or, more shortly: (a±b)2=a2±2ab+b2{{\left({a}\pm{b}\right)}}^{{2}}={{a}}^{{2}}\pm{2}{a}{b}+{{b}}^{{2}}.

Geometrically (a+b)2{{\left({a}+{b}\right)}}^{{2}} represents an area of the square with side a+b{a}+{b}.

But, as shown on picture, this square consist of four smaller squares with areas a2{{a}}^{{2}}, ab{a}{b}, ab{a}{b}, b2{{b}}^{{2}}.

Thus, (a+b)2=a2+ab+ab+b2=a2+2ab+b2{{\left({a}+{b}\right)}}^{{2}}={{a}}^{{2}}+{a}{b}+{a}{b}+{{b}}^{{2}}={{a}}^{{2}}+{2}{a}{b}+{{b}}^{{2}}.

Example 1. Multiply (2x+3y)2{{\left({2}{x}+{3}{y}\right)}}^{{2}}.

Here a=2x{a}={2}{x} and b=3y{b}={3}{y}.

Just use above formula: (2x+3y)2=(2x)2+2(2x)(3y)+(3y)2=4x2+12xy+9y2{{\left({2}{x}+{3}{y}\right)}}^{{2}}={{\left({2}{x}\right)}}^{{2}}+{2}\cdot{\left({2}{x}\right)}\cdot{\left({3}{y}\right)}+{{\left({3}{y}\right)}}^{{2}}={4}{{x}}^{{2}}+{12}{x}{y}+{9}{{y}}^{{2}}.

Let's see how to handle minus sign.

Example 2. Multiply (83ab3cd)2{{\left(\frac{{8}}{{3}}{a}{b}-{3}{c}{d}\right)}}^{{2}}.

Here a=83ab{a}=\frac{{8}}{{3}}{a}{b} and b=3cd{b}={3}{c}{d}.

Now, use formula for difference: (83ab3cd)2=(83ab)22(83ab)(3cd)+(3cd)2=649a2b216abcd+9c2d2{{\left(\frac{{8}}{{3}}{a}{b}-{3}{c}{d}\right)}}^{{2}}={{\left(\frac{{8}}{{3}}{a}{b}\right)}}^{{2}}-{2}\cdot{\left(\frac{{8}}{{3}}{a}{b}\right)}\cdot{\left({3}{c}{d}\right)}+{{\left({3}{c}{d}\right)}}^{{2}}=\frac{{64}}{{9}}{{a}}^{{2}}{{b}}^{{2}}-{16}{a}{b}{c}{d}+{9}{{c}}^{{2}}{{d}}^{{2}}.

Finally, let's do a slightly harder example.

Example 3. Multiply the following: (xyz5x2)2{{\left(-{x}{y}{z}-{5}{{x}}^{{2}}\right)}}^{{2}}.

Till now, we didn't see two minus signs, but this case can be handled easily.

There are two options:

  • a=xyz{a}=-{x}{y}{z} and b=5x2{b}=-{5}{{x}}^{{2}}; apply sum formula.
  • a=xyz{a}=-{x}{y}{z} and b=5x2{b}={5}{{x}}^{{2}}; apply difference formula.

I choose second option: (xyz5x2)2=(xyz)22(xyz)(5x2)+(5x2)2=x2y2z2+10x3yz+25x4{{\left(-{x}{y}{z}-{5}{{x}}^{{2}}\right)}}^{{2}}={{\left(-{x}{y}{z}\right)}}^{{2}}-{2}\cdot{\left(-{x}{y}{z}\right)}\cdot{\left({5}{{x}}^{{2}}\right)}+{{\left({5}{{x}}^{{2}}\right)}}^{{2}}={{x}}^{{2}}{{y}}^{{2}}{{z}}^{{2}}+{10}{{x}}^{{3}}{y}{z}+{25}{{x}}^{{4}}.

From last example we see, that (ab)2=(a+b)2{\color{purple}{{{{\left(-{a}-{b}\right)}}^{{2}}={{\left({a}+{b}\right)}}^{{2}}}}}.

Another nice application of square of sum formula is to calculate square of a number. In many cases you can perform calculations mentally without calculator (or pen and paper).

Example 4. Calculate 242{{24}}^{{2}}.

We could use calculator or multiply vertically, but there is simpler way.

We know, that 202=400{{20}}^{{2}}={400}.

Thus, 242=(20+4)2=202+2204+42=400+160+16=576{{24}}^{{2}}={{\left({20}+{4}\right)}}^{{2}}={{20}}^{{2}}+{2}\cdot{20}\cdot{4}+{{4}}^{{2}}={400}+{160}+{16}={576}.

Alternatively 242=(306)2=3022306+62=900360+36=576{{24}}^{{2}}={{\left({30}-{6}\right)}}^{{2}}={{30}}^{{2}}-{2}\cdot{30}\cdot{6}+{{6}}^{{2}}={900}-{360}+{36}={576}.

Note, that this method is not always the simplest.

Now, it is time to exercise.

Exercise 1. Multiply (5z+3y)2{{\left({5}{z}+{3}{y}\right)}}^{{2}}.

Answer: 25z2+30zy+9y2{25}{{z}}^{{2}}+{30}{z}{y}+{9}{{y}}^{{2}}.

Exercise 2. Multiply (13xy2+2x)2{{\left(-\frac{{1}}{{3}}{x}{{y}}^{{2}}+{2}{x}\right)}}^{{2}}.

Answer: 19x2y443x2y2+4x2\frac{{1}}{{9}}{{x}}^{{2}}{{y}}^{{4}}-\frac{{4}}{{3}}{{x}}^{{2}}{{y}}^{{2}}+{4}{{x}}^{{2}}.

Hint: either swap summands ((13xy2+2x)2=(2x13xy2)2{{\left(-\frac{{1}}{{3}}{x}{{y}}^{{2}}+{2}{x}\right)}}^{{2}}={{\left({2}{x}-\frac{{1}}{{3}}{x}{{y}}^{{2}}\right)}}^{{2}}: commutative property of addition) or proceed as always.

Exercise 3. Multiply the following: (3x2)2{{\left(-{3}{x}-{2}\right)}}^{{2}}.

Answer: 9x2+12x+4{9}{{x}}^{{2}}+{12}{x}+{4}.

Exercise 4. Calculate 312{{31}}^{{2}} using square of sum/difference formula.

Answer: 961{961}. Hint: 312=(30+1)2{{31}}^{{2}}={{\left({30}+{1}\right)}}^{{2}} or 312=(409)2{{31}}^{{2}}={{\left({40}-{9}\right)}}^{{2}} (however, first option is easier).