Article

Special Products

Square of a sum and a difference, difference of squares, and cube of a sum and a difference — very useful formulas that let you quickly expand or factor expressions with powers.

Connections:

Statistics:

  • Term1
  • Statement5
  • Important2
  • Problem28
  • Updated

What Are Special Products?

In algebra, you constantly run into expressions where brackets are raised to a power, multiplied by each other, or sit in the numerator and denominator of a fraction. Simplifying every one of those from scratch by hand is tedious and makes it easy to slip up in long calculations. Try it yourself:

Simplifying expressions

👀
Example
Simplify the expression:
(x+5)2(x5)(x+5)10(x+5)(x+5)^2 - (x-5)(x+5) - 10(x+5)
In all three examples, we kept doing the same routine work over and over — expanding brackets inside powers. Those expansions look very similar — squares, coefficients of 2, and so on. Instead of wasting time on the same hand calculations every time, mathematicians studied the most common patterns and wrote them down as formulas. That is where the name comes from — Special Products. Do not confuse them with anything else.

Special Products

Formulas that let you quickly “unpack” compact powered expressions into expansions or, going the other way, “pack” long sums into a compact form. These formulas save you from doing routine calculations by hand.

Square of a Sum

Start with a classic mistake made by 90% of people, most often school students who are “not that good” at math. It is so common that there is even a meme about it:
It would be really nice if the last answer worked that way. People want it so badly that this dream of applying a power directly to the terms (a+b)n=an+bn(a+b)^n = a^n + b^n even has its own name — “Freshman’s Dream”. You can see very quickly that this dream does not come true by plugging in actual numbers instead of letters:
(1+2)2=12+22=5(1+2)2=32=9\red{(1+2)^2 = 1^2 + 2^2 = 5} \\ \boxed{\green{(1 + 2)^2 = 3^2 = 9}}
(2+3)3=23+33=35(2+3)3=53=125 \red{(2+3)^3 = 2^3 + 3^3 = 35} \\ \boxed{\green{(2 + 3)^3 = 5^3 = 125}}
In the meme and the first example, the power is two, and the expression (a+b)2(a+b)^2 is called the “square of a sum” because the whole sum a + b is being squared. That is exactly where the name comes from — the square of the entire sum. The correct formula for (a+b)2(a+b)^2 looks a lot like “Freshman’s Dream”, but it is slightly more complicated. You can derive it by hand very quickly. The most direct way is to write the square as a product of two identical binomials and expand the brackets with FOIL:
Multiplying binomials with FOIL
(a+b)2=(a+b)(a+b)=a2+ab+ba+b2=a2+2ab+b2(a + b)^2 = (a + b)(a + b) = a^2 + ab + ba + b^2 = \boxed{a^2 + 2ab + b^2}
Going the other way, from the “sum” back into the packaged “product”, is just as simple — split 2ab into two terms and factor out a common binomial several times in a row:
a2+2ab+b2=a2+ab+ab+b2=a(a+b)+b(a+b)=(a+b)(a+b)=(a+b)2a^2 + 2ab + b^2 = a^2 + ab + ab + b^2 = a(a + b) + b(a + b) = (a + b)(a + b) = \boxed{(a + b)^2}
The second derivation is geometric. You can think of a and b as two line segments. Their sum, squared, equals the area of a square whose side is made from those two segments. You can find the total area by adding the areas of the component shapes: the square of area a2a^2, two rectangles of area ab, and the square of area b2b^2.
Geometric derivation of the square of a sum formula

Square of a sum formula

(a+b)2=a2+2ab+b2(a + b)^2 = a^2 + 2ab + b^2
From this point on, you never need to multiply the same two brackets by hand again. It is enough to find three pieces from left to right, either mentally or on paper: the square of the first term, twice the product of the two terms, and the square of the second term. Then just write them with plus signs. Try it yourself:

Expanding with the square of a sum

👀
Example
Expand the brackets:
(m+5)2(m+5)^2
The square of a sum formula does not just help you expand brackets quickly. It also lets you go the other way — pack an expanded expression back into a bracket squared, into the square of a sum. This process is often called completing the square, and we will talk about it separately below.
Packing is slightly harder than expanding. The main goal is to find a and b so you can build the square of a sum (a+b)2(a+b)^2. There are two ways to find them. The first and fastest way is to look at the outer terms: in simple cases, you immediately see perfect squares there, which instantly reveal a and b. After that, you only need to check that 2ab matches the middle term, and the packing is done.
The second way is to start with the middle term: it contains all the information about a and b. Take the middle term, divide it by 2, and you get the product ab. Then you only need to figure out which part is a and which part is b.

Packing into the square of a sum

