Topic · Geometry

The Pythagorean Theorem

In a right triangle, the square of the hypotenuse equals the sum of the squares of the other two sides. One sentence, $a^2 + b^2 = c^2$, and the entire idea of measuring distance — in physics, on a map, between two points in any dimension — is built on it.

What you'll leave with

  • The statement of the theorem, and which side of a right triangle is the hypotenuse.
  • A visual proof — areas of squares rearranged.
  • How to find a missing side, whether it's the hypotenuse or a leg.
  • Pythagorean triples — sets of integers that satisfy the equation exactly.
  • The converse, and what it lets you do.

1. The statement

Pythagorean theorem

In any right triangle with legs of length $a$ and $b$ and hypotenuse of length $c$, $$a^2 + b^2 = c^2.$$ The hypotenuse is the side opposite the right angle — always the longest side of a right triangle.

Three small clarifications matter. First, "right triangle" means a triangle with one $90°$ angle — exactly one. The theorem fails for non-right triangles. Second, the hypotenuse is opposite the right angle; the two legs are the sides that form the right angle. Third, $a$, $b$, $c$ are lengths, so they're positive numbers — when we take a square root to solve for one of them, we discard the negative root.

b (leg) a (leg) c (hypotenuse) A B C a² + b² = c²

2. A visual proof

There are over 350 known proofs of the Pythagorean theorem. The most popular is by rearrangement: take two squares of the same size, each containing four copies of the right triangle, and arrange them differently to show the theorem.

Take a square of side $a + b$. Inside, place four copies of the right triangle.

  • Arrangement 1: the triangles in the four corners, leaving a tilted square in the middle whose side is the hypotenuse $c$. The area of the middle square is $c^2$.
  • Arrangement 2: the same four triangles, but rearranged so the leftover regions are two squares — one of side $a$, one of side $b$. Their areas are $a^2$ and $b^2$.

Both arrangements use the same four triangles inside the same big square, so the leftover area in each case must be equal:

$$ c^2 = a^2 + b^2. $$

The proof is essentially "subtract the triangles from both sides," but the visual rearrangement makes it convincing without algebra.

Historical note

The theorem is named for Pythagoras (~500 BCE), but the relationship was known well before him — the Babylonians used it around 1800 BCE, and the ancient Chinese mathematical text Zhou Bi Suan Jing contains a version with a pictorial proof. Pythagoras may have been the first to prove it as a general statement (rather than verifying specific cases), which is why his name stuck.

3. Finding a missing side

The theorem is most often used in reverse: given two sides of a right triangle, find the third.

Finding the hypotenuse

If the two legs are $3$ and $4$, find the hypotenuse $c$:

$$ c^2 = 3^2 + 4^2 = 9 + 16 = 25, $$ $$ c = \sqrt{25} = 5. $$

Finding a leg

If the hypotenuse is $13$ and one leg is $5$, find the other leg $b$:

$$ 5^2 + b^2 = 13^2, $$ $$ 25 + b^2 = 169, $$ $$ b^2 = 144, $$ $$ b = 12. $$

The procedure is the same whichever side is missing. The only thing to be careful about is the direction: if you're solving for a leg, you subtract the known leg's square from the hypotenuse's square. If you're solving for the hypotenuse, you add.

4. Pythagorean triples

A Pythagorean triple is a set of three positive integers $(a, b, c)$ that satisfy $a^2 + b^2 = c^2$. They're surprisingly rare — most triangles with two integer legs have an irrational hypotenuse.

The famous ones, worth memorizing:

TripleVerification
$(3, 4, 5)$$9 + 16 = 25$
$(5, 12, 13)$$25 + 144 = 169$
$(8, 15, 17)$$64 + 225 = 289$
$(7, 24, 25)$$49 + 576 = 625$

Each of these gives infinitely many more triples by scaling: $(6, 8, 10)$, $(9, 12, 15)$, and $(15, 20, 25)$ are all $(3, 4, 5)$ multiplied by $2$, $3$, $5$.

Recognizing a Pythagorean triple in a problem saves you from having to compute a square root. If you see legs $5$ and $12$, the hypotenuse is $13$ — no calculator needed.

5. The converse

The Pythagorean theorem says: if a triangle is right-angled, then $a^2 + b^2 = c^2$. The converse reverses that arrow:

If $a^2 + b^2 = c^2$ for the three side lengths of a triangle, then the triangle is right-angled, with the right angle opposite the side $c$.

This is genuinely useful: it lets you test whether an arbitrary triangle is right-angled, given only its side lengths. If $a^2 + b^2 < c^2$, the triangle is obtuse; if $a^2 + b^2 > c^2$, it's acute.

RelationTriangle type
$a^2 + b^2 = c^2$Right (the right angle is opposite $c$).
$a^2 + b^2 > c^2$Acute (all angles less than $90°$).
$a^2 + b^2 < c^2$Obtuse (one angle greater than $90°$).

6. Extensions: distance and 3D

The theorem isn't just a fact about triangles — it's the engine behind every formula for distance. Once you see it that way, two extensions fall out for free.

The distance formula

