In short
An algebraic identity is an equation that holds for every value of the variables in it. The standard identities — (a + b)^2 = a^2 + 2ab + b^2, (a - b)^2 = a^2 - 2ab + b^2, (a + b)(a - b) = a^2 - b^2, (a + b + c)^2, a^3 + b^3, a^3 - b^3, (a + b)^3, (a - b)^3 — are shortcuts that turn slow expansion into instant answers. Each one has a geometric proof you can draw, and together they form the toolkit for simplification, mental arithmetic, and factoring.
What is 102^2? You could multiply 102 \times 102 by hand. Or you could notice that 102 = 100 + 2 and use the identity (a + b)^2 = a^2 + 2ab + b^2:
Three additions, no long multiplication. The identity turned a tedious calculation into mental arithmetic.
And 98 \times 102? Write it as (100 - 2)(100 + 2) = 100^2 - 2^2 = 10000 - 4 = 9996. One subtraction.
These are not tricks. They are identities — equations that are true for all values of a and b, not just for 100 and 2. They work because they are consequences of the distributive law, and the distributive law holds everywhere. This article builds each identity, proves it geometrically, and shows you how to use it in both directions: for expanding (going from factored form to expanded form) and for factoring (going back).
The square identities
Identity 1: (a + b)^2 = a^2 + 2ab + b^2
Start from the definition. (a + b)^2 means (a + b)(a + b). Distribute:
That is the algebraic proof — four products, two of which are identical, giving the 2ab in the middle.
The geometric proof is even more satisfying. Draw a square with side length a + b. Its area is (a + b)^2. Now split each side at the point where a ends and b begins. This divides the big square into four pieces: a square of side a (area a^2), a square of side b (area b^2), and two rectangles of sides a and b (area ab each). The total area of the four pieces must equal the area of the big square:
The identity is not a formula to memorise — it is a picture of a square cut into four pieces.
Identity 2: (a - b)^2 = a^2 - 2ab + b^2
The same logic, with a sign change. Expand:
Geometrically, start with a square of side a. Remove a strip of width b from the right and another from the bottom. You have removed too much — the corner square of side b was subtracted twice. Add it back once. The remaining area is a^2 - ab - ab + b^2 = a^2 - 2ab + b^2, and it is also a square of side a - b.
Identity 3: (a + b)(a - b) = a^2 - b^2
This is the difference of squares. Expand:
The -ab and +ab cancel perfectly. That cancellation is the reason the identity is so useful — multiplying a sum by a difference wipes out the cross terms and leaves only squares.
Geometrically, take a square of side a and remove a square of side b from one corner. The remaining L-shaped region has area a^2 - b^2. Now cut the L along a horizontal line at height b from the bottom. You get two rectangles: one is b \times (a - b) and the other is a \times (a - b). Rearrange them into a single rectangle of width (a - b) and height (a + b). Its area is (a + b)(a - b) — the same as the L-shape's area, which was a^2 - b^2.
The difference of squares is the factoring tool you reach for most often. Any time you see something of the form (\text{square}) - (\text{square}), it splits into (\text{sum})(\text{difference}).
Standard Square Identities
For all real numbers a and b:
The three-variable square identity
When three variables appear, the pattern extends naturally:
Expand it directly: (a + b + c)(a + b + c). Every term multiplies every other term. The diagonal products give a^2, b^2, c^2. Each off-diagonal pair appears twice (ab and ba, bc and cb, ca and ac), giving 2ab + 2bc + 2ca.
You can also derive it from Identity 1 by treating (a + b + c) as ((a + b) + c):
Rearranging: a^2 + b^2 + c^2 + 2ab + 2bc + 2ca. Same result.
This identity is useful for mental arithmetic with three-part sums and for simplifying expressions in coordinate geometry. For instance, (10 + 3 + 0.5)^2 = 100 + 9 + 0.25 + 60 + 3 + 10 = 182.25, confirming 13.5^2 = 182.25.
The cubic identities
Identity 4: (a + b)^3 = a^3 + 3a^2b + 3ab^2 + b^3
Expand (a + b)^3 = (a + b)(a + b)^2 = (a + b)(a^2 + 2ab + b^2):
An equivalent form that is often more useful:
This rearrangement groups the 3a^2b + 3ab^2 into 3ab(a + b).
Identity 5: (a - b)^3 = a^3 - 3a^2b + 3ab^2 - b^3
Same expansion, with alternating signs:
Identity 6: a^3 + b^3 = (a + b)(a^2 - ab + b^2)
This is the sum of cubes factoring identity. You can derive it from Identity 4. Write a^3 + b^3 = (a + b)^3 - 3ab(a + b) = (a + b)[(a + b)^2 - 3ab] = (a + b)(a^2 + 2ab + b^2 - 3ab) = (a + b)(a^2 - ab + b^2).
Or verify directly: expand (a + b)(a^2 - ab + b^2) = a^3 - a^2b + ab^2 + a^2b - ab^2 + b^3 = a^3 + b^3. The four middle terms cancel in pairs.
Identity 7: a^3 - b^3 = (a - b)(a^2 + ab + b^2)
The difference of cubes. Verify by expansion: (a - b)(a^2 + ab + b^2) = a^3 + a^2b + ab^2 - a^2b - ab^2 - b^3 = a^3 - b^3.
Standard Cubic Identities
For all real numbers a and b:
Applications in simplification
The identities work in two directions. In the expansion direction, you use them to turn a factored expression into expanded form without doing term-by-term multiplication. In the factoring direction, you recognise a pattern in the expanded form and collapse it back into the compact factored form.
Expansion example. Compute (3x + 5)^2 without multiplying out the long way.
Factoring example. Factor 16x^2 - 49.
Recognise: 16x^2 = (4x)^2 and 49 = 7^2. This is a difference of squares:
Simplification example. Simplify \dfrac{x^3 + 27}{x + 3}.
The numerator is x^3 + 3^3, a sum of cubes: (x + 3)(x^2 - 3x + 9). Cancel the common factor:
Mental arithmetic example. Compute 47 \times 53.
Write it as (50 - 3)(50 + 3) = 50^2 - 3^2 = 2500 - 9 = 2491. Done in your head.
Applications in factorization
The identities are the express lane in Polynomial Factorization. Any time you spot a pattern that matches an identity, you can write the factors immediately without going through the trial-and-error of the trinomial method.
- x^2 + 14x + 49 = (x + 7)^2 — perfect square trinomial, matches (a + b)^2
- 25y^2 - 40y + 16 = (5y - 4)^2 — perfect square trinomial, matches (a - b)^2
- x^4 - 1 = (x^2 + 1)(x^2 - 1) = (x^2 + 1)(x + 1)(x - 1) — nested difference of squares
- 64a^3 - 125b^3 = (4a - 5b)(16a^2 + 20ab + 25b^2) — difference of cubes
The nested factorisation of x^4 - 1 is worth lingering over. The first step treats x^4 as (x^2)^2 and 1 as 1^2, giving the difference of squares (x^2 + 1)(x^2 - 1). But x^2 - 1 is itself a difference of squares: (x + 1)(x - 1). The factor x^2 + 1, on the other hand, is a sum of squares and does not factor over the reals.
Interactive: see identities at work
Drag the red point on the curve below to see how (a + b)^2 compares to a^2 + b^2 when b = 3 and a varies. The gap between the two values is exactly 2ab = 6a — the cross term that the identity adds.
Two worked examples
Example 1: Expand and simplify $(2x + 3y)^2 - (2x - 3y)^2$
The expression is a difference of two squares of binomials. You could expand each square separately, but the difference-of-squares identity gives a faster route.
Step 1. Recognise the overall structure. The expression has the form A^2 - B^2, where A = (2x + 3y) and B = (2x - 3y).
Why: any expression of the form (\text{something})^2 - (\text{something else})^2 is a difference of squares, no matter how complicated the "somethings" are.
Step 2. Apply the difference-of-squares identity: A^2 - B^2 = (A + B)(A - B).
Step 3. Simplify each bracket.
First bracket: (2x + 3y) + (2x - 3y) = 4x.
Second bracket: (2x + 3y) - (2x - 3y) = 2x + 3y - 2x + 3y = 6y.
Why: in the first bracket the 3y and -3y cancel; in the second bracket the 2x and -2x cancel. The identity has stripped the expression down to two monomials.
Step 4. Multiply the simplified brackets.
Why: the product of the two remaining terms is just ordinary monomial multiplication.
Result. (2x + 3y)^2 - (2x - 3y)^2 = 24xy.
You could verify by expanding each square directly: (2x + 3y)^2 = 4x^2 + 12xy + 9y^2 and (2x - 3y)^2 = 4x^2 - 12xy + 9y^2. Their difference is 24xy. Same answer, more work.
Example 2: Factor $8a^3 + 36a^2b + 54ab^2 + 27b^3$
This four-term expression looks daunting, but the coefficients 8, 36, 54, 27 have a structure that suggests a cube of a binomial.
Step 1. Check the first and last terms. 8a^3 = (2a)^3 and 27b^3 = (3b)^3. So the candidate is (2a + 3b)^3.
Why: if the expression is a perfect cube, its first term must be the cube of the first part and its last term must be the cube of the second part. That pins down the two pieces.
Step 2. Verify the middle terms against the identity (a + b)^3 = a^3 + 3a^2b + 3ab^2 + b^3.
With a \to 2a and b \to 3b:
- 3a^2b \to 3(2a)^2(3b) = 3 \cdot 4a^2 \cdot 3b = 36a^2b — matches.
- 3ab^2 \to 3(2a)(3b)^2 = 3 \cdot 2a \cdot 9b^2 = 54ab^2 — matches.
Why: the identity predicts the middle coefficients exactly. Both match, so the expression is indeed a perfect cube.
Step 3. Write the factorisation.
Step 4. Spot-check with a = 1, b = 1: 8 + 36 + 54 + 27 = 125, and (2 + 3)^3 = 5^3 = 125. Confirmed.
Result. 8a^3 + 36a^2b + 54ab^2 + 27b^3 = (2a + 3b)^3.
Recognising perfect-cube patterns saves enormous work. If you had tried to factor this cubic by grouping or by the Factor Theorem, the path would have been much longer.
Common confusions
-
"(a + b)^2 = a^2 + b^2." This is the most common identity error in all of school algebra. The correct expansion is a^2 + 2ab + b^2. The 2ab cross term is never zero (unless a or b is zero). If you set a = 3 and b = 4: (3 + 4)^2 = 49, but 3^2 + 4^2 = 9 + 16 = 25. The missing 24 is 2 \times 3 \times 4.
-
"a^2 - b^2 = (a - b)^2." No. (a - b)^2 = a^2 - 2ab + b^2, which has a middle term. The correct factorisation of a^2 - b^2 is (a + b)(a - b) — the difference-of-squares identity, not the square-of-a-difference identity. The two are different identities.
-
"a^2 + b^2 can be factored as (a + b)(a + b)." No — (a + b)(a + b) = a^2 + 2ab + b^2 \neq a^2 + b^2. The sum of squares does not factor over the real numbers. It is irreducible.
-
"In the sum-of-cubes identity, the quadratic factor is (a^2 + ab + b^2)." For the sum of cubes, the quadratic factor is a^2 - ab + b^2 (the ab term has a minus sign). The quadratic a^2 + ab + b^2 goes with the difference of cubes. Swapping them gives the wrong factorisation.
-
"(a + b + c)^2 = a^2 + b^2 + c^2." Same error as the two-variable case, but worse. The correct expansion has six terms: a^2 + b^2 + c^2 + 2ab + 2bc + 2ca. Three cross terms are missing from the wrong version.
-
"Identities only work for positive numbers." Identities are equations that hold for all real values — positive, negative, or zero. ((-3) + 5)^2 = 4 and (-3)^2 + 2(-3)(5) + 5^2 = 9 - 30 + 25 = 4. The identity holds regardless of sign.
Going deeper
If you came here to learn the standard identities and how to apply them for expansion, simplification, and factoring, you have the complete toolkit — you can stop here. The rest is for readers who want to see where these patterns come from and where they lead.
The binomial theorem generalises everything
The identities (a + b)^2 and (a + b)^3 are special cases of a much more powerful result called the Binomial Theorem:
where \binom{n}{k} = \dfrac{n!}{k!(n-k)!} is the binomial coefficient. For n = 2, the coefficients are 1, 2, 1. For n = 3, they are 1, 3, 3, 1. For n = 4, they are 1, 4, 6, 4, 1. These are the rows of Pascal's triangle, and each row gives you the expansion of (a + b)^n without any multiplication.
The Indian mathematician Pingala described the triangle of binomial coefficients centuries before it appeared in European mathematics. The same triangle appears in Halayudha's 10th-century commentary on Pingala's work, and later in the work of Varahamihira.
Identities are special cases of polynomial rings
From the viewpoint of Polynomial Operations, an identity like (a + b)^2 = a^2 + 2ab + b^2 is a statement about the polynomial ring \mathbb{R}[a, b] — the ring of polynomials in two variables. The identity says that the polynomial (a + b)^2 - a^2 - 2ab - b^2 is the zero polynomial: it evaluates to zero for every choice of a and b, and its coefficients are all zero.
This is different from an equation, which holds only for specific values. x^2 - 5x + 6 = 0 is true only at x = 2 and x = 3. But (a + b)^2 = a^2 + 2ab + b^2 is true everywhere — it is a structural fact about the ring, not a condition on the variables.
The geometric proofs are not decorations
The square-cutting proof of (a + b)^2 is not just a visual aid — it is a genuine area argument that works for any positive a and b. The algebraic proof via the distributive law is more general (it works for negative values, complex values, matrices, and anything else that has a distributive multiplication), but the geometric proof came first historically and is often more memorable. Bhaskara II used geometric dissection arguments extensively in his algebraic work, treating algebraic identities as statements about areas and volumes.
Where this leads next
The identities on this page reappear constantly.
- Polynomial Operations — every expansion and collection-of-terms step uses these identities, whether you name them or not.
- Polynomial Factorization — pattern-matching against these identities is one of the five core factoring techniques.
- Quadratic Equations — Introduction — completing the square (the technique that derives the quadratic formula) is a direct application of the (a + b)^2 identity.
- Exponents and Powers — the laws of exponents interact with these identities when both variables and powers appear in the same expression.
- Polynomials — Introduction — the vocabulary of degree, terms, and coefficients that makes the identities precise.