Search

Search papers and lessons

Pythagorean Theorem

Level 1 · 11 min read

In a right triangle the square of the longest side equals the sum of the squares of the other two, which lets you find a missing length from the other two.

On this page

TL;DR

A right triangle has one corner that is exactly 90 degrees. The two sides that meet at that corner are the legs, and the side opposite it is the hypotenuse, the longest side. The Pythagorean theorem says that if the legs have lengths aa and bb and the hypotenuse has length cc, then a2+b2=c2a^2 + b^2 = c^2. This lets you find any one side when you know the other two, and it gives the straight-line distance between two points on a grid.

Builds on: nothing beyond school arithmetic · Leads to: trigonometry, vector lengths, and the distance formula used throughout geometry and data science

Where it's used

Building and carpentry. A carpenter checks that a rectangular frame is square by measuring the two diagonals. If the frame is a right-angled rectangle with sides 3 feet and 4 feet, the diagonal must be 5 feet. A diagonal that is off by a few millimetres shows the corner is not a right angle. The same test is used when laying out the foundation of a house.

Navigation and maps. On a square grid of city streets, you can walk along the streets, but a crow flying straight can cross the block. If you go 3 km east and 4 km north, the straight-line distance from the start is 5 km. Map and GPS software compute these straight-line distances all the time, as a step toward finding the nearest hospital or station.

Computer graphics. A game engine decides whether an object is close enough to a camera or to another object by computing a distance. For two points on a screen, the distance is the square root of the sum of the squared horizontal and vertical differences, which is the theorem applied to a right triangle with those differences as legs.

Ladders and roofs. A builder who leans a 5-metre ladder against a wall with its foot 3 metres from the wall needs to know how high it reaches. The wall, the ground and the ladder form a right triangle, so the theorem gives the answer directly. We work this out in the worked examples below.

How it works

Take a well-known right triangle. Its legs are 3 and 4, and we want the hypotenuse.

  1. Draw the triangle. Put one leg of length 3 along the ground and the other leg of length 4 straight up from its end, so the corner between them is a right angle. The slanted side joining the two ends is the hypotenuse. Check: the two legs meet at 90 degrees, and the hypotenuse is opposite that corner.
  2. Square each leg. The leg of length 3 gives 3×3=93 \times 3 = 9. The leg of length 4 gives 4×4=164 \times 4 = 16. Check: 9 and 16 are the areas of the two squares built on the legs.
  3. Add the two squares. 9+16=259 + 16 = 25. The theorem says this sum equals the square built on the hypotenuse. Check: 9 + 16 = 25.
  4. Take the square root. The hypotenuse cc satisfies c2=25c^2 = 25. The positive number whose square is 25 is 5, so c=5c = 5. Check: 5 times 5 is 25.

The plot shows the same idea as a function of xx, when one leg is fixed at 3 and the other leg grows. The hypotenuse is 9+x2\sqrt{9 + x^2}, and it is always longer than either leg. At x=4x = 4 it is exactly 5.

012345602468length of the second leg xlength
  • hypotenuse with legs 3 and x
  • the other leg x
With one leg fixed at 3, the hypotenuse is always longer than the other leg. At x = 4 it is 5.

The math

Definition

Definition: Pythagorean theorem

In a right triangle with legs of lengths aa and bb and hypotenuse of length cc,

a2+b2=c2.a^2 + b^2 = c^2.

The converse also holds: if three positive numbers satisfy a2+b2=c2a^2 + b^2 = c^2, a triangle with those sides exists and has a right angle opposite side cc.

Step 1 in symbols: the legs

In the walkthrough, a=3a = 3 and b=4b = 4. Each leg is squared: a2=9a^2 = 9 and b2=16b^2 = 16. Squaring a length gives the area of a square built on that side.

Step 2 in symbols: the sum

The theorem adds the two areas:

a2+b2=9+16=25.a^2 + b^2 = 9 + 16 = 25.

Step 3 in symbols: the hypotenuse

The unknown cc satisfies c2=25c^2 = 25. Since a length is positive, c=25=5c = \sqrt{25} = 5.

Step 4 in symbols: a missing leg

