Geometry
Pythagorean Theorem: Formula, Proofs And Real Examples
Last updated: October 2026
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². For example, a right triangle with legs of 3 and 4 has a hypotenuse of 5, because 3² + 4² = 9 + 16 = 25, and √25 = 5.
This guide explains the formula, shows how to use it, walks through four proofs, and covers the converse, Pythagorean triples and real-world uses.
What Is The Pythagorean Theorem?
The Pythagorean theorem is a rule about right triangles, which are triangles with one 90° angle. It says the two shorter sides, squared and added together, equal the longest side squared.
A right triangle has three named sides:
| Side | What it is | Letter |
|---|---|---|
| Legs | The two sides that form the right angle | a and b |
| Hypotenuse | The longest side, across from the right angle | c |
The theorem only works for right triangles. For a triangle with no 90° angle, a² + b² will not equal c², and you need a different rule, covered later in this guide.
The picture behind the formula: build a square on each side of a right triangle. The area of the big square on the hypotenuse equals the areas of the two smaller squares on the legs added together. With sides 3, 4 and 5, the squares have areas 9, 16 and 25, and 9 + 16 = 25.
The Pythagorean Theorem Formula
The main formula is a² + b² = c². You can rearrange it to find any missing side.
| To find | Formula |
|---|---|
| Hypotenuse c | c = √(a² + b²) |
| Leg a | a = √(c² − b²) |
| Leg b | b = √(c² − a²) |
Rule of thumb: to find the hypotenuse, add the squares. To find a leg, subtract the smaller square from the larger one.
How To Use The Pythagorean Theorem: Worked Examples
Every problem follows the same steps: label the sides, plug them into the right formula, then take a square root. These examples cover the most common types.
Finding The Hypotenuse
Example: the legs are 6 and 8.
- Square the legs: 6² = 36 and 8² = 64.
- Add: 36 + 64 = 100.
- Take the square root: √100 = 10.
Finding A Missing Leg
Example: the hypotenuse is 13 and one leg is 5.
- Square both: 13² = 169 and 5² = 25.
- Subtract: 169 − 25 = 144.
- Take the square root: √144 = 12.
When The Answer Is Not A Whole Number
Most real triangles do not give neat answers. Example: the legs are 5 and 7.
- 5² + 7² = 25 + 49 = 74.
- c = √74 ≈ 8.602.
Leave it as √74 for exact answers, or round for measurements. For quick answers with any numbers, the Pythagorean theorem calculator shows each step.
Sides Written With Variables
Some problems give the sides as expressions. Example: the legs are x and x + 7, and the hypotenuse is x + 8.
- Write the equation: x² + (x + 7)² = (x + 8)².
- Expand: x² + x² + 14x + 49 = x² + 16x + 64.
- Simplify: x² − 2x − 15 = 0.
- Factor: (x − 5)(x + 3) = 0, so x = 5 or x = −3.
- A side cannot be negative, so x = 5, and the sides are 5, 12 and 13.
Step 3 is a quadratic equation. If it does not factor easily, the quadratic equation solver finds the roots.
Pythagorean Theorem Proofs
There are hundreds of known proofs of the Pythagorean theorem. Elisha Loomis collected 367 of them in his book The Pythagorean Proposition. Here are four of the clearest, each using a different idea. Euclid's version, in Book I, Proposition 47 of his Elements, is the most famous, but these are easier to follow.
Proof 1: Rearranging Four Triangles
This proof compares the area of one big square measured two different ways.
- Make a large square with sides of length a + b.
- Place four copies of the right triangle inside it, one in each corner, so their hypotenuses form a tilted square in the middle. That inner square has side c.
- Area of the big square, way 1: (a + b)² = a² + 2ab + b².
- Area of the big square, way 2: four triangles plus the inner square: 4 × (½ab) + c² = 2ab + c².
- Set them equal: a² + 2ab + b² = 2ab + c².
- Subtract 2ab from both sides: a² + b² = c².
Proof 2: The Square Inside A Square
This version appears in an ancient Chinese text, the Zhoubi Suanjing, and uses the same four triangles arranged the other way.
- Arrange the four triangles inside a square of side c, with their hypotenuses on the outside edges.
- A small square is left in the middle. Its side is b − a.
- Area of the big square: c².
- Area of the pieces: 4 × (½ab) + (b − a)² = 2ab + b² − 2ab + a² = a² + b².
- So c² = a² + b².
Proof 3: Similar Triangles
This proof uses the fact that a right triangle splits into two smaller triangles with the same shape.
- Draw a line from the right angle straight down to the hypotenuse. This height splits c into two parts, p and q, so p + q = c.
- The two small triangles are similar to the original triangle, because they share its angles.
- Similar triangles have matching ratios. That gives a ÷ c = p ÷ a, so a² = cp. In the same way, b² = cq.
- Add the two equations: a² + b² = cp + cq = c(p + q) = c × c.
- So a² + b² = c².
Proof 4: President Garfield's Trapezoid
In 1876, while serving in Congress, future U.S. President James A. Garfield published a proof that uses a trapezoid made of three triangles.
- Place two copies of the right triangle so their legs line up, and connect the tops. This forms a trapezoid with parallel sides a and b and height a + b.
- Area of the trapezoid: ½ × (a + b) × (a + b) = ½(a² + 2ab + b²).
- The trapezoid is made of the two original triangles plus a third triangle with two sides of length c and a right angle between them.
- Area of the pieces: 2 × (½ab) + ½c² = ab + ½c².
- Set them equal: ½a² + ab + ½b² = ab + ½c².
- Subtract ab and multiply by 2: a² + b² = c².
The Converse: How To Test For A Right Angle
The converse of the Pythagorean theorem says that if a² + b² = c² for the three sides of a triangle, then the triangle has a right angle. This gives you a test you can run with only a ruler.
Let c be the longest side, then compare a² + b² with c²:
| Result | Type of triangle | Example |
|---|---|---|
| a² + b² = c² | Right | 8, 15, 17: 64 + 225 = 289 = 17² |
| a² + b² > c² | Acute (all angles less than 90°) | 8, 15, 16: 289 > 256 |
| a² + b² < c² | Obtuse (one angle more than 90°) | 4, 5, 7: 41 < 49 |
Pythagorean Triples
A Pythagorean triple is a set of three whole numbers that fit a² + b² = c². These are worth memorizing, because they appear on tests constantly.
| Triple | Check |
|---|---|
| 3, 4, 5 | 9 + 16 = 25 |
| 5, 12, 13 | 25 + 144 = 169 |
| 8, 15, 17 | 64 + 225 = 289 |
| 7, 24, 25 | 49 + 576 = 625 |
| 20, 21, 29 | 400 + 441 = 841 |
| 9, 40, 41 | 81 + 1,600 = 1,681 |
Multiples also work. Doubling 3, 4, 5 gives 6, 8, 10, and multiplying by 10 gives 30, 40, 50. If you spot that two sides are a multiple of a known triple, you can find the third side without any square roots.
Make your own: for whole numbers m > n, the sides m² − n², 2mn and m² + n² always form a triple. With m = 3 and n = 2, you get 5, 12, 13.
How The Pythagorean Theorem Is Used In Real Life
Any time you need a straight-line distance across a right angle, the Pythagorean theorem gives it. Here are the most common uses.
- Squaring a corner: builders mark 3 feet along one wall and 4 feet along the other. If the diagonal between the marks is exactly 5 feet, the corner is a true 90°. For bigger jobs, they use 6, 8, 10 or 30, 40, 50.
- Distance on a map or graph: the distance between two points is √((x₂ − x₁)² + (y₂ − y₁)²). This is the distance formula, and it is the Pythagorean theorem on a coordinate grid.
- 3D diagonals: the longest straight line inside a box is √(length² + width² + height²). A box that is 3 by 4 by 12 inches has an inside diagonal of exactly 13 inches.
A Short History Of The Pythagorean Theorem
The theorem is named after Pythagoras, a Greek thinker who lived around 570 to 495 BCE, but people used it long before him. A Babylonian clay tablet called Plimpton 322, from around 1800 BCE, lists numbers that match Pythagorean triples. India's Sulba Sutras and China's Zhoubi Suanjing also describe the rule. New proofs still appear today: in 2023, two New Orleans high school students, Calcea Johnson and Ne'Kiya Jackson, presented proofs based on trigonometry.
When The Pythagorean Theorem Does Not Apply
The theorem only works for right triangles drawn on a flat surface. For any other triangle, use the law of cosines instead:
c² = a² + b² − 2ab cos C
Here, C is the angle across from side c. When C = 90°, cos C = 0, and the law of cosines becomes a² + b² = c². So the Pythagorean theorem is really a special case of this more general rule.
It also only holds exactly on flat surfaces, not on a curved surface like the Earth over long distances.
Common Pythagorean Theorem Mistakes
| Mistake | Example | Fix |
|---|---|---|
| Using the wrong side as c | Treating a leg as the hypotenuse | c is always the longest side, across from the right angle |
| Adding to find a leg | 13² + 5² for a missing leg | Subtract: 13² − 5² = 144 |
| Forgetting the square root | Stopping at c² = 100 | Take √100 = 10 |
| Adding the sides before squaring | (3 + 4)² = 49 | Square first: 3² + 4² = 25 |
Summary
- In a right triangle, a² + b² = c², where c is the hypotenuse.
- Add squares to find the hypotenuse, subtract to find a leg, and finish with a square root.
- Proofs by rearrangement, similar triangles and Garfield's trapezoid all show why it works.
- The converse tests whether a triangle is right, acute or obtuse.
- Pythagorean triples like 3, 4, 5 and 5, 12, 13 save time on tests and in building work.
Next step: try the worked examples above on your own, then check your answers with the Pythagorean theorem calculator. For more math help, browse the tools on the Calc Solver homepage.
Frequently Asked Questions
Who discovered the Pythagorean theorem?
No single person discovered it. Babylonian, Indian and Chinese mathematicians used the relationship centuries before Pythagoras. The theorem carries his name because the ancient Greeks credited Pythagoras or his followers with proving it as a general rule for every right triangle. Since no writings by Pythagoras himself survive, historians cannot say for certain what he personally proved.
Does the Pythagorean theorem work for all triangles?
No. It only works for right triangles, which have one 90° angle. For other triangles, a² + b² will be larger or smaller than c². To find a missing side in any triangle, use the law of cosines, which adds a correction term based on the angle. When that angle is 90°, the law of cosines turns back into the Pythagorean theorem.
Can the hypotenuse be shorter than a leg?
No. The hypotenuse is always the longest side of a right triangle, because it sits across from the largest angle, the 90° angle. If your calculation gives a hypotenuse shorter than one of the legs, you probably subtracted instead of added, or mixed up which side is which. Check that c is across from the right angle.
How did Einstein prove the Pythagorean theorem?
According to his own later recollection, Albert Einstein came up with a proof as a boy using similar triangles. He drew the height from the right angle, splitting the triangle into two smaller ones with the same shape as the original. Comparing their areas leads to a² + b² = c². His approach is closely related to the similar triangles proof explained in this guide.
Is the Pythagorean theorem used in trigonometry?
Yes. It is the source of the most important trig identity, sin²θ + cos²θ = 1. On a circle with radius 1, any point forms a right triangle with legs cos θ and sin θ and a hypotenuse of 1. Applying a² + b² = c² to that triangle gives the identity directly. Many other trig formulas build on it.
Try it with your own numbers
Use a free CalcSolver tool to check the examples in this guide.