In short

Over the real numbers, x^2 + y^2 does not factor. There is no way to write it as a product of two real linear pieces — it is an algebraic "atom". But you can always rewrite it: x^2 + y^2 = (x+y)^2 - 2xy. That single substitution is the most useful trick you will learn this year, because it converts any problem that already gives you the sum s = x+y and the product p = xy into a one-line calculation. You never have to find x and y separately.

Try to factor x^2 + y^2. Go on. You will fail.

You will not fail because you are bad at algebra. You will fail because over the real numbers, x^2 + y^2 is irreducible — it has no real roots when treated as a polynomial in x (the discriminant of x^2 + 0 \cdot x + y^2 is -4y^2 < 0 for y \neq 0). It only splits if you allow complex numbers: x^2 + y^2 = (x + iy)(x - iy). In the world of real-number algebra, it is an atom — a primitive piece you cannot break further.

So the factoring move is dead. But the rewriting move is alive, and it is one of the most powerful single substitutions in school algebra:

x^2 + y^2 = (x+y)^2 - 2xy

This article is about that one identity — what it is, why it works, why it matters, and three patterns where it turns ten-line problems into one-line answers.

(If you came here for the general "given x+y and xy, find anything" toolkit — sums of cubes, x \pm 1/x, fourth powers — go to Symmetric Expressions: Think Identities, Not Brute Force. This article zooms in on just the x^2 + y^2 case, which is the workhorse you will reach for most often.)

The substitution, derived in one line

Start from the identity you already know: (x+y)^2 = x^2 + 2xy + y^2. Subtract 2xy from both sides:

x^2 + y^2 = (x+y)^2 - 2xy

That is it. The proof is one sentence. Why this works: squaring a sum produces a "cross-term tax" of 2xy on top of the pure x^2 + y^2. The substitution simply pays the tax in reverse — you subtract the cross-term to recover the clean sum of squares. It is FOIL run backwards.

What is remarkable is not the algebra — it is the reframing. The left side is a function of two unknowns, x and y. The right side is a function of two other quantities, s = x+y and p = xy. If a problem hands you s and p, the right side computes immediately. The unknowns x and y never need to be unpacked.

Substitution chain: x squared plus y squared rewritten in terms of s and pA flow diagram. The leftmost box contains x squared plus y squared, labelled "two unknowns". An arrow labelled "rewrite as (x+y)² − 2xy" leads to the middle box containing (x+y)² minus 2xy. A second arrow labelled "set s = x+y, p = xy" leads to the rightmost box containing s squared minus 2p, labelled "two known quantities". x² + y² two unknowns FOIL backwards = (x+y)² − 2xy (x+y)² − 2xy substitute s = x+y, p = xy s² − 2p two knowns
The substitution chain. On the left, $x^2 + y^2$ in its raw form — two unknowns. The first arrow rewrites it using FOIL run backwards. The second arrow swaps in the names $s = x+y$ and $p = xy$. The result $s^2 - 2p$ depends only on the sum and the product — quantities the problem usually hands you directly.

