A single algebraic identity can produce infinitely many right triangles with whole-number side lengths. That sounds almost like a magic trick, but it is really a consequence of structure: when an expression is built in the right way, its form guarantees a relationship every time. This is one of the most powerful ideas in algebra. Instead of checking one case after another, you prove something once and know it is true forever.
Polynomial identities help us do exactly that. They let us transform expressions, explain patterns in numbers, and connect algebra to geometry. One especially famous identity, \((x^2+y^2)^2=(x^2-y^2)^2+(2xy)^2\), links polynomial expressions to the Pythagorean theorem and shows how algebra can generate Pythagorean triples such as \((3,4,5)\), \((5,12,13)\), and many more.
In algebra, a polynomial identity is an equation that is true for every value of the variable or variables for which both sides are defined. This is very different from an ordinary equation, which may be true only for certain values. As [Figure 1] shows, the key difference is not what the expression looks like at first glance, but whether the equality holds universally or only sometimes.
For example, \((x+2)^2=x^2+4x+4\) is an identity because expanding the left side always gives the right side. But \(x+2=7\) is not an identity, because it is true only when \(x=5\).
Identity means an equality that is true for all values in its domain. Polynomial identity means such an equality where the expressions involved are polynomials. A Pythagorean triple is a set of three positive integers \((a,b,c)\) such that \(a^2+b^2=c^2\).
Why is this useful? Because if two expressions are identical, you can replace one with the other whenever it helps. That can make calculations shorter, proofs cleaner, and patterns easier to see.

Several identities appear again and again in algebra. You should know them not just as formulas to memorize, but as patterns to recognize.
The square of a sum is
\[(a+b)^2=a^2+2ab+b^2\]
The square of a difference is
\[(a-b)^2=a^2-2ab+b^2\]
The difference of squares is
\[a^2-b^2=(a-b)(a+b)\]
These identities are closely related. In fact, many more complicated identities can be proved by applying these basic ones carefully and combining like terms.
When multiplying polynomials, distribute each term to every term in the other expression. For example, \((a+b)(c+d)=ac+ad+bc+bd\). Combining like terms correctly is essential when proving identities.
A useful strategy is to look for structure before doing any work. If you see a squared binomial, think about the square formulas. If you see subtraction between two squares, think about factoring. Algebra becomes much easier when patterns stand out to you.
There are several standard ways to prove a polynomial identity.
Method 1: Expand one side and simplify until it matches the other side.
Method 2: Expand both sides and show they simplify to the same expression.
Method 3: Factor one side to make the structure of the other side appear.
Method 4: Substitute equivalent expressions using known identities.
When proving an identity, do not plug in just one or two values and declare it proven. Testing values may suggest that an identity is true, but it does not prove it for all values. A proof must show that the two expressions are equal in general.
What a proof of an identity really does
A proof of an identity transforms expressions using valid algebraic rules until both sides have the same form. This matters because identities describe a permanent relationship, not a coincidence for a few examples. If the reasoning is correct, the result applies to every allowed value of the variables.
It is often best to start with the more complicated side. That gives you more opportunities to simplify. Also, be careful with signs. A tiny mistake, especially with negative terms, can completely change the result.
Identities are not only for proofs. They are practical tools. Suppose you want to compute \(49^2\) mentally. Since \(49=50-1\), use the square of a difference:
\[(50-1)^2=50^2-2(50)(1)+1^2=2500-100+1=2401\]
That is faster and more reliable than multiplying \(49\cdot 49\) from scratch.
Identities also explain numerical relationships. For instance, if two numbers are \(a+b\) and \(a-b\), their product is
\[(a+b)(a-b)=a^2-b^2\]
This shows that the product depends on a difference of squares. So algebra is revealing a hidden pattern in arithmetic.
Mental-math techniques used by many mathematicians rely on identities. Fast squaring, quick estimation, and efficient error checking often come from rewriting expressions into more convenient forms.
These relationships become even more interesting when they connect to geometry, which leads us to one of the most beautiful identities in high school algebra.
The Pythagorean triple relationship \(a^2+b^2=c^2\) describes the side lengths of a right triangle. A remarkable algebraic identity creates numbers that automatically satisfy this relationship. As [Figure 2] illustrates, if we define the side lengths using two numbers \(x\) and \(y\), algebra builds a right triangle for us.
Start with the expressions \(x^2-y^2\), \(2xy\), and \(x^2+y^2\). We want to show that the first two, when squared and added, equal the square of the third:
\[(x^2-y^2)^2+(2xy)^2=(x^2+y^2)^2\]
Now expand the left side:
\[(x^2-y^2)^2=x^4-2x^2y^2+y^4\]
and
\[(2xy)^2=4x^2y^2\]
Adding gives
\[x^4-2x^2y^2+y^4+4x^2y^2=x^4+2x^2y^2+y^4=(x^2+y^2)^2\]
So the identity is proved:
\[(x^2-y^2)^2+(2xy)^2=(x^2+y^2)^2\]
This means that if \(x\) and \(y\) are integers with \(x>y>0\), then
\[a=x^2-y^2, \quad b=2xy, \quad c=x^2+y^2\]
form a Pythagorean triple.

