Geometry

Pythagorean Theorem: Formula, Proof and Worked Examples

In a right triangle, the squares of the two legs add up to the square of the hypotenuse: a2+b2=c2a^2 + b^2 = c^2. Here cc is the side opposite the right angle, and it is always the longest side.

a2+b2=c2a^2 + b^2 = c^2

Try it with your numbers

Show every step

The solver above shows each step for any two sides you enter. The rest of this page explains why the formula is true, which traps cost the most points, and the shortcuts that make most problems quick.

What Does the Pythagorean Theorem Say?

The theorem is really a statement about area. Build a square on each side of a right triangle, and the area of the big square on the hypotenuse equals the two smaller squares added together. A square with side ss has area s2s^2 (see the area of a square), so the equation a2+b2=c2a^2 + b^2 = c^2 is just that area statement written with side lengths.

Only right triangles qualify, which is one specific entry among the types of triangles. The other two angles in a right triangle are acute and complementary, meaning they add to 90∘90^\circ. That fact is quietly responsible for the whole theorem, as the next section shows.

The letters are positions, not fixed names. The hypotenuse is whichever side faces the 90∘90^\circ angle, and the legs are the two sides that form it. You can call the legs aa and bb in either order, but cc must be the hypotenuse. If a diagram labels the hypotenuse xx, then x2x^2 stands alone on one side of the equation, and the two leg squares go on the other.

Quick check

Squares built on the two legs of a right triangle have areas 2020 and 2929. What is the side length of the square built on the hypotenuse?

Why Does the Pythagorean Theorem Work? One Clean Proof

Square of side 7 holding four 3-4-5 triangles and a tilted square of area 25
A 7 by 7 square equals the tilted 5 by 5 square plus four triangles of area 6, so 49 = 25 + 24.

Take four identical right triangles with legs aa and bb and hypotenuse cc. Arrange them inside a large square of side a+ba + b, each triangle pointing inward from a corner, so that a tilted square of side cc is left in the middle.

The 90° is doing the work

The tilted middle shape is a square only because the two acute angles of each triangle add to 90∘90^\circ. Change the angle and the proof stops working.

Now count the area of the big square two ways. From the outside it is (a+b)2(a+b)^2. From the inside it is the tilted square plus four triangles, each with area 12ab\tfrac{1}{2}ab:

(a+b)2=c2+4⋅12ab(a+b)^2 = c^2 + 4\cdot\tfrac{1}{2}ab

a2+2ab+b2=c2+2aba^2 + 2ab + b^2 = c^2 + 2ab

a2+b2=c2a^2 + b^2 = c^2

The 2ab2ab terms cancel, and the theorem is left standing. Nothing was assumed about the specific lengths, so it holds for every right triangle.

Hundreds of other proofs exist, and a collection of them lives on the page about the proofs of the Pythagorean theorem. One of the most elegant uses similar triangles: drop a line from the right angle straight to the hypotenuse, and it cuts the triangle into two smaller copies of the original. Matching their ratios gives the same equation with no pictures of squares at all.

How to Find the Hypotenuse With the Pythagorean Theorem

When both legs are known, the hypotenuse is the easy case. The process has four moves:

  1. Confirm there is a right angle and mark the side opposite it as cc.
  2. Square both legs and add them.
  3. Take the positive square root of the sum.
  4. Simplify the radical, then sanity-check the size.

Example 1. A right triangle has legs 66 and 1212. Find the hypotenuse.

c2=62+122=36+144=180c^2 = 6^2 + 12^2 = 36 + 144 = 180

c=180=36⋅5=65≈13.42c = \sqrt{180} = \sqrt{36 \cdot 5} = 6\sqrt{5} \approx 13.42

The sanity check is quick. The hypotenuse must beat the longer leg (1212) but stay below the sum of the legs (1818), a limit that comes from the triangle inequality theorem. Also, 132=16913^2 = 169 and 142=19614^2 = 196, so 180\sqrt{180} should land between 1313 and 1414, nearer to 1313. A result of 13.4213.42 passes both tests.