👀
Example
Write the sum as a square of a sum:
49+14x+x249 + 14x + x^2
Very ancient formulas
Special Products were already known in deep antiquity, all the way back to the ancient Greeks. Euclid, for example, was already using them geometrically in the 3rd century BCE to compute areas. He stated the square of a sum formula like this:
“If a segment is divided into two parts in any way, then the area of the square built on the whole segment is equal to the sum of the areas of the squares built on each part, plus twice the area of the rectangle whose sides are those two parts.”
Special Products took on their modern form much later, in the 16th and 17th centuries, thanks to mathematicians Francois Viete (the same Viete whose name appears in Vieta’s formulas) and Rene Descartes. These formulas are still some of the most frequently used mathematical tricks everywhere in mathematics, from simplifying expressions in algebra to factoring equations in cryptography.

Square of a Difference

By analogy with the square of a sum, an expression of the form (ab)2(a-b)^2 is called the square of a difference. The reason is clear: we have a difference of two numbers ab, and we want to square that entire difference, that is, raise it to the second power. That is where the name comes from: the square of the entire difference.
Algebraically, the square-of-a-difference formula is derived in both directions exactly the same way as the square of a sum: either expand with FOIL in one direction, or split the doubled term and factor out common factors in the other:
(ab)2=(ab)(ab)=a2abba+b2=a22ab+b2a22ab+b2=a2abab+b2=a(ab)b(ab)=(ab)(ab)=(ab)2(a - b)^2 = (a - b)(a - b) = a^2 - ab - ba + b^2 = \boxed{a^2 - 2ab + b^2} \\ a^2 - 2ab + b^2 = a^2 - ab - ab + b^2 = a(a - b) - b(a - b) = (a - b)(a - b) = \boxed{(a - b)^2}
A geometric derivation is possible too. For the square of a sum, we found the total area of a large square whose side was made of two segments. Now we already have a large square with side a, and we shorten its sides by the length b. The area of the smaller square is exactly (ab)2(a-b)^2:
Geometric derivation of the square-of-a-difference formula

Square of a difference formula

(ab)2=a22ab+b2(a - b)^2 = a^2 - 2ab + b^2
As you can see, the square of a difference formula differs from the square of a sum formula only by changing the first sign from plus to minus. It is enough to remember the plus version and, when needed, change the first sign to minus.

There Is a Minus Sign, but It Is Still a Sum!

Because the minus sign has two roles in mathematics, any difference can be written as a sum if the minus signs are understood as negation. Not three minus two 3 – 2, but three plus negative two 3 + (–2). This works for expressions too:
ab+cd=(a)+(b)+c+(d)- a - b + c - d = (-a) + (-b) + c + (-d)
So do not be surprised when mathematicians call some expressions sums, even if there are no plus signs at all! We will do the same.
Practice using the square-of-a-difference formula to expand parentheses quickly and to factor expressions back into them. The usage pattern is exactly the same as for the square of a sum; the main thing is not to get lost in the minus signs. When factoring back into parentheses, you divide not by 2 but by –2. This time we will combine both exercises, expansion and factoring, into one set:

Examples Using the Square of a Difference

👀
Example
Expand the parentheses:
(6c)2(6-c)^2

Applications of the Square and a Difference

Earlier we already mentioned one benefit of these Special Products formulas: they let us quickly rewrite expressions either as sums or as products. That makes complicated expressions easier to simplify. Now it is time to give a few more very useful and concrete examples of how these formulas are used.

Squaring Numbers Quickly

Almost everyone can square any number from 0 to 10. That is just the multiplication table: 42=164^2 = 16, 62=366^2 = 36, 92=819^2 = 81. You do not have trouble with the multiplication table, do you? 👀 Students who are strong in math and olympiad contestants often know all squares up to 20 by heart. For example, 112=12111^2 = 121, 152=22515^2 = 225, 192=36119^2 = 361.
So it turns out that 99% of people only know square values by heart in the range from 0 to 20. But what if you need to square a somewhat larger number, say something > 15, quickly and without doing long multiplication?
In today’s digital world that is, of course, not much of a problem: you take out your phone, open a calculator, and compute it. But what if you do not have your phone, for example during an exam, or you would have to go get it? That is where the square-of-a-sum and square-of-a-difference formulas come to the rescue.

Quick Squares

Method
😀
Elementary
Without multiplying directly, square the number 62.
Try to do it mentally.
So you simply look at how far your number is from the nearest round number ending in zero. If it is a little larger than that round number, write it as a sum and use the square-of-a-sum formula. If it is a little smaller, write it as a difference and use the square-of-a-difference formula. In both cases the expansion gives three terms, and the first two always end in zero, which makes the final addition easier.

Solving Quadratic Equations

