CCalclabhub

Geometry

How To Use The Pythagorean Theorem

For right triangles, the squares of the two shorter sides add exactly to the square of the longest. That single relation turns any two known sides into the third.

Quick Answer

c^2 = a^2 + b^2, so c = sqrt(a^2 + b^2)

a, b
The two legs meeting at the right angle
c
Hypotenuse — the side opposite the right angle, and always the longest
a^2 + b^2
Squared lengths whose sum equals the squared hypotenuse

Square both known legs, add them, then take the square root. Legs of 3 and 4 give 9 + 16 = 25 and a hypotenuse of 5. For a missing leg instead, rearrange to a = sqrt(c^2 - b^2), which subtracts rather than adds — a hypotenuse of 13 with one leg of 5 leaves sqrt(169 - 25) = 12. The method works only when there is a right angle between the two known sides; otherwise you need the more general law of cosines.

What Is How To Use The Pythagorean Theorem?

The theorem states a relationship about areas as much as about lengths. Squares drawn on the two shorter faces of a right triangle have a combined area exactly equal to the square on the long face. Reading it that way explains why the power is two and no other number would do: areas scale with the square of side length, so this is a statement about area being preserved under rearrangement.

The right angle is the whole precondition, and it is worth being explicit because it is the most common misuse. If the two known sides do not meet at ninety degrees, the formula gives a wrong answer rather than a slightly approximate one. In that situation the correct generalisation is the law of cosines, which reduces to Pythagoras when the included angle is exactly ninety degrees and the cosine term vanishes.

Identifying which side is the hypotenuse is the first practical step, and it never requires a diagram if you remember one thing: the hypotenuse is opposite the right angle and is necessarily the longest side. That gives a free error check. If your computed c comes out shorter than one of the inputs, you subtracted instead of added, and no amount of rechecking the arithmetic will fix it because the setup is wrong.

Rearranging for a missing leg is where most arithmetic slips happen, because the operation flips from addition to subtraction. Solving for a leg means a = sqrt(c^2 - b^2), and the most common error is adding anyway, which produces a side longer than the hypotenuse — physically impossible and therefore detectable. Always compare your result against the known longest side before writing it down.

Integer triples have been catalogued since Babylonian times and remain genuinely useful. The familiar ones — 3, 4, 5; 5, 12, 13; 8, 15, 17; 7, 24, 25 — satisfy the relation exactly with no rounding, which makes them ideal for checking a calculation and for laying out right angles physically. Multiplying a triple by any constant produces another triple, so 6, 8, 10 works identically.

The converse is equally true and arguably more useful in measurement: if a^2 + b^2 = c^2 holds for a triangle's three sides, then the angle between a and b is a right angle. Builders use this to square corners with tape measures, and it is why a 3-4-5 layout guarantees ninety degrees without any protractor. When measurements disagree slightly, the mismatch quantifies how far out of square the corner actually is.

Diagonals are the most frequent everyday application. The diagonal of a rectangle is the hypotenuse of the triangle formed by its two sides, so a 1920 by 1080 screen has a diagonal of sqrt(1920^2 + 1080^2) = 2202.9072 pixels. The same reasoning gives distances across fields, the size of television screens quoted diagonally, and the length of a cable routed corner to corner rather than around the edges.

The idea extends naturally into three dimensions with almost no extra machinery. The space diagonal of a rectangular box with sides p, q and r has length sqrt(p^2 + q^2 + r^2), obtained by applying the theorem twice. This result is what makes it possible to quote a single diagonal measurement for a room or a shipping container, and it generalises further to any number of dimensions where it becomes the Euclidean distance formula.

Finally, units need care even though the arithmetic is trivial. Both known lengths must be in the same unit before squaring, or the sum of squares is meaningless. The result is always in that same unit, never squared, because the final square root undoes the squaring. Mixing centimetres with inches and then reporting square units is a mistake that survives casual review surprisingly often.

Formula

c = sqrt(a^2 + b^2)

Square each leg, add, then take the square root. The result must exceed both inputs.

SymbolMeaning
aOne leg adjacent to the right angle
bThe other leg adjacent to the right angle
cHypotenuse

a = sqrt(c^2 - b^2)

Rearranged from the same relation, so it subtracts. The result must be shorter than the hypotenuse.

SymbolMeaning
cKnown hypotenuse

Right angle if and only if a^2 + b^2 = c^2

The converse. If measured sides satisfy the relation, the included angle is ninety degrees — the basis of squaring corners.

SymbolMeaning
a^2 + b^2 - c^2Residual