The theorem can be rearranged to find a leg when the hypotenuse and the other leg are known:

a=c2−b2.a = \sqrt{c^2 - b^2}.

This is the form used in the ladder example. Subtracting the squares is the only change from the first form.

Step 5 in symbols: distance between two points

Put two points (x1,y1)(x_1, y_1) and (x2,y2)(x_2, y_2) on a grid. The horizontal difference is Δx=x2−x1\Delta x = x_2 - x_1, and the vertical difference is Δy=y2−y1\Delta y = y_2 - y_1. These are the legs of a right triangle whose hypotenuse joins the points, so

d=(x2−x1)2+(y2−y1)2.d = \sqrt{(x_2 - x_1)^2 + (y_2 - y_1)^2}.

The same pattern extends to three dimensions, where the differences in each coordinate are squared and added.

Worked examples

Example
1. The 3, 4, 5 triangle

Take a right triangle with legs a=6a = 6 and b=8b = 8. Find the hypotenuse cc.

  1. Square the first leg: 62=366^2 = 36.
  2. Square the second leg: 82=648^2 = 64.
  3. Add the squares: 36+64=10036 + 64 = 100.
  4. The hypotenuse satisfies c2=100c^2 = 100, so c=10c = 10.
  5. Check: 102=10010^2 = 100, which matches step 3.
  6. Interpretation: 6,8,106, 8, 10 is the 3, 4, 5 triangle doubled. Every side is multiplied by the same factor, and the right angle is unchanged.
Example
2. A ladder against a wall

A ladder is 5 metres long and its foot is 3 metres from the base of a wall. How high up the wall does it reach?

  1. The wall, the ground and the ladder form a right triangle. The ladder is the hypotenuse, c=5c = 5. The distance from the wall is one leg, b=3b = 3. The height on the wall, aa, is the other leg.
  2. Use the rearranged form: a=c2−b2a = \sqrt{c^2 - b^2}.
  3. Square the hypotenuse: 52=255^2 = 25.
  4. Square the known leg: 32=93^2 = 9.
  5. Subtract: 25−9=1625 - 9 = 16.
  6. Take the square root: a=16=4a = \sqrt{16} = 4.
  7. The ladder reaches 4 metres up the wall.
  8. Check: 32+42=9+16=25=523^2 + 4^2 = 9 + 16 = 25 = 5^2, so the numbers fit the theorem.
  9. Interpretation: a ladder of length 5 placed 3 metres out reaches 4 metres high. A longer ladder at the same spot would reach higher.
Example
3. The straight-line distance on a map

Two points on a map have grid coordinates P=(2,1)P = (2, 1) and Q=(8,9)Q = (8, 9), in kilometres. How far apart are they in a straight line?

  1. Find the horizontal difference: 8−2=68 - 2 = 6.
  2. Find the vertical difference: 9−1=89 - 1 = 8.
  3. Square the horizontal difference: 62=366^2 = 36.
  4. Square the vertical difference: 82=648^2 = 64.
  5. Add the squares: 36+64=10036 + 64 = 100.
  6. Take the square root: 100=10\sqrt{100} = 10.
  7. The straight-line distance is 10 km.
  8. Check: 66, 88 and 1010 is the 3, 4, 5 triangle doubled, as in example 1.
  9. Interpretation: the distance formula is the theorem applied to the differences between two points, so a map program can compute it for any pair of points.

Try it: a 10-metre ladder has its foot 6 metres from a wall. How high up the wall does it reach? Answer: a=102−62=100−36=64=8a = \sqrt{10^2 - 6^2} = \sqrt{100 - 36} = \sqrt{64} = 8 metres.

Common mistakes and tradeoffs

Mistake 1: "The theorem works for any triangle." It is tempting to think that a2+b2=c2a^2 + b^2 = c^2 holds for every triangle with sides aa, bb, cc. In fact it holds only when the angle opposite cc is exactly 90 degrees. For other triangles the sum of the squares of two sides differs from the square of the third, and the difference depends on the angle. The converse, stated in the Definition, is what lets you test whether a triangle is right.

