The Pythagorean theorem
In any right triangle, the square of the hypotenuse equals the sum of the squares of the two legs:
Here a and b are the legs, the two sides that meet at the right angle, and c is the hypotenuse, the longest side, opposite the right angle. Rearranging gives a formula for whichever side is missing:
The theorem only applies to right triangles. For other triangles, the law of cosines adds a correction term, c² = a² + b² − 2ab · cos C, which becomes the Pythagorean theorem when C is 90°.
Worked examples
Finding the hypotenuse
With legs a = 5 and b = 7: c² = 25 + 49 = 74, so c = √74 ≈ 8.6023252670426. Because 74 has no square factor, √74 is already in simplest form. The area is 5 × 7 / 2 = 17.5 and the height to the hypotenuse is 35 / √74, which simplifies to 35√74 / 74 ≈ 4.0686673560337.
Finding a leg
With leg b = 5 and hypotenuse c = 13√5: c² = 169 × 5 = 845, so a² = 845 − 25 = 820. Since 820 = 4 × 205, a = 2√205 ≈ 28.635642126553.
Simplifying square roots
An exact answer is often more useful than a long decimal. To simplify √N, pull out the largest perfect square that divides N: √72 = √(36 × 2) = 6√2. The calculator does this automatically whenever the inputs are whole numbers (optionally times a square root), and it also rationalizes denominators, so a result like 10 / √5 is shown as 2√5.
Pythagorean triples
A Pythagorean triple is a set of three whole numbers that satisfy a² + b² = c². Multiplying any triple by a whole number gives another one (6, 8, 10 from 3, 4, 5). Common primitive triples:
| a | b | c |
|---|---|---|
| 3 | 4 | 5 |
| 5 | 12 | 13 |
| 8 | 15 | 17 |
| 7 | 24 | 25 |
| 20 | 21 | 29 |
| 9 | 40 | 41 |
Why it works
One classic proof arranges four copies of the right triangle inside a large square with side a + b, leaving a tilted square of side c in the middle. The big square's area can be written two ways: (a + b)² and c² + 4 × (ab / 2). Expanding gives a² + 2ab + b² = c² + 2ab, and cancelling 2ab leaves a² + b² = c².
Everyday uses
Carpenters check that a corner is square by measuring 3 units along one wall, 4 along the other and confirming the diagonal is 5. The same idea finds the diagonal of a TV screen, the length of a ladder needed to reach a window, the straight-line distance between two points on a map grid, or the length of a roof rafter from its run and rise. The distance formula in coordinate geometry is simply the Pythagorean theorem applied to the horizontal and vertical differences.
Using the theorem in three dimensions
The theorem extends naturally to boxes and other 3D shapes. The space diagonal of a rectangular box with sides l, w and h is √(l² + w² + h²), found by applying a² + b² = c² twice: first across the floor of the box, then up to the opposite top corner. A box that is 3 by 4 by 12 has a floor diagonal of 5 and a space diagonal of √(25 + 144) = 13. The same idea gives the distance formula in 3D coordinates.
Checking whether a triangle is a right triangle
The converse of the theorem is just as useful: if the squares of the two shorter sides add up to the square of the longest side, the triangle must contain a right angle. If the sum is larger, the triangle is acute; if it is smaller, the triangle is obtuse. For sides 6, 7 and 9, 36 + 49 = 85, which is more than 81, so that triangle is acute.