The costliest slip here is writing c=a+bc = a + b or c2=(a+b)2c^2 = (a+b)^2. Adding the legs first gives 1818 in this example, far too large. The squares are added, never the sides. Another common slip is stopping at c2=180c^2 = 180 and forgetting the final root.

How to Find a Missing Leg (and Skip the Subtraction)

When the hypotenuse is known, rearrange the equation to b2=c2−a2b^2 = c^2 - a^2. The sign flips because the hypotenuse is the biggest term, so it comes first and the known leg is subtracted. If you ever find yourself adding two numbers to get a leg, stop and recheck which side is cc.

Example 2. The hypotenuse is 1717 and one leg is 88. Find the other leg.

Rather than computing 172=28917^2 = 289 and subtracting 6464, factor the difference of squares:

b2=172−82=(17−8)(17+8)=9⋅25=225b^2 = 17^2 - 8^2 = (17 - 8)(17 + 8) = 9 \cdot 25 = 225

b=225=15b = \sqrt{225} = 15

Check by going forward: 82+152=64+225=289=1728^2 + 15^2 = 64 + 225 = 289 = 17^2. The factored form keeps the numbers small, which helps most when the hypotenuse is large. The result 8,15,178, 15, 17 is one of the whole-number Pythagorean triples.

Try this: Find the missing leg when the hypotenuse is 3737 and one leg is 1212, using (c−a)(c+a)(c-a)(c+a) without ever computing 37237^2. Then check by squaring all three sides.

A built-in alarm helps too. If the leg you are given is longer than the hypotenuse, or the number under the root comes out negative, the sides are mislabeled or the triangle cannot exist.

Is It a Right Triangle? The Converse, Acute and Obtuse Cases

Bar comparison showing 7 squared plus 8 squared equals 113, shorter than 11 squared equals 121
For sides 7, 8 and 11, the leg squares fall 8 short of 121, so the biggest angle is over 90°.

The theorem works backward as well. If three side lengths satisfy a2+b2=c2a^2 + b^2 = c^2, with cc the longest, the triangle must have a right angle. This is how carpenters and surveyors test a corner using only a tape measure.

The converse extends to a three-way test. Compare c2c^2 with a2+b2a^2 + b^2:

  • If a2+b2=c2a^2 + b^2 = c^2, the triangle is right.
  • If a2+b2>c2a^2 + b^2 > c^2, the triangle is acute (every angle under 90∘90^\circ).
  • If a2+b2<c2a^2 + b^2 < c^2, the triangle is obtuse (one angle over 90∘90^\circ).

Only the longest side needs testing. The angles of a triangle add to 180∘180^\circ (the triangle angle sum theorem), so at most one angle can reach 90∘90^\circ or more, and it always sits opposite the longest side.

Example 3. Classify a triangle with sides 77, 88 and 1111.

First confirm it exists: 7+8=15>117 + 8 = 15 > 11. Then compare:

72+82=49+64=113112=1217^2 + 8^2 = 49 + 64 = 113 \qquad 11^2 = 121

Since 113<121113 < 121, the longest side is longer than a right triangle would allow, so the opposite angle has been pushed past 90∘90^\circ. The triangle is obtuse. This works because the general law of cosines is c2=a2+b2−2abcos⁡Cc^2 = a^2 + b^2 - 2ab\cos C, and the −2abcos⁡C-2ab\cos C term turns positive when CC is obtuse.

Quick check

Is a triangle with sides 66, 77 and 99 acute, right or obtuse?

Pythagorean Theorem in Coordinates and 3D: Distance Formulas

The distance formula is the theorem in disguise. To find the distance between (x1,y1)(x_1, y_1) and (x2,y2)(x_2, y_2), treat the horizontal change and vertical change as the legs of a right triangle:

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

For (1,2)(1, 2) and (7,10)(7, 10), the legs are 66 and 88, so d=36+64=100=10d = \sqrt{36 + 64} = \sqrt{100} = 10. Squaring removes negative differences, so the order of the points never matters.