Mistake 2: "cc is always one of the legs or the hypotenuse, whichever is written last." It is tempting to assign cc to the last side in a list. In fact cc must be the side opposite the right angle, and it is always the longest side. If you put a leg in the place of cc, the subtraction c2−b2c^2 - b^2 can come out negative, which signals the mistake, because no real length satisfies it.

Mistake 3: "(a+b)2=a2+b2(a + b)^2 = a^2 + b^2." It is tempting to square the legs and then add them in a single step, or to expand the sum of the lengths. In fact (a+b)2=a2+2ab+b2(a + b)^2 = a^2 + 2ab + b^2, which contains an extra term. The theorem uses the squares of the sides, not the square of their sum.

When to use it. Use the theorem when you have a right angle, or can confirm one, and you need a length you cannot measure directly. It is exact, so it is preferred to estimating from a drawing.

When not to use it. If the triangle is not right-angled, the theorem does not apply. Then use the law of cosines, which contains the Pythagorean theorem as the special case where the angle is 90 degrees.

Alternatives. For a right angle known by its angle, sine and cosine give the same side lengths from the angle and one side. For a Vector, the length is the Euclidean norm, which is the theorem written with a sum over all the coordinates. That sum is the dot product of the vector with itself.

History

Clay tablets from Babylon, such as the one known as Plimpton 322, list sets of whole numbers that fit the relation, and they date from about 1800 BCE, long before Pythagoras. Ancient Indian and Chinese texts also record the relation, and the Chinese text Zhoubi Suanjing is one source of such results. The Greek mathematician Euclid gave a formal proof in Book I of his Elements, around 300 BCE, as Proposition 47. The name "Pythagorean theorem" follows the tradition that Pythagoras or his school was the first to prove it, although the evidence for that tradition is weak. The theorem became standard in school geometry, and its distance form now underlies coordinate geometry and much of computing.

Recap

  • In a right triangle, a2+b2=c2a^2 + b^2 = c^2, where cc is the hypotenuse, opposite the right angle.
  • The theorem finds a missing side when the other two are known, and it can be rearranged to a=c2−b2a = \sqrt{c^2 - b^2}.
  • The distance between two points on a grid is the theorem applied to their differences, d=(x2−x1)2+(y2−y1)2d = \sqrt{(x_2 - x_1)^2 + (y_2 - y_1)^2}.
  • The converse lets you test whether a triangle is right.
  • Next, read trigonometry to find angles and sides together, and vector norms to see the theorem in any number of dimensions.

Check yourself

QuestionIn a right triangle the legs are 9 and 12. What is the hypotenuse?Show answer

Square the legs: 92=819^2 = 81 and 122=14412^2 = 144. Add them: 81+144=22581 + 144 = 225. The hypotenuse is 225=15\sqrt{225} = 15.

QuestionA right triangle has hypotenuse 13 and one leg 5. What is the other leg?Show answer

Use a=c2−b2a = \sqrt{c^2 - b^2} with c=13c = 13 and b=5b = 5. Then 132−52=169−25=14413^2 - 5^2 = 169 - 25 = 144, and 144=12\sqrt{144} = 12. The other leg is 12.

QuestionWhy can a triangle with sides 4, 5 and 6 not be the right-angled triangle with hypotenuse 6?Show answer

If it were right-angled with hypotenuse 6, the theorem would need 42+52=624^2 + 5^2 = 6^2. But 16+25=4116 + 25 = 41 and 62=366^2 = 36, and 41≠3641 \ne 36. The converse of the theorem then says the angle opposite 6 is not 90 degrees, so the triangle is not right-angled.

QuestionA rectangular door is 2 metres tall and 0.8 metres wide. A straight rod is carried diagonally through it. Explain why the rod's length is the hypotenuse of a right triangle, and find its length.Show answer

The door's height and width meet at a right angle at the corner, so the diagonal across the door is the hypotenuse. Its length is 22+0.82=4+0.64=4.64≈2.15\sqrt{2^2 + 0.8^2} = \sqrt{4 + 0.64} = \sqrt{4.64} \approx 2.15 metres. A rod longer than this cannot pass diagonally through the door.

Sources