$(a-b)^2$ identity
Formula
$(a-b)^2 \,=\, a^2-2ab+b^2$

What is the (a−b)² Formula?
$a$ minus $b$, squared, equals $a$ squared minus two $a$ $b$ plus $b$ squared.
When $a$ and $b$ represent two variables, subtracting $b$ from $a$ gives their difference, written as $a-b$ in algebra. Squaring this difference gives the expression $(a-b)^2$, which represents the square of a difference in mathematics.
The square of $a−b$ can be read in two different ways, and you can use either one.
- $a$ minus $b$ squared
- $a$ minus $b$ whole square
Now, let us learn how to expand the $a$ minus $b$ squared (or $a$ minus $b$ whole square) expression and understand how to use it in mathematics with some simple and easy-to-understand examples.
How to Use the (a−b)² Formula
The $a$ minus $b$ squared formula is mainly used in two different cases in mathematics.
Expansion
We already know what the $a$ minus $b$ squared represents. Now, let us learn how to expand the algebraic expression $(a-b)^2$ in terms of the variables $a$ and $b$.
$\implies$ $(a-b)^2$ $\,=\,$ $a^2-2ab+b^2$
The $a$ minus $b$ whole square is expanded as $a$ squared minus two $a$ $b$ plus $b$ squared, and this expansion is used as a formula when an expression is already written as the square of a difference (a binomial).
Example
Expand $(3x-4)^2$
The given algebraic expression is in the form of the square of a difference, so the $a-b$ squared formula can be used to expand it. Now, substitute $a = 3x$ and $b = 4$ into the $(a-b)^2$ formula.
$=\,\,$ $(3x)^2$ $-$ $2(3x)4$ $+$ $4^2$
$=\,\,$ $(3x)^2$ $-$ $2 \times (3x) \times 4$ $+$ $4^2$
$=\,\,$ $9x^2-24x+16$
The above example explains how a binomial in the form of the square of a difference is expanded step by step into a three-term expression using the $a-b$ whole square formula.
Factorization
So far, we have used the $a$ minus $b$ squared formula to expand expressions. The same formula can also be used in reverse to factor a trinomial into the square of a difference.
$\implies$ $a^2-2ab+b^2$ $\,=\,$ $(a-b)^2$
The thee-term expression can be factored using the $a$ minus $b$ whole square formula.
Example
Simplify $16p^2-40pq+25q^2$
The given expression has three terms. The first and last terms are squares, and the middle term is negative. So, it can be written as the square of a difference using the $a-b$ squared formula.
$=\,\,$ $(4p)^2$ $-$ $2 \times (4p) \times (5q)$ $+$ $(5q)^2$
$=\,\,$ $(4p)^2$ $-$ $2(4p)(5q)$ $+$ $(5q)^2$
$=\,\,$ $(4p-5q)^2$
The above example demonstrates how to factor a trinomial whose first and last terms are perfect squares and whose middle term is $-2ab$ into the square of a difference using the $a$ minus $b$ whole square formula.
The above two simple examples show how to use the $a$ minus $b$ squared formula in mathematics.
Verification of the (a−b)² Formula
You have learned how to expand and factor expressions using the $a$ minus $b$ squared formula, but it’s natural to question whether it is really correct mathematically, and we can verify it using simple arithmetic with numbers.
Example
Substitute $a = 5$ and $b = 3$ into both sides of the $(a-b)^2$ formula.
- $(a-b)^2$ $\,=\,$ $(5-3)^2$ $\,=\,$ $2^2$ $\,=\,$ $4$
- $a^2-2ab+b^2$ $\,=\,$ $5^2-2(5)(3)+3^2$ $\,=\,$ $25-30+9$ $\,=\,$ $4$
$\,\,\,\,\therefore\,\,\,\,$ $(a-b)^2$ $\,=\,$ $a^2-2ab+b^2$ $\,=\,$ $4$
Example
Similarly, substitute $a = 9$ and $b = 4$ into both sides of the $(a-b)^2$ formula to see how it works.
- $(a-b)^2$ $\,=\,$ $(9-4)^2$ $\,=\,$ $5^2$ $\,=\,$ $25$
- $a^2-2ab+b^2$ $\,=\,$ $9^2-2(9)(4)+4^2$ $\,=\,$ $81-72+16$ $\,=\,$ $25$
$\,\,\,\,\therefore\,\,\,\,$ $(a-b)^2$ $\,=\,$ $a^2-2ab+b^2$ $\,=\,$ $25$
These two numerical examples clearly prove that the $a$ minus $b$ whole square is equal to $a$ squared minus two $a$ $b$ plus $b$ squared. You can also verify the $a-b$ squared formula by substituting different numbers and observing that both sides are equal. For this reason, it is also called the $(a-b)^2$ identity.
Other Forms of the Square of a Difference
In mathematics, the square of a difference formula can be written using different variables such as $x$ and $y$ instead of $a$ and $b$. Therefore, $(a-b)^2$ and $(x-y)^2$ represent the same square of a difference formula, with only the variables changing.
Formula
$(x-y)^2$ $\,=\,$ $x^2-2xy+y^2$
You have learned what the $(a-b)^2$ formula is and how it is used in mathematics, including arithmetic verification to check its correctness. Next, we will learn how to derive the $(a-b)^2$ algebraic identity clearly and step by step in two different methods.
