Pythagorean theorem tutorial
The Pythagorean theorem describes a fixed relationship between the three sides of any right triangle. Knowing it lets you find any missing side length — a skill that comes up in geometry coursework, construction, coordinate math, and programming.
Core formula
For every right triangle: $a^2 + b^2 = c^2$, where $c$ is the hypotenuse (the longest side, opposite the right angle) and $a$ and $b$ are the two shorter legs.
Anatomy of a right triangle
A right triangle has exactly one right angle — an angle of exactly 90°. The side directly across from the right angle is the hypotenuse. It is always the longest side. The other two sides are the legs, labelled $a$ and $b$ in the formula.
It does not matter which leg you call $a$ and which you call $b$ — the theorem is symmetric. What matters is that $c$ always represents the hypotenuse.
Three forms of the formula
Rearrange $a^2 + b^2 = c^2$ to isolate whichever side is unknown. Choose the form that matches what the problem gives you.
Find the hypotenuse (know both legs)
$c = \sqrt{a^2 + b^2}$
Find leg a (know c and b)
$a = \sqrt{c^2 - b^2}$
Find leg b (know c and a)
$b = \sqrt{c^2 - a^2}$
When the theorem applies
The Pythagorean theorem works only for right triangles. Before calculating, confirm that the problem involves a right angle. Common signals include:
- A small square drawn in a corner of the triangle diagram.
- The words "perpendicular," "vertical," or "horizontal" in the problem.
- Real-world setups: a ladder against a wall, a ramp from ground to a doorstep, the diagonal of a rectangle.
For non-right triangles you would need the Law of Cosines instead. The Pythagorean theorem is a special case of that law when the angle between the two legs is exactly 90°.
Worked examples
Example 1: find the hypotenuse
A right triangle has legs $a = 6$ and $b = 8$. Find the hypotenuse $c$.
$c^2 = a^2 + b^2 = 6^2 + 8^2 = 36 + 64 = 100$
$c = \sqrt{100} = \mathbf{10}$
This is the 3-4-5 triple scaled by 2. The integers work out perfectly because 6, 8, and 10 form a Pythagorean triple.
Example 2: find a missing leg
A right triangle has hypotenuse $c = 13$ and one leg $a = 5$. Find leg $b$.
$b^2 = c^2 - a^2 = 13^2 - 5^2 = 169 - 25 = 144$
$b = \sqrt{144} = \mathbf{12}$
The 5-12-13 triple is one of the most common Pythagorean triples after 3-4-5. Recognizing it by sight saves time on exams.
Example 3: real-world word problem
A ladder leans against a vertical wall. The base of the ladder is 9 feet from the wall and the ladder reaches 12 feet up the wall. How long is the ladder?
The wall and the ground form a right angle. The distance up the wall and the distance along the ground are the two legs. The ladder itself is the hypotenuse.
$c^2 = 9^2 + 12^2 = 81 + 144 = 225$
$c = \sqrt{225} = \mathbf{15}$ feet
Common Pythagorean triples
A Pythagorean triple is a set of three positive integers $(a,\, b,\, c)$ that exactly satisfy $a^2 + b^2 = c^2$. When you recognise one, you can skip the square root calculation entirely. Every multiple of a triple is also a triple — the 6-8-10 triangle is just 3-4-5 scaled by 2.
| a | b | c | Common scaled versions |
|---|---|---|---|
| 3 | 4 | 5 | 6-8-10, 9-12-15, 12-16-20 |
| 5 | 12 | 13 | 10-24-26 |
| 8 | 15 | 17 | 16-30-34 |
| 7 | 24 | 25 | 14-48-50 |
| 20 | 21 | 29 | — |
| 9 | 40 | 41 | — |
The converse: checking whether a triangle is a right triangle
The converse says: if $a^2 + b^2 = c^2$, then the angle between $a$ and $b$ must be exactly 90°. You can test any three side lengths to see whether they form a right triangle.
Do sides 9, 40, and 41 form a right triangle?
Square all three: $9^2 = 81$, $40^2 = 1600$, $41^2 = 1681$
Check: $81 + 1600 = 1681$ ✓ Yes — this is a right triangle.
Do sides 5, 7, and 9 form a right triangle?
$5^2 + 7^2 = 25 + 49 = 74$, but $9^2 = 81$. Since $74 \neq 81$, no — this is not a right triangle.
Always assign the largest value to $c$ before testing. Squaring a smaller value as $c$ will give a false negative.
Refreshable sample
Try one Pythagorean theorem question
Work through the problem before checking. The practice page generates different values each time, so you can keep drilling until the method feels automatic.
Common mistakes to avoid
- Labelling the hypotenuse incorrectly. $c$ must be the longest side and must sit opposite the right angle. Swapping it with a leg makes the equation wrong even if every arithmetic step is correct.
- Adding when you should subtract. When you are solving for a leg, the formula is $a^2 = c^2 - b^2$, not $c^2 + b^2$. A shorter side can never be found by adding the squares.
- Stopping at $c^2$ instead of $c$. $c^2 = 100$ means $c = 10$. Always take the final square root.
- Applying the theorem to non-right triangles. A triangle with angles 60-60-60 or 30-60-90 requires different tools. Confirm the right angle before you start.
- Rounding too early. If a problem asks for an exact answer, leave the result as $\sqrt{n}$ unless $n$ is a perfect square.