Many different processes in everyday life, physics, mathematics, and other sciences reduce to equations that look a lot like these:
x2+2x+1=0x^2 + 2x + 1 = 0
3618t+9t2=0 36 - 18t + 9t^2 = 0
4z2+48z+144=0 4z^2 + 48z + 144 = 0
These are all called quadratic equations, and the task is to determine which number is hidden behind the variable. It has to be a number that makes the left-hand side equal zero when substituted in place of the variable (0 = 0), otherwise the equation will not be true.
So what numbers are they? You could only guess and plug in different values at random. But everything becomes much simpler if you notice that the left-hand sides are already expanded forms of the square of a sum or the square of a difference. Factor them back into parentheses and we get:
(x+1)2=0(x+1)^2 = 0
(63t)2=0 (6 - 3t)^2 = 0
(2z+12)2=0 (2z + 12)^2 = 0
Now it is easy. What number should replace x so that adding 1 gives zero? Right: we should substitute –1 for x. And what number should replace t so that subtracting that number from 6 gives zero? Right: we should substitute 2 for t. Finally, what should replace z so that adding it to 12 gives zero? We should substitute –6.
(1x+1)2=0(\underset{x}{-1} + 1)^2 = 0
(632t)2=0 (6 - 3 \cdot \underset{t}{2})^2 = 0
(26z+12)2=0 (2 \cdot \underset{z}{-6} + 12)^2 = 0
It may seem as if we have solved just a few mathematical puzzles, but in fact these variables can stand for the number of packs of cookies bought, the running time of a car engine, and other real quantities.

Difference of Squares

There is one more very useful and simple formula you need to know by heart. It is called the difference of squares and is written exactly the way it is read: a2b2a^2 - b^2 (the difference of two squares, the difference of two numbers squared).
It is not obvious at first glance what the difference of squares a2b2a^2 - b^2 equals, so it is more convenient to start with a geometric derivation. Take a larger square with area a2a^2 and cut out a smaller square with area b2b^2. Horizontally the length stays a, but the height decreases by b, so it becomes ab. Cut off the protruding part, rotate it, and attach it to form a rectangle:
Geometric derivation of the difference of squares formula

Difference of squares formula

a2b2=(a+b)(ab)a^2 - b^2 = (a + b)(a - b)
Algebraic Derivation

Difference of Squares ≠ Square of a Difference!

Beginners studying these formulas very often confuse the difference of squares with the square of a difference. Avoiding this mistake is easy — just think about the name for one extra second. Difference of square s means there are several squares, so it is a2b2a^2 - b^2. But square of a difference means there is only one square, so it is (ab)2(a - b)^2.
Why do we even need this formula? The whole point is that it lets you halve or raise the degree of two expressions almost mechanically. You will soon see how many things this one simple formula dramatically simplifies and how neatly it packs complicated expressions. But first, practice using it in examples for raising and lowering degrees:

Examples Using the Difference of Squares

👀
Example
Write as a product of binomials:
x236x^2 - 36

Cube of a Sum and a Difference

Up to this point we have only been playing with squares, meaning the second degree. And we already got three interesting formulas: the square of a sum, the square of a difference, and the difference of squares. Can we go further? Are there convenient formulas for working quickly with cubes, that is, the third degree? Of course there are. You do not have to memorize them, but it is useful at least to get familiar with them.
There are quite a lot of Special Products in general, but we will only touch the most basic ones here — the cube of a sum and the cube of a difference. Their names say exactly what they mean. A cube of a sum or a difference means you have a sum or a difference of two numbers, and the whole thing is raised to the third power. The formulas are derived the same way as the square of a sum — by expanding brackets with FOIL:
(a+b)3=(a+b)2(a+b)=(a2+2ab+b2)(a+b)=a3+3a2b+3ab2+b3(ab)3=(ab)2(ab)=(a22ab+b2)(ab)=a33a2b+3ab2b3(a+b)^3 = (a+b)^2(a+b) = (a^2 + 2ab + b^2)(a+b) = \boxed{a^3 + 3a^2b + 3ab^2 + b^3} \\ (a-b)^3 = (a-b)^2(a-b) = (a^2 - 2ab + b^2)(a-b) = \boxed{a^3 - 3a^2b + 3ab^2 - b^3}
Both formulas can also be derived geometrically. From the names alone, you can already tell that we are now dealing with three-dimensional figures. And instead of assembling a square, we will assemble a cube. It looks like this:
Geometric derivation of the cube of a sum
Taken from the TikTok channel @complex_math
This visualization makes it immediately clear where the coefficients 3 and the expressions of the form a2ba^2b and ab2ab^2 come from. To fill the whole cube, you need three parallelepipeds with bases a2a^2 and b2b^2 and heights b and a respectively.

Cube of a sum formula