Given two points $(x_1, y_1)$ and $(x_2, y_2)$ in the plane, the straight-line distance between them is simply the hypotenuse of a right triangle whose legs are the horizontal and vertical gaps:

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

That's the entire derivation. The leg lengths $|x_2 - x_1|$ and $|y_2 - y_1|$ are just $a$ and $b$, and the distance $d$ is $c$.

Three dimensions

In 3D, the theorem stacks on itself. To find the body diagonal of a box with side lengths $\ell$, $w$, $h$, first use the theorem in the base to get the floor diagonal:

$$ \text{floor diagonal} = \sqrt{\ell^2 + w^2}. $$

Then apply the theorem again, vertically, with that floor diagonal as one leg and the height $h$ as the other:

$$ d_{3\text{D}} = \sqrt{\ell^2 + w^2 + h^2}. $$

The same pattern continues into any number of dimensions — the squared distance is always the sum of the squared coordinate differences. The Pythagorean theorem is the rule that makes Euclidean geometry Euclidean.

Worth noticing

The 3D formula $\sqrt{\ell^2 + w^2 + h^2}$ isn't a new theorem — it's the original theorem used twice. Every "distance" you'll meet in physics or data science (Euclidean norm, length of a vector, magnitude of velocity) is the same idea.

7. Playground: tune the legs

Slide the two legs and watch $a^2 + b^2 = c^2$ unfold geometrically — three squares whose areas line up by the theorem. The orange squares on the legs always add up, area-for-area, to the green square on the hypotenuse.

32 + 42 = 52
9 + 16 = 25, so c = 5.00
Pythagorean triple (3, 4, 5)
3.0
4.0
Copied!
Try it

Pull both legs to $1$. The hypotenuse becomes $\sqrt{2}$ — the original irrational number. Now try $(5, 12)$: the green square's area is exactly the sum of the orange squares' areas, and $c$ snaps to $13$.

8. Common pitfalls

Using the wrong side as the hypotenuse

The hypotenuse is the side opposite the right angle, always the longest side. If you plug a leg into the $c$ position of $a^2 + b^2 = c^2$, the equation will give you a nonsensical answer — or, worse, a plausible-looking one that's actually wrong.

Applying it to non-right triangles

The theorem fails for general triangles. For acute or obtuse triangles, you need the more general Law of Cosines, of which the Pythagorean theorem is the special case where the angle opposite $c$ is $90°$. If a problem doesn't specify or guarantee a right angle, the theorem might not apply.

$\sqrt{a^2 + b^2} \neq a + b$

This is the freshman's dream all over again. The hypotenuse of a $3$-$4$ right triangle is $5$, not $7$. Roots don't distribute over sums.

Forgetting units

If the legs are in meters, the hypotenuse is in meters too — not meters squared. The squaring happens during the calculation, but the square root at the end brings you back to the original unit. Carry the units through.

9. Worked examples

Example 1 · A right triangle has legs $6$ and $8$. Find the hypotenuse.
$$ c^2 = 6^2 + 8^2 = 36 + 64 = 100, \quad c = 10. $$

(Or recognize the $(6, 8, 10) = 2 \cdot (3, 4, 5)$ Pythagorean triple.)

Example 2 · The hypotenuse is $15$ and one leg is $9$. Find the other leg.
$$ 9^2 + b^2 = 15^2 \;\Longrightarrow\; 81 + b^2 = 225 \;\Longrightarrow\; b^2 = 144 \;\Longrightarrow\; b = 12. $$

This is the $(9, 12, 15) = 3 \cdot (3, 4, 5)$ triple.

Example 3 · A ladder leaning against a wall

A $13$-foot ladder leans against a wall, with its foot $5$ feet from the base. How high up the wall does it reach?

The ladder is the hypotenuse. The horizontal distance is one leg; the height up the wall is the other.

$$ 5^2 + h^2 = 13^2 \;\Longrightarrow\; h^2 = 144 \;\Longrightarrow\; h = 12 \text{ feet}. $$

The $(5, 12, 13)$ triple again — Pythagorean triples are ladder-shaped.

Example 4 · Is a triangle with sides $7$, $24$, $26$ a right triangle?

Test the converse: compare $7^2 + 24^2$ to $26^2$.

$$ 49 + 576 = 625, \qquad 26^2 = 676. $$

$625 \neq 676$, so the triangle is not right-angled. Since $49 + 576 < 676$, it's obtuse, with the obtuse angle opposite the side of length $26$.

(If the third side had been $25$, $7^2 + 24^2 = 625 = 25^2$ would make it a right triangle.)

Example 5 · The diagonal of a unit square

A square with side $1$ has two right triangles when split along the diagonal. The diagonal is the hypotenuse of a right triangle with both legs equal to $1$:

$$ d^2 = 1^2 + 1^2 = 2, \quad d = \sqrt{2}. $$

This is the original irrational number — the diagonal of a unit square. Pythagoras's theorem was what forced the Greeks to confront the existence of numbers that aren't fractions.

Sources & further reading

Test your understanding

A quiz that builds from easy to hard. Pick an answer to get instant feedback and a worked explanation. Your progress is saved in this browser — come back anytime to continue.

Question 1 of 1
0 correct