Why this matters so much: in algebra, "what you are given" and "what you are asked" are usually different shapes. Most of the work in a problem is finding a bridge. The identity x^2 + y^2 = (x+y)^2 - 2xy is a bridge with massive footfall — sum-and-product is the most common thing you are given (it is exactly what Vieta's formulas hand you about quadratic roots), and "compute a sum of squares" is one of the most common things you are asked. This bridge sits at the busiest intersection in school algebra.

Three patterns where the substitution wins

Pattern 1 — Direct: given s and p, find x^2 + y^2

If x + y = 5 and xy = 6, find x^2 + y^2.

Apply the substitution:

x^2 + y^2 = (x+y)^2 - 2xy = 5^2 - 2 \cdot 6 = 25 - 12 = 13

Done. One line. Why this is faster than solving for x and y: the brute-force route would be to factor t^2 - 5t + 6 = 0, get t = 2, 3, then compute 4 + 9 = 13. Same answer, four times the work — and the moment the roots become irrational (try x+y = 3, xy = 1, where t = (3 \pm \sqrt{5})/2), brute force becomes nearly impossible while the substitution sails through unchanged.

You can sanity-check by solving anyway: x = 2, y = 3 gives 4 + 9 = 13. ✓

Pattern 2 — Inverse: solve a small system

Solve the system x + y = 4, x^2 + y^2 = 10.

You are given the sum directly and the sum of squares directly, but not the product. The substitution lets you extract it:

10 = x^2 + y^2 = (x+y)^2 - 2xy = 16 - 2xy

So 2xy = 16 - 10 = 6, giving xy = 3. Now you have both sum and product:

x + y = 4, \qquad xy = 3

By Vieta's formulas, x and y are the two roots of the quadratic

t^2 - 4t + 3 = 0

Factor: (t - 1)(t - 3) = 0, so t = 1 or t = 3. The solutions are (x, y) = (1, 3) or (3, 1).

Why this trick is so powerful here: the original system is non-linear and looks scary. But the substitution converts the second equation into a statement about the product, and once you have the sum and the product, the unknowns are the roots of a quadratic — something you have known how to solve since class 9. The hard non-linear system has been reduced to a linear-time computation followed by one quadratic factorisation.

Verify: 1 + 3 = 4 ✓ and 1^2 + 3^2 = 1 + 9 = 10 ✓.

Pattern 3 — Inequality: a clean AM-GM-style bound

Show that for x, y \geq 0 with x + y > 0,

\frac{x^2 + y^2}{x + y} \geq \frac{x + y}{2}

Rewrite the numerator using the substitution:

\frac{x^2 + y^2}{x + y} = \frac{(x+y)^2 - 2xy}{x + y} = (x+y) - \frac{2xy}{x+y}

So the inequality becomes

(x+y) - \frac{2xy}{x+y} \geq \frac{x+y}{2}

Move terms around:

\frac{x+y}{2} \geq \frac{2xy}{x+y}

Multiply both sides by 2(x+y) > 0 (the inequality direction is preserved):

(x+y)^2 \geq 4xy

But this is just (x - y)^2 \geq 0 in disguise — expand (x+y)^2 - 4xy = x^2 - 2xy + y^2 = (x-y)^2, which is non-negative for any real x, y. Why we are done: the chain of rewrites collapsed the original inequality into (x-y)^2 \geq 0, which is true for every real pair. Reading the chain backwards proves the original. The substitution x^2 + y^2 = (x+y)^2 - 2xy was the move that turned a fraction into a recognisable square.

What you have just shown is a special case of the QM–AM (quadratic mean — arithmetic mean) inequality: the quadratic mean \sqrt{(x^2+y^2)/2} is always at least the arithmetic mean (x+y)/2. The bridge between them was, once again, the same identity.

A bridge to deeper structure

This little identity is not a one-off trick. It is the first step on a staircase that runs all the way up to one of the most beautiful theorems in algebra — the fundamental theorem of symmetric polynomials.

Here is the punchline. The two quantities s = x+y and p = xy are called the elementary symmetric polynomials in x and y. They are "symmetric" because swapping x and y leaves them unchanged. The theorem says: every symmetric polynomial expression in x and y can be written using only s and p. So x^2 + y^2, x^3 + y^3, x^4 + y^4 — every power sum, every symmetric combination — has a formula in terms of s and p alone. The identity in this article is the first non-trivial example.

You will meet s and p again as soon as you reach quadratic equations. The roots \alpha, \beta of t^2 + bt + c = 0 satisfy Vieta's formulas: \alpha + \beta = -b and \alpha\beta = c. So \alpha^2 + \beta^2 = b^2 - 2c — a JEE-favourite trick that follows in one line from this article's identity. By the time you reach Olympiad problems, the s-and-p habit will save you hours.

That is why this substitution matters out of all proportion to its size. It is your first encounter with the idea that what you compute about x and y often does not depend on x and y at all — only on how they sum and multiply. Once you internalise that, large parts of algebra become linear-time.

Common confusions

Going deeper

If your goal was to learn the substitution and use it in problems, you have everything you need — stop here. The rest is for readers who want to see how this single identity connects upwards into the symmetric-polynomial machinery used in JEE Advanced and beyond.

Power sums via Newton's identity

Once you know x^2 + y^2 = s^2 - 2p, you can climb to higher power sums by recurrence. Define P_n = x^n + y^n. Then Newton's identity for two variables says:

P_{n+1} = s \cdot P_n - p \cdot P_{n-1}

with seeds P_0 = 2 and P_1 = s. Apply it: P_2 = s \cdot s - p \cdot 2 = s^2 - 2p — exactly our identity. Then P_3 = s(s^2 - 2p) - p \cdot s = s^3 - 3sp. Then P_4 = s(s^3 - 3sp) - p(s^2 - 2p) = s^4 - 4s^2 p + 2p^2. Every power sum drops out. You never touch x and y individually.

The link to Vieta and resolvents

Galois theory — the deep machinery that explains why the general quintic equation is unsolvable by radicals — sits on top of exactly this idea. The roots of any polynomial are encoded by the elementary symmetric polynomials of those roots (which are just the polynomial's coefficients, up to signs, by Vieta). Asking "is this root expression solvable?" is asking "can this symmetric expression be unwound using only the basic symmetric pieces and certain allowed operations?" The humble identity x^2 + y^2 = (x+y)^2 - 2xy is the beginner's slope of that mountain.

References