Calculator of Alexandria

Pythagorean theorem calculator

Find the missing side of a right triangle with a² + b² = c², plus a proof of why the theorem works.

Solve for

The longest side, opposite the right angle.

Formula

a2+b2=c2a^2 + b^2 = c^2
How it's derived

The formula

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

aa and bb are the two shorter sides (the legs) of a right triangle, and cc is the hypotenuse, the side opposite the right angle.

Where it comes from

There are hundreds of proofs. One of the clearest is a rearrangement. Take four copies of the triangle and place them inside a square with sides a+ba + b, so that their hypotenuses form a tilted square in the middle with side cc.

The big square’s area can be counted two ways. As one square, it’s (a+b)2(a+b)^2. As pieces, it’s 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

Expanding the left side gives a2+2ab+b2=c2+2aba^2 + 2ab + b^2 = c^2 + 2ab. Subtract 2ab2ab from both sides and the theorem is left.

To find a leg instead, rearrange: a=c2−b2a = \sqrt{c^2 - b^2}.

Worked example

A ladder’s base is 3 m from a wall and it reaches 4 m up. How long is the ladder?

c=32+42=25=5 mc = \sqrt{3^2 + 4^2} = \sqrt{25} = 5\ \text{m}

Watch out for

  • Right triangles only. For other triangles, use the law of cosines, c2=a2+b2−2abcos⁡Cc^2 = a^2 + b^2 - 2ab\cos C. When C=90°C = 90°, cos⁡C=0\cos C = 0 and it reduces to Pythagoras.
  • The hypotenuse is the longest side. If you’re solving for a leg and get no answer, the “hypotenuse” you entered is shorter than the other leg.
  • Builders’ 3-4-5. Measuring 3, 4 and 5 units is a quick way to check a corner is square.

Sources

Last checked