All topics
Foundational

Geometry · a² + b² = c²

Pythagoras' theorem

Build a square on each side of a right triangle and the two smaller ones always add up to the biggest. One tidy fact about triangles that quietly runs through distance, screens, navigation and a surprising amount of mathematics.

Click to begin

Explained like you're twelve. Explained like you've just finished school. Explained like you're at university.

Geometry · Proved since antiquity

The squares on the two short sides add up to the square on the long one.

Each side of the right triangle carries a square. Reshape it with the two sliders and watch the numbers: the green squares on the short sides always sum to the pale square on the hypotenuse. Leave it alone and it breathes through every shape, and the sum holds for all of them. Set the legs to 3 and 4 and the hypotenuse lands exactly on 5.

A right triangle is one with a square corner, the kind you see where a wall meets the floor. The two sides that make that corner are the short ones. The slanted side facing the corner, always the longest, has a special name: the hypotenuse.

Pythagoras' theorem is a promise about those three sides. Draw a square on each side, using the side as one edge. The theorem says the two squares on the short sides, added together, always make exactly the same area as the big square on the hypotenuse. Every time, for every right triangle, no exceptions.

The neatest example uses the sides 3, 4 and 5. The squares on the short sides hold 9 and 16 little tiles. Add them and you get 25, which is exactly the square on the long side, 5 by 5. Builders have used that 3-4-5 trick for thousands of years to check that a corner is truly square.

It sounds like a fact about triangles, but really it is a fact about distance. Any time you want to know how far apart two things are when one is across and the other is up, this is the rule that tells you. Your phone uses it, map apps use it, video games use it. A very old idea about triangles turns out to be how we measure the world.

Label the two short sides (the legs) \(a\) and \(b\), and the hypotenuse \(c\). The theorem is the clean statement

\[ a^2 + b^2 = c^2. \]

The squares are literal: \(a^2\) is the area of the square drawn on side \(a\). So the claim is that two areas add to a third. With \(a = 3\) and \(b = 4\) you get \(9 + 16 = 25\), and \(c = \sqrt{25} = 5\). Three whole numbers that fit the equation, like \((3,4,5)\), \((5,12,13)\) and \((8,15,17)\), are called Pythagorean triples, and there are infinitely many of them.

Here is one way to see why it must be true. Take four copies of the same right triangle and arrange them inside a big square whose side is \(a + b\). Slot them one way and the gap left in the middle is a tilted square of side \(c\), with area \(c^2\). Slide the same four triangles into the corners a different way and the leftover space splits into two squares, of areas \(a^2\) and \(b^2\). The four triangles took up the same room both times, so the space they left must be equal: \(c^2 = a^2 + b^2\). No measuring, just rearranging.

The theorem also runs the other way, which is what makes it useful. If a triangle's sides happen to satisfy \(a^2 + b^2 = c^2\), then the corner opposite \(c\) is a perfect right angle. That converse is the reason a knotted 3-4-5 loop of rope squares up a corner on a building site.

And it is the seed of the distance formula. Put two points on a grid, one at \((x_1, y_1)\) and the other at \((x_2, y_2)\). The horizontal gap between them is one leg, the vertical gap the other, and the straight-line distance is the hypotenuse:

\[ d = \sqrt{(x_2 - x_1)^2 + (y_2 - y_1)^2}. \]

That is Pythagoras in disguise, and it is the formula quietly doing the work whenever a computer measures how far apart two things are.

A proof from similar triangles. Drop a perpendicular from the right angle onto the hypotenuse, splitting the triangle into two smaller ones. Each shares an angle with the original, so all three triangles are similar. Matching up their sides gives \(a^2 = c\,p\) and \(b^2 = c\,q\), where \(p\) and \(q\) are the two pieces the foot of the perpendicular cuts the hypotenuse into. Since \(p + q = c\), adding the two gives \(a^2 + b^2 = c(p + q) = c^2\). This similarity argument is essentially Euclid's Proposition I.47, and it shows the theorem is really a statement about how areas scale with length.

The generalisation: the law of cosines. Pythagoras is the right-angled special case of a rule that holds for any triangle. For a triangle with sides \(a\), \(b\), \(c\) and the angle \(C\) opposite \(c\), \[ c^2 = a^2 + b^2 - 2ab\cos C. \] When \(C = 90^\circ\), \(\cos C = 0\) and the correction term vanishes, leaving \(c^2 = a^2 + b^2\). The extra term measures exactly how far from a right angle the corner is, and its sign tells you whether the angle is acute or obtuse.

It defines what "distance" means. Extend the distance formula to three dimensions and it just gains a term, \(d = \sqrt{\Delta x^2 + \Delta y^2 + \Delta z^2}\), and the pattern continues into any number of dimensions. This Euclidean norm is Pythagoras promoted to a definition: it is the length that a straight ruler measures in flat space, and it underlies the whole idea of a vector's magnitude and of perpendicular directions being independent. In an inner-product space the same identity, \(\lVert u + v \rVert^2 = \lVert u \rVert^2 + \lVert v \rVert^2\) exactly when \(u\) and \(v\) are orthogonal, is the abstract Pythagorean theorem, and it powers everything from least-squares fitting to the geometry of function spaces.

The crack it opened. Set \(a = b = 1\) and the hypotenuse is \(\sqrt{2}\), a number that cannot be written as a ratio of whole numbers. The Pythagoreans, who wanted all of reality built from whole-number ratios, ran straight into this irrationality inside their own theorem. It was one of the first proofs that the number line holds more than fractions, a genuinely unsettling discovery that pushed mathematics toward the real numbers.

Only in flat space. The theorem is a property of Euclidean, flat geometry. On the curved surface of a sphere or in the warped spacetime of general relativity it fails, and the gap between \(a^2 + b^2\) and \(c^2\) becomes a way to measure the curvature itself. Where it holds, space is flat; where it breaks, space bends. Even the exception turns Pythagoras into a tool.

Related: Fermat's Last Theorem · next: Calculus · or go back to all topics.