(a+b)3=a3+3a2b+3ab2+b3(a+b)^3 = a^3 + 3a^2b + 3ab^2 + b^3

Cube of a difference formula

(ab)3=a33a2b+3ab2b3(a-b)^3 = a^3 - 3a^2b + 3ab^2 - b^3

Examples Using the Cube of a Sum and Cube of a Difference

👀
Example
Expand the brackets:
(x+2)3(x + 2)^3

How to memorize these formulas?

You only need to memorize three formulas by heart: the square of a sum (a+b)2(a + b)^2, the square of a difference (ab)2(a - b)^2, and the difference of squares a2b2a^2 - b^2. They are everywhere, and you absolutely need to be able to spot them instantly and switch between expanded form and factored form. As for the cube formulas, it is enough to be able to recognize them. Here are a few tips that make all of these formulas easier to remember:
  • Plus-minus sign
    Do not memorize 4 separate formulas: the square of a sum, the square of a difference, the cube of a sum, and the cube of a difference. It is enough to remember 2 formulas if you use the plus-minus sign, because nothing changes except the signs:
    (a±b)2=a2±2ab+b2(a±b)3=a3±3a2b+3ab2±b3(a \pm b)^2 = a^2 \pm 2ab + b^2 \\ (a \pm b)^3 = a^3 \pm 3a^2b + 3ab^2 \pm b^3
    In sums, all signs are always pluses. In a difference, the minus sign always comes right after the first term in the expansion. In the cube case, it also appears in front of the last term.
  • The difference of squares stands apart
    Formulas whose names start with the degree, like square and cube, have a similar shape, and they can be derived naturally by expanding brackets (a+b)2=(a+b)(a+b)=(a+b)^2 = (a+b)(a+b) = \ldots
    But the difference of squares a2b2a^2-b^2 stands apart. First, it factors into brackets with a plus and a minus. Second, from the form a2b2a^2 - b^2 you cannot naturally and explicitly get the product (a + b)(ab) from the difference itself.
  • The degree matches the coefficient
    In the square or cube of a sum/difference, the degree (second or third) also appears as a coefficient in the expansion. For the square it is 2, and for the cube it is 3:
    (a±b)2=a2±2ab+b2(a±b)3=a3±3a2b+3ab2±b3(a \pm b)^{\normalsize\brand{2}} = a^2 \pm \brand{2}ab + b^2 \\ (a \pm b)^{\normalsize\brand{3}} = a^3 \pm \brand{3}a^2b + \brand{3}ab^2 \pm b^3
    The coefficient is also easy to remember from the geometric derivation. For the square formulas, we build a square, and in the process two rectangles appear. For the cube formulas, we build a cube, and in the process two kinds of three parallelepipeds appear.
  • Higher powers of Sum and Difference

    Have you noticed that the higher the degree, the longer and more complicated these formulas become? Can we keep increasing the degree forever? Can we find the ultimate solution to Freshman’s Dream?
    (a±b)1=a±b(a±b)2=a2±2ab+b2(a±b)3=a3±3a2b+3ab2±b3???(a \pm b)^1 = a \pm b \\ (a \pm b)^2 = a^2 \pm 2ab + b^2 \\ (a \pm b)^3 = a^3 \pm 3a^2b + 3ab^2 \pm b^3 \\ \text{???}
    In fact, we can. There is a very powerful universal formula that automatically produces Special Products for absolutely any degree. It is called the Binomial Theorem, and it looks like this:
    (a+b)n=k=0n(nk)ankbk,where (nk)=n!k!(nk)!(a+b)^n = \sum\limits_{k=0}^{n} \binom{n}{k} a^{n-k}b^k, \quad \text{where } \binom{n}{k} = \frac{n!}{k!(n-k)!}
    This probably looks shocking. That is normal: the formula really does look intimidating, and deriving it requires some combinatorics, which is the topic where it is usually proved. And yet it does not require any higher mathematics; you can derive it at a regular school level.
    So the answer to the question of whether there are infinitely many such formulas is yes. You can keep increasing the degree and get more and more new formulas:
    (a±b)4=a4±4a3b+6a2b2±4ab3+b4(a±b)5=a5±5a4b+10a3b2±10a2b3+5ab4±b5(a \pm b)^4 = a^4 \pm 4a^3b + 6a^2b^2 \pm 4ab^3 + b^4 \\ (a \pm b)^5 = a^5 \pm 5a^4b + 10a^3b^2 \pm 10a^2b^3 + 5ab^4 \pm b^5 \\ \ldots
    The Binomial Theorem shows up all over mathematics, both elementary and especially advanced. Just as these formulas let you turn sums into products of brackets and back again for small powers, the Binomial Theorem lets you do the same with expressions of any complexity.
    Special Products