Deriving the Pythagorean Theorem

The Pythagorean theorem is the result every middle-schooler memorizes and most adults never see proven. The classic proof using rearranged squares is one of the cleanest mathematical arguments ever made.

Tech Talk News Editorial5 min readUpdated Jul 14, 2026
ShareXLinkedInRedditEmail
Deriving the Pythagorean Theorem

Key takeaways

  • The rearrangement proof of the Pythagorean theorem works by placing the same four right triangles inside a square of side (a + b) in two different arrangements, which leaves leftover area of c² in one and a² + b² in the other.
  • The algebraic proof is the same argument in different notation: (a + b)² = c² + 2ab expands to a² + 2ab + b² = c² + 2ab, and subtracting 2ab leaves a² + b² = c².
  • The similar-triangles proof drops a perpendicular from the right angle to the hypotenuse, giving a² = pc and b² = qc, which sum to c(p + q) = c² because p + q = c.
  • The Pythagorean theorem is equivalent to the assumption that space is flat, which is why it holds in flat 2D and 3D but breaks down on a sphere or saddle surface.
  • Surveyors, carpenters, and masons still use the 3-4-5 triangle to lay out a perfect right angle with nothing but a rope marked at 3, 4, and 5 units.

The Pythagorean theorem says that in a right triangle, the square of the hypotenuse equals the sum of the squares of the other two sides. a² + b² = c². Almost everyone who's been to middle school has seen this. Almost no one has seen it derived. The classic proof, attributed to Pythagoras' school but probably older, is one of the most beautifully constructed arguments in elementary geometry. Once you see it, the result becomes obvious.

The way I think about Pythagoras' theorem is that it's a statement about how distances work in the plane. If you walk three blocks east and four blocks north, you've actually traveled five blocks of straight-line distance, even though your route was seven. The 3-4-5 right triangle is the most-cited example because all three sides are whole numbers, but the relationship holds for any right triangle.

Plain English

A right triangle has one angle that's exactly 90 degrees. The hypotenuse is the side opposite the right angle, always the longest side. The other two sides are called legs.

The Rearrangement Proof

Take a right triangle with legs of length a and b and hypotenuse c. Build a square of side length (a + b). Place four copies of the right triangle inside the square in two different arrangements:

Arrangement 1: Place the four triangles in the four corners of the big square so their right angles are tucked into the corners. The space left in the middle is a square of side c, with area .

Arrangement 2: Place the four triangles inside the same big square, but pair them up so two triangles form a rectangle of dimensions a × b, then a second rectangle of the same dimensions. The leftover space consists of two squares: one of side a and one of side b. Total area of the leftover: a² + b².

In both arrangements, the same four triangles take up the same total area. So the leftover space must be the same in both. That gives:

c² = a² + b²

That's the proof. No formulas, no algebra. Just “the same four triangles in two arrangements leave equal leftover area.”

The Algebraic Confirmation

The same proof can be written algebraically. Consider the big square of side (a + b):

  • Total area: (a + b)² = a² + 2ab + b²
  • Area of the four triangles: 4 × (1/2 × a × b) = 2ab

In arrangement 1, the leftover space is a square of side c, with area . So:

(a + b)² = c² + 2ab

Expanding the left side:

a² + 2ab + b² = c² + 2ab

Subtracting 2ab from both sides:

a² + b² = c²

Done. The visual proof and the algebraic proof are the same argument, just in different notation.

The Similar-Triangles Proof

A different approach. Drop a perpendicular from the right angle of the triangle to the hypotenuse, dividing the original triangle into two smaller triangles. Both smaller triangles are similar to the original (same angles, scaled differently).

Let the perpendicular foot divide the hypotenuse into pieces of length p (closer to side a) and q (closer to side b). Similar triangles give the proportions:

  • a/c = p/a, so a² = pc.
  • b/c = q/b, so b² = qc.

Adding the two:

a² + b² = pc + qc = c(p + q) = c²

because p + q = c. This proof is shorter than the rearrangement proof but harder to visualize without a diagram.

Why This Works in 3D and Beyond