This is much more than a single example. It is a formula for generating triples: every choice of suitable integers \(x\) and \(y\) gives a triple. Later, when we discuss primitive triples, we will return to the same structure we see in [Figure 2].
Worked example 1: Prove an identity
Prove that \((m+n)^2-(m-n)^2=4mn\).
Step 1: Expand each square.
\((m+n)^2=m^2+2mn+n^2\) and \((m-n)^2=m^2-2mn+n^2\).
Step 2: Subtract the second expression from the first.
\((m^2+2mn+n^2)-(m^2-2mn+n^2)\)
Combining like terms gives \(4mn\).
Step 3: State the conclusion.
Since the left side simplifies to \(4mn\), the identity is true.
The proven identity is \[(m+n)^2-(m-n)^2=4mn\]
This example shows a common pattern: terms often cancel in a satisfying way when two related squares are involved.
Worked example 2: Use an identity to evaluate a numerical expression
Evaluate \(103^2-97^2\) efficiently.
Step 1: Recognize the difference of squares.
Use \(a^2-b^2=(a-b)(a+b)\).
Step 2: Substitute \(a=103\) and \(b=97\).
\(103^2-97^2=(103-97)(103+97)\)
Step 3: Compute.
\((103-97)(103+97)=6\cdot 200=1200\)
The value is \(1200\)
Without the identity, you would have to square both numbers first. The identity exposes a much faster route.
Worked example 3: Generate a Pythagorean triple
Use \(x=2\) and \(y=1\).
Step 1: Compute each expression.
\(a=x^2-y^2=2^2-1^2=4-1=3\)
\(b=2xy=2(2)(1)=4\)
\(c=x^2+y^2=2^2+1^2=4+1=5\)
Step 2: Check the Pythagorean relationship.
\(3^2+4^2=9+16=25\)
and \(5^2=25\).
Step 3: Conclude.
Since \(3^2+4^2=5^2\), \((3,4,5)\) is a Pythagorean triple.
The generated triple is \((3,4,5)\)
The famous \((3,4,5)\) triangle is not an isolated fact. It comes directly from the identity.
Worked example 4: Generate another triple
Use \(x=3\) and \(y=2\).
Step 1: Find the three numbers.
\(a=x^2-y^2=9-4=5\)
\(b=2xy=2(3)(2)=12\)
\(c=x^2+y^2=9+4=13\)
Step 2: Verify.
\(5^2+12^2=25+144=169\)
and \(13^2=169\).
The generated triple is \((5,12,13)\)
Now the pattern starts to feel systematic. Change \(x\) and \(y\), and a new right triangle appears.
Not every generated triple is fundamentally new. For example, if \(x=4\) and \(y=3\), then
\(a=4^2-3^2=7\), \(b=2(4)(3)=24\), and \(c=4^2+3^2=25\), giving \((7,24,25)\).
But if you choose values that produce a common factor, you may get a triple that is just a multiple of a smaller one. For instance, if a triple is \((6,8,10)\), dividing by \(2\) gives \((3,4,5)\). The first is still a valid Pythagorean triple, but it is not a primitive triple.
A primitive triple is a Pythagorean triple in which the three numbers have no common factor greater than \(1\). Many primitive triples can be generated when \(x\) and \(y\) are coprime and not both odd. Those conditions are part of a deeper number-theory pattern.
Why the formula works so well
The expressions \(x^2-y^2\), \(2xy\), and \(x^2+y^2\) are designed so that the unwanted terms cancel and the needed terms combine. When the squares are expanded, \(-2x^2y^2\) and \(+4x^2y^2\) together create \(+2x^2y^2\), exactly matching the middle term of \((x^2+y^2)^2\).
There are also related identities that create other useful relationships. For example,
\[(a+b)^2+(a-b)^2=2a^2+2b^2\]
This identity explains why the sum of two related squares can often be simplified dramatically. Such relationships appear in algebra, geometry, and even physics when formulas involve squared quantities.
| Choice of \(x,y\) | \(x^2-y^2\) | \(2xy\) | \(x^2+y^2\) | Triple |
|---|---|---|---|---|
| \(x=2, y=1\) | \(3\) | \(4\) | \(5\) | \((3,4,5)\) |
| \(x=3, y=2\) | \(5\) | \(12\) | \(13\) | \((5,12,13)\) |
| \(x=4, y=1\) | \(15\) | \(8\) | \(17\) | \((8,15,17)\) |
| \(x=4, y=3\) | \(7\) | \(24\) | \(25\) | \((7,24,25)\) |
Table 1. Several Pythagorean triples generated by the identity using different integer values of \(x\) and \(y\).
Notice that the order of the two legs does not matter in a right triangle. So \((15,8,17)\) and \((8,15,17)\) describe the same triangle.
[Figure 3] Builders, engineers, and designers constantly rely on right-triangle relationships, and the same algebraic structure behind Pythagorean triples helps explain why certain measurements work so neatly. In construction, for example, a rectangular frame is checked by comparing diagonal and side lengths. The setup shows how a triangle with side lengths from a Pythagorean triple guarantees a right angle.
If a carpenter marks lengths \(3\), \(4\), and \(5\) units along a frame, the corner is square because \(3^2+4^2=5^2\). Larger versions such as \((6,8,10)\) or \((9,12,15)\) work the same way. These are scaled forms of the same numerical relationship.