How To Calculate How To Use The Pythagorean Theorem

  1. 1

    Confirm there is a right angle

    The theorem applies only to right triangles. If the known sides do not meet at ninety degrees, stop and use the law of cosines instead.

  2. 2

    Put both known lengths in the same unit

    Convert before squaring. Summing squares of measurements in different units produces a number with no physical meaning.

  3. 3

    Identify whether you are missing the hypotenuse or a leg

    Missing the longest side means add the squares; missing a shorter side means subtract. Getting this backwards is the single most frequent error.

  4. 4

    Compute and take the square root

    Here 3^2 + 4^2 = 9 + 16 = 25, so the hypotenuse is 5. The square root returns you to the original unit rather than squared units.

  5. 5

    Sanity-check against the longest known side

    A computed hypotenuse must exceed both legs; a computed leg must be shorter than the hypotenuse. If not, you added where you should have subtracted.

Examples

Example 1: The 3-4-5 triangle and its area

Leg a
3
Leg b
4
StepCalculationResult
Squares of the legs3^2 and 4^29 and 16
Sum of those squares9 + 1625
Hypotenusesqrt(25)5
Area from the two legs3 x 4 / 26

Result: A hypotenuse of 5 and an area of 6 — the smallest integer triple, and the easiest one to verify by hand.

Example 2: A missing leg rather than the hypotenuse

Hypotenuse
13
Known leg
5
StepCalculationResult
Squares of the hypotenuse and known leg13^2 and 5^2169 and 25
Difference, because a leg is missing169 - 25144
Missing legsqrt(144)12

Result: 12 — the triple 5, 12, 13, shorter than the hypotenuse exactly as it must be.

Example 3: A ladder against a wall

Ladder length (hypotenuse)
10 ft
Distance of the base from the wall
6 ft
StepCalculationResult
Squares involved10^2 - 6^2100 - 36 = 64
Height reached up the wallsqrt(64)8

Result: 8 feet up the wall — and moving the base closer raises that height, while pulling it out lowers it, which is why leaning angle matters.

Calculator

Hypotenuse from legs a and b

5

Missing leg from leg a and the hypotenuse
4
Area of the triangle
6
Perimeter of the triangle
12

Values update as you type. This calculator covers the single scenario its formula assumes — see Common Mistakes for what it leaves out.

Prefer a full-width tool? Open the How To Use The Pythagorean Theorem calculator page.

Common Mistakes

  • Adding when looking for a leg

    Finding a shorter side requires subtraction: a = sqrt(c^2 - b^2). Adding produces a value longer than the hypotenuse, which is immediately impossible.

  • Applying it to triangles without a right angle

    The relation is a property of right triangles specifically. On any other triangle the law of cosines is required, and Pythagoras will give a plausible but wrong number.

  • Taking the square root of only one term

    sqrt(a^2 + b^2) is not a + b. The square root applies to the sum, and skipping that fact inflates the answer badly — sqrt(9 + 16) is 5, not 7.

  • Mixing units before squaring

    Centimetres and inches cannot be combined in the same sum of squares. Convert first, and remember the final root returns the original unit rather than a squared one.

  • Assuming any three sides form a right triangle

    Test them rather than assuming. A triangle with sides 4, 5 and 6 fails the relation: 16 + 25 is 41, not 36, so no right angle is present.

FAQ

How can I tell which side is the hypotenuse?

It is opposite the right angle and always the longest of the three. If your computed value is shorter than an input, you have made an error.

Does it work in three dimensions?

Yes, by applying it twice. The space diagonal of a box with sides p, q and r is sqrt(p^2 + q^2 + r^2), which is how diagonal measures of rooms and containers are derived.

What are Pythagorean triples used for?

They give exact right angles from whole-number measurements, which is useful in construction and surveying, and they provide instant verification that a calculation was set up correctly.

Can the result be irrational?

Often. Two legs of 1 and 1 give a hypotenuse of sqrt(2), which cannot be written exactly as a fraction. Rounding at the end rather than mid-calculation keeps the answer accurate.

What if my measured sides almost satisfy the relation?

Then the angle is close to ninety degrees but not exactly. The size of the residual tells you how far out of square the corner is, which is often more useful than a pass or fail answer.

References

  1. [1]Wolfram MathWorld, Pythagorean theorem — https://mathworld.wolfram.com/PythagoreanTheorem.html
  2. [2]Khan Academy, Pythagorean theorem applications — https://www.khanacademy.org/math/geometry/hs-geo-trig/hs-geo-pythagorean-theorems
  3. [3]MacTutor History of Mathematics Archive, University of St Andrews, Pythagorean theorem, history and proofs — https://mathshistory.st-andrews.ac.uk/HistTopics/Pythagoras/