Pythagorean theorem: formula, examples, and proof

If we know two sides of a right triangle, the Pythagorean theorem lets us find the third. The setup depends on which side is the hypotenuse, so we’ll identify that side before putting numbers into the formula. Then we’ll use the same relationship to check triangle types and see why the theorem works.

What is the Pythagorean theorem?

In a right triangle, the two sides that form the right angle are the legs. The side opposite the right angle is the hypotenuse, and it is the longest side. Calling the legs a and b and the hypotenuse c, the theorem says

a2+b2=c2
A three-four-five right triangleThe legs of lengths three and four meet at the marked right angle. The hypotenuse of length five is opposite it. All side labels sit outside the triangle.a = 3b = 4c = 53² + 4² = 5²
The hypotenuse is opposite the right angle, so it is the side represented by c in a2+b2=c2.

The legs can be labeled in either order. The hypotenuse is the side that goes by itself on the right side of this formula, whatever letter the original diagram uses for it.

Example: Find a missing hypotenuse

Suppose a right triangle has legs of lengths 4 and 12. Since the missing side is the hypotenuse, its square equals the sum of the two leg squares.

42+122=c216+144=160=c2c=160=410

We take the positive square root because c is a side length. The exact length is 410, or about 12.65.

Example: Find a missing leg

Suppose the hypotenuse is 16 and one leg is 10. Let x be the length of the missing leg.

x2+102=162x2=256-100=156x=156=239

The missing leg x therefore has length 239, or about 12.49.

Using the theorem in a real situation

Suppose a 13-foot ladder reaches 12 feet up a vertical wall, with the ground perpendicular to the wall. The ladder is the hypotenuse. If x is the distance from the foot of the ladder to the wall, then x2+122=132, so x2=25 and x = 5 feet.

The converse: Is the triangle a right triangle?

For three positive side lengths that form a triangle, call the longest side c. If a2+b2=c2, the triangle is right. That reverses the direction of the original theorem, so we call it the converse.

With lengths 5, 12, and 13, we get 52+122=25+144=169=132, so the triangle is right. More generally, compare the sum of the two shorter-side squares with the longest-side square:

Pythagorean comparisons, with c the longest side
ComparisonTriangle type
a² + b² > c²Acute
a2+b2=c2Right
a² + b² < c²Obtuse

The lengths must first form a triangle: for positive lengths with c longest, a + b > c. For side lengths 5, 9, and 10, we get 25 + 81 > 100, so the triangle is acute. For 7, 9, and 12, we get 49 + 81 < 144, so the triangle is obtuse.

An area proof of the Pythagorean theorem

Arrange four congruent right triangles inside a square of side a + b. Each triangle has area ab2, and their hypotenuses enclose a central square of side c. The central corners are right angles because the two acute angles of a right triangle add to 90°.

Four right triangles surrounding a squareA square of side a plus b contains four congruent right triangles, each with area ab divided by two. Their hypotenuses enclose a central square of side c and area c squared.a + bc²ab/2ab/2ab/2ab/2
The four right triangles surround the central square. The drawing uses legs of lengths 3 and 4.

The area of the outer square equals the four triangle areas plus the central square area.

(a+b)2=4(ab2)+c2
a2+2ab+b2=2ab+c2

Subtracting 2ab from both sides leaves a2+b2=c2. The proof works for any positive leg lengths a and b, even though our illustration uses 3 and 4.

Pythagorean triples

A Pythagorean triple consists of three positive integers that satisfy the theorem. Examples include (3, 4, 5) and (5, 12, 13). Multiplying all three lengths by the same positive integer gives another triple; doubling (3, 4, 5) gives (6, 8, 10).

We can generate triples from positive integers m > n using

a=m2-n2,b=2mn
c=m2+n2

For m = 2 and n = 1, this gives 3, 4, and 5. Expanding the two leg squares shows why the construction works:

(m2-n2)2+(2mn)2=(m2+n2)2

Some generated triples have a common factor, so this formula does not automatically give a primitive triple. The identity still guarantees a right triangle.