In computer graphics and game design, distances on a grid often come from the Pythagorean theorem. When movement in the horizontal and vertical directions is known, the diagonal distance follows from a square-root calculation. The polynomial identity that generates integer triples gives clean test cases for software and modeling.
Surveying, architecture, robotics, and navigation also use right-triangle relationships. When exact integer lengths are convenient, Pythagorean triples are especially useful. The triangle pattern from [Figure 2] is not just theoretical; it appears whenever a system depends on perpendicular directions and diagonal distance.
Ancient builders used rope knotted into lengths \(3\), \(4\), and \(5\) to create right angles. Long before modern algebraic notation, people were already using the numerical relationship that polynomial identities explain so elegantly.
That is one of the best things about algebra: it often gives a general explanation for methods people discovered long ago by experiment.
One common mistake is treating an identity like an equation with one solution. If an expression is an identity, you are not solving for a single value; you are proving that two forms are always equal.
Another common mistake is expanding incorrectly. For example, \((a-b)^2\) is not \(a^2-b^2\). The correct expansion is
\[(a-b)^2=a^2-2ab+b^2\]
That middle term matters.
A third mistake is forgetting that \((2xy)^2=4x^2y^2\), not \(2x^2y^2\). When a product is squared, every factor is squared.
Finally, when generating triples, remember the formulas carefully:
\[a=x^2-y^2, \quad b=2xy, \quad c=x^2+y^2\]
Switching a plus sign and a minus sign changes the entire relationship.