The Pythagorean theorem extends to higher dimensions. In 3D, the diagonal of a rectangular box with sides a, b, and c has length √(a² + b² + c²). The same logic applies in any number of dimensions. This is why the distance formula in n-dimensional space is the square root of the sum of squared component differences.

In machine learning, when you compute the “distance” between two vectors in 1024-dimensional space, you're using the same theorem you learned with 3-4-5 in middle school.

The 3-4-5 Triangle and Pythagorean Triples

Three integers (a, b, c) are a Pythagorean triple if a² + b² = c². The smallest is (3, 4, 5): 9 + 16 = 25. Others include (5, 12, 13), (8, 15, 17), and (7, 24, 25).

These aren't just curiosities. Surveyors, carpenters, and masons use the 3-4-5 triangle to lay out right angles in the field. Stretch a rope marked at 3 feet, 4 feet, and 5 feet, pull it taut into a triangle, and you have a perfect 90-degree corner with no instruments. You'll often read that Egyptian rope-stretchers used exactly this trick to reset field boundaries after the Nile flood. It's a great story, and there's no surviving evidence for it. The oldest hard record of the relationship is Babylonian: Plimpton 322, a clay tablet listing Pythagorean triples roughly a thousand years before Pythagoras was born.

What the Theorem Actually Says

The Pythagorean theorem is equivalent to a statement about the geometry of the plane. Specifically, it's equivalent to the assumption that the plane is “flat” (Euclidean) rather than curved. On a sphere or a saddle surface, the relationship between a triangle's sides changes. The theorem holds in flat 2D and flat 3D space and breaks down on curved surfaces.

That's why general relativity, which describes spacetime as curved by mass, doesn't use the Pythagorean theorem directly. The metric tensor in GR is a generalization of the Pythagorean relationship that handles curvature. In flat space, the metric reduces to a² + b² = c². In curved space, additional terms appear.

Takeaway

The rearrangement proof is the cleanest argument: four right triangles in two arrangements inside the same square leave equal leftover area. From there, algebra and similar triangles give equivalent proofs. The theorem is a statement about flat-space geometry, and it generalizes to higher dimensions and breaks down on curved surfaces.

The Take

The Pythagorean theorem is the rare result that's simple enough to teach in middle school and deep enough to underpin general relativity. The proof is genuinely elegant when you see the rearrangement argument with diagrams. Anyone who's been told the theorem without a derivation has been cheated of one of math's prettier arguments. It takes about three minutes to walk through with paper. Worth doing once.

Frequently asked questions

What is the simplest proof of the Pythagorean theorem?
The rearrangement proof is the cleanest. Build a square with side length (a + b) and place four copies of your right triangle inside it two different ways. In the first arrangement the leftover space is a single square of side c. In the second it's two squares of side a and side b. Same four triangles, same leftover area, so c² = a² + b².
Why does a² + b² = c² actually work?
Because it's a statement about how distance behaves in flat space. Walk three blocks east and four blocks north and you've traveled seven blocks of route but only five blocks of straight-line distance. The theorem is equivalent to assuming the plane is Euclidean rather than curved, which is why the relationship changes on a sphere or a saddle surface.
Does the Pythagorean theorem work in 3D?
Yes. The diagonal of a rectangular box with sides a, b, and c has length √(a² + b² + c²). The same logic extends to any number of dimensions, which is exactly why the distance formula in n-dimensional space is the square root of the sum of squared component differences. Computing distance between two 1024-dimensional vectors in machine learning uses this same theorem.
What is a Pythagorean triple?
A Pythagorean triple is three integers (a, b, c) where a² + b² = c². The smallest is (3, 4, 5), since 9 + 16 = 25. Other examples include (5, 12, 13), (8, 15, 17), and (7, 24, 25). These are practically useful: stretch a rope marked at 3, 4, and 5 feet and you get a perfect 90-degree corner with no instruments.

Written by

Tech Talk News Editorial

Computer engineering background. Writes about software, AI, markets, and real estate, and the places where the three meet.

More about the author
ShareXLinkedInRedditEmail