Circles are the theorem too

A point (x,y)(x, y) is on a circle with center (h,k)(h, k) and radius rr when its distance to the center is rr. That gives (x−h)2+(y−k)2=r2(x-h)^2 + (y-k)^2 = r^2.

That card is the whole idea behind the equation of a circle. The same thinking extends to three dimensions by applying the theorem twice. For a box with length ll, width ww and height hh, the floor diagonal is l2+w2\sqrt{l^2 + w^2}, and the space diagonal then forms a right triangle with the height:

d=l2+w2+h2d = \sqrt{l^2 + w^2 + h^2}

For a 3×4×123 \times 4 \times 12 box, the floor diagonal is 55, and d=25+144=13d = \sqrt{25 + 144} = 13. This tells you the longest rod that fits inside a shipping crate.

Pythagorean Triples and Special Triangles as Shortcuts

Spotting a familiar triple turns a calculation into recognition. Any multiple of a triple is also a triple, so 6,8,106, 8, 10 and 9,12,159, 12, 15 come from 3,4,53, 4, 5.

Primitive triple Check
3,4,53, 4, 5 9+16=259 + 16 = 25
5,12,135, 12, 13 25+144=16925 + 144 = 169
8,15,178, 15, 17 64+225=28964 + 225 = 289
7,24,257, 24, 25 49+576=62549 + 576 = 625
20,21,2920, 21, 29 400+441=841400 + 441 = 841

Two angle-based shapes also come up constantly. In a 45-45-90 triangle the legs are equal, so s2+s2=2s2s^2 + s^2 = 2s^2 and the hypotenuse

Quick check

A square has a diagonal of length 1212. What is its side length?

Practice problems

0 of 5 solved

  1. A right triangle has legs 99 and 1212. Find the hypotenuse.

  2. A right triangle has hypotenuse 2626 and one leg 1010. Find the other leg.

  3. A right triangle has legs 44 and 77. Find the hypotenuse to two decimal places.

  4. A triangle has sides 99, 1212 and 1616. Is it acute, right or obtuse?

  5. The legs of a right triangle are xx and x+7x + 7, and the hypotenuse is 1313. Find xx.

Common questions

What is the Pythagorean theorem in simple terms?

In any right triangle, if you square the two shorter sides (the legs) and add the results, you get the square of the longest side (the hypotenuse). In symbols, a2+b2=c2a^2 + b^2 = c^2. It lets you find a missing side whenever the other two are known.

Can the Pythagorean theorem be used on any triangle?

No. The equation a2+b2=c2a^2 + b^2 = c^2 holds only when one angle is exactly 90∘90^\circ. For other triangles, the law of cosines gives c2=a2+b2−2abcos⁡Cc^2 = a^2 + b^2 - 2ab\cos C, which reduces to the Pythagorean theorem when C=90∘C = 90^\circ.

How do you know which side is the hypotenuse?

The hypotenuse is the side directly opposite the right angle, and it is always the longest side. It is the only side that never touches... no: it is the one side that does not form the right angle. Label it cc and the equation sorts itself out.

What is the converse of the Pythagorean theorem?

If the three sides of a triangle satisfy a2+b2=c2a^2 + b^2 = c^2, with cc the longest side, then the triangle has a right angle. If a2+b2>c2a^2 + b^2 > c^2 the triangle is acute, and if $a^2 + b^2 < c^2$ it is obtuse.

Who discovered the Pythagorean theorem?

Greek tradition credits Pythagoras (around 500 BCE), but Babylonian clay tablets from roughly 1800 BCE already list whole-number triples that fit the rule. Ancient Chinese and Indian texts also describe it, so the name reflects who proved it in Greek mathematics, not who first noticed it.

Does the Pythagorean theorem work with decimals and fractions?

Yes. Side lengths can be any positive real numbers, so decimals, fractions and radicals all work. Only the final square root needs care: take the positive root, because a length cannot be negative.

Up next