Skip to content

How the Pythagorean Theorem Works (With Real Examples)

CalculatorGlobe Team February 23, 2026 12 min read Math

The Pythagorean theorem is one of the most fundamental relationships in all of mathematics. It connects the three sides of a right triangle through a simple equation that has been known for over 4,000 years. From checking whether a wall is square to calculating distances on a map, this single formula solves an extraordinary range of practical problems.

This guide explains the theorem from the ground up, demonstrates multiple proofs, walks through real-world applications, and provides step-by-step examples you can follow with any right triangle.

What Is the Pythagorean Theorem?

The Pythagorean theorem states that in any right triangle, the square of the length of the hypotenuse (the side opposite the right angle) equals the sum of the squares of the lengths of the other two sides (called legs). In its most recognizable form:

a^2 + b^2 = c^2

a = one leg, b = other leg, c = hypotenuse (longest side, opposite the right angle)

The theorem works in both directions. If three sides of a triangle satisfy a^2 + b^2 = c^2, the triangle is guaranteed to be a right triangle. This bidirectional property makes it equally useful for calculating unknown side lengths and verifying right angles.

While named after the Greek mathematician Pythagoras (circa 570-495 BCE), the relationship was known to Babylonian mathematicians as early as 1800 BCE, as evidenced by the Plimpton 322 clay tablet, and independently to mathematicians in ancient India and China.

The Formula Explained

The formula a^2 + b^2 = c^2 has three distinct uses depending on which side you need to find:

Finding the hypotenuse: c = sqrt(a^2 + b^2)

If legs are 6 and 8: c = sqrt(36 + 64) = sqrt(100) = 10

Finding a leg (given the other leg and hypotenuse): a = sqrt(c^2 - b^2)

If hypotenuse is 13 and one leg is 5: a = sqrt(169 - 25) = sqrt(144) = 12

Verifying a right angle: Check if a^2 + b^2 equals c^2

Sides 7, 24, 25: 49 + 576 = 625, and 25^2 = 625. Confirmed right triangle.

When solving for a leg, always subtract the smaller square from the larger square. The expression under the square root must be positive, which is guaranteed because the hypotenuse is always the longest side of a right triangle.

Try Our Pythagorean Theorem Calculator

Enter any two sides of a right triangle and instantly calculate the third side with step-by-step solution.

Use Calculator

Geometric Proofs

The Pythagorean theorem has been proven in more than 370 distinct ways, making it one of the most proven results in mathematics. Two classic proofs illustrate the core idea.

Proof by rearrangement: Start with a large square with side length (a + b). Inside this square, arrange four identical right triangles with legs a and b. The triangles can be positioned in two different ways. In the first arrangement, the uncovered area in the center forms a single square with side length c, so the uncovered area equals c^2. In the second arrangement, the uncovered area forms two separate squares: one with side a (area a^2) and one with side b (area b^2). Since the total square area is the same and the four triangles are identical in both arrangements, the uncovered areas must be equal: a^2 + b^2 = c^2.

Proof by similar triangles: Draw the altitude from the right angle to the hypotenuse, dividing the original triangle into two smaller triangles. All three triangles (the original and the two smaller ones) are similar, meaning they have the same angles and proportional sides. Setting up the proportions between corresponding sides and simplifying algebraically yields a^2 + b^2 = c^2. This proof, essentially Euclid's approach from his Elements (Book I, Proposition 47), uses only basic geometry.

In 1876, James A. Garfield, who later became the 20th President of the United States, published a proof using a trapezoid constructed from two copies of a right triangle and a third isosceles right triangle. This creative approach demonstrates that new proofs continue to be discovered.

Pythagorean Triples

A Pythagorean triple is a set of three positive integers (a, b, c) that satisfy a^2 + b^2 = c^2. These integer solutions create right triangles with clean, whole-number side lengths.

a b c Verification Primitive?
3459 + 16 = 25Yes
5121325 + 144 = 169Yes
8151764 + 225 = 289Yes
7242549 + 576 = 625Yes
681036 + 64 = 100No (2 x 3,4,5)
9404181 + 1600 = 1681Yes
202129400 + 441 = 841Yes

A Pythagorean triple is primitive if the three numbers share no common factor other than 1. Every primitive triple can be generated using the formula a = m^2 - n^2, b = 2mn, c = m^2 + n^2, where m and n are positive integers with m greater than n, m and n are not both odd, and they share no common factor. Any multiple of a Pythagorean triple is also a Pythagorean triple.

Step-by-Step Calculation Examples

Example 1: Liam Measures a TV Screen Diagonal

Liam is shopping for a TV and wants to verify the listed screen size. The TV has a width of 43.6 inches and a height of 24.5 inches. TV sizes are measured by the diagonal.

Step 1: Identify the known values. Width (a) = 43.6 inches. Height (b) = 24.5 inches.

Step 2: Apply the theorem. c = sqrt(a^2 + b^2) = sqrt(43.6^2 + 24.5^2)

Step 3: Calculate the squares. 43.6^2 = 1,900.96. 24.5^2 = 600.25.

Step 4: Sum and take the square root. c = sqrt(1,900.96 + 600.25) = sqrt(2,501.21) = 50.01 inches.

Result: The diagonal is approximately 50 inches, confirming it is a 50-inch TV as advertised.

Example 2: Aisha Plans a Wheelchair Ramp

Aisha needs to build a wheelchair ramp to a doorstep that is 2 feet above ground level. Building codes require a maximum slope of 1:12 (1 foot of rise for every 12 feet of horizontal run). She needs to know the length of the ramp surface.

Step 1: Determine the horizontal run. Rise = 2 feet. At 1:12 ratio, run = 2 x 12 = 24 feet.

Step 2: The ramp surface is the hypotenuse. c = sqrt(a^2 + b^2) = sqrt(2^2 + 24^2)

Step 3: Calculate. c = sqrt(4 + 576) = sqrt(580) = 24.08 feet.

Result: Aisha needs a ramp surface 24.08 feet long. She orders lumber for a 24.5-foot ramp to account for cutting waste.

Example 3: Carlos Checks a Foundation Corner

Carlos is building a deck and needs to verify that the corner framing is exactly 90 degrees. He uses the 3-4-5 method scaled up by a factor of 3 for better accuracy.

Step 1: Scale the 3-4-5 triple by 3: legs = 9 feet and 12 feet, expected diagonal = 15 feet.

Step 2: From the corner, measure 9 feet along one board and mark. Measure 12 feet along the other board and mark.

Step 3: Measure the diagonal between the two marks. Carlos gets 15 feet and 1/4 inch.

Step 4: The expected diagonal is exactly 15 feet. The 1/4-inch discrepancy over 15 feet is minimal and within construction tolerances. The corner is acceptably square.

Try Our Right Triangle Calculator

Calculate all sides, angles, and area of any right triangle from just two known measurements.

Use Calculator

Real-World Applications

The Pythagorean theorem appears in a wide range of practical fields:

  • Construction and carpentry: Verifying square corners, calculating roof rafter lengths, determining staircase dimensions, and laying out building foundations all rely on the theorem. The 3-4-5 check is an everyday tool on construction sites worldwide.
  • Navigation and mapping: Calculating the straight-line distance between two points on a grid uses the theorem directly. GPS systems use three-dimensional extensions of the same principle when computing distances between coordinates.
  • Computer graphics: Distance calculations between pixels, collision detection in video games, and rendering three-dimensional scenes all apply the Pythagorean theorem thousands of times per second.
  • Surveying: Land surveyors use the theorem to calculate distances across obstacles like rivers or ravines by setting up right triangles with measurable legs and computing the inaccessible hypotenuse.
  • Electrical engineering: The relationship between resistance, reactance, and impedance in AC circuits follows the same a^2 + b^2 = c^2 relationship, where impedance is the hypotenuse of a right triangle formed by resistance and reactance.

Extensions and Generalizations

The Pythagorean theorem has been generalized in several important directions:

The distance formula in coordinate geometry is a direct application. The distance between points (x1, y1) and (x2, y2) is d = sqrt((x2 - x1)^2 + (y2 - y1)^2). This is the hypotenuse of a right triangle with legs (x2 - x1) and (y2 - y1).

The law of cosines generalizes the theorem to any triangle: c^2 = a^2 + b^2 - 2ab cos(C). When the angle C is 90 degrees, cos(90) = 0 and the formula reduces to the standard Pythagorean theorem.

Higher dimensions extend the concept naturally. In three dimensions, the diagonal of a rectangular box with sides a, b, and c is d = sqrt(a^2 + b^2 + c^2). This pattern continues for any number of dimensions.

Fermat's Last Theorem asks whether the equation a^n + b^n = c^n has positive integer solutions for n greater than 2. For n = 2, there are infinitely many solutions (Pythagorean triples). Andrew Wiles proved in 1995 that no solutions exist for any higher power, resolving a conjecture that had been open for 358 years.

Tips for Working with Right Triangles

  • Always identify the hypotenuse first. The hypotenuse is opposite the right angle and is the longest side. Labeling it correctly prevents substitution errors in the formula.
  • Memorize common Pythagorean triples. Recognizing that 3-4-5, 5-12-13, and 8-15-17 are right triangles saves calculation time and provides quick sanity checks for your results.
  • Check your answer by squaring. After finding an unknown side, verify by substituting all three values back into a^2 + b^2 = c^2. If the equation balances, your calculation is correct.
  • Use the theorem to verify right angles. Before assuming a corner is 90 degrees, measure all three sides and check the Pythagorean relationship. Physical measurements can be slightly off, so allow small tolerances.
  • Simplify before computing. If both legs are multiples of the same number, factor it out first. For legs of 15 and 20, recognize this is 5 times the 3-4-5 triple, so the hypotenuse is 5 x 5 = 25 without any squaring or square roots.

Common Mistakes to Avoid

  • Squaring the hypotenuse on the wrong side. Remember that c^2 equals the sum of a^2 and b^2, not the difference. When finding a leg, subtract: a = sqrt(c^2 - b^2). Accidentally adding when you should subtract gives an impossibly large result.
  • Applying the theorem to non-right triangles. The formula a^2 + b^2 = c^2 only works when one angle is exactly 90 degrees. For other triangles, use the law of cosines or law of sines.
  • Forgetting to take the square root. The theorem gives c^2, not c. A common error is stopping at a^2 + b^2 = 100 and reporting the answer as 100 instead of taking the square root to get 10.
  • Using the slant height as the perpendicular height. In construction applications, the vertical rise and horizontal run must be measured perpendicular to each other. Measuring along a slope gives incorrect values.
  • Rounding too early. When chaining calculations, keep full precision until the final step. Rounding intermediate square roots introduces compounding errors that grow with each subsequent calculation.

Try Our Distance Calculator

Calculate the distance between any two points using the Pythagorean theorem in 2D or 3D coordinate space.

Use Calculator

Frequently Asked Questions

No, the Pythagorean theorem only applies to right triangles, which have exactly one 90-degree angle. For non-right triangles, you need the law of cosines, which is a generalization: c^2 = a^2 + b^2 - 2ab cos(C), where C is the angle opposite side c. When C equals 90 degrees, cos(C) equals zero and the law of cosines simplifies to the Pythagorean theorem. For obtuse triangles, c^2 is greater than a^2 + b^2, and for acute triangles, c^2 is less than a^2 + b^2.

A Pythagorean triple is a set of three positive integers that satisfy the equation a^2 + b^2 = c^2. Common examples include (3, 4, 5), (5, 12, 13), (8, 15, 17), and (7, 24, 25). They are useful because they produce right triangles with whole-number side lengths, making construction measurements exact without rounding. Multiples of any Pythagorean triple also form Pythagorean triples, so (6, 8, 10) and (9, 12, 15) are also valid sets based on the 3-4-5 triple.

Construction workers use the 3-4-5 method to verify that corners are square (exactly 90 degrees). From a corner point, they measure 3 feet along one wall and mark it, then measure 4 feet along the adjacent wall and mark it. If the diagonal distance between the two marks is exactly 5 feet, the corner is a true right angle. For larger projects they scale up to 6-8-10 or 9-12-15 for greater accuracy. This technique works because 3^2 + 4^2 = 9 + 16 = 25 = 5^2.

Yes, the Pythagorean theorem extends naturally to three dimensions. The distance between two points in 3D space is d = sqrt((x2-x1)^2 + (y2-y1)^2 + (z2-z1)^2). This is derived by applying the theorem twice: first to find the horizontal distance in the xy-plane, then using that distance with the vertical difference as two legs of a second right triangle. The same principle extends to any number of dimensions, making it foundational to higher-dimensional geometry.

While the theorem bears the name of the Greek mathematician Pythagoras (circa 570-495 BCE), evidence suggests that Babylonian mathematicians understood this relationship more than a thousand years earlier. A clay tablet known as Plimpton 322, dating to approximately 1800 BCE, contains a list of Pythagorean triples. Indian mathematicians also knew the theorem independently, as documented in the Sulba Sutras around 800 BCE. Pythagoras or his school may have provided the first formal proof, which is why the theorem carries his name in Western mathematics.

The hypotenuse is always the side opposite the right angle and is always the longest side of a right triangle. If you are given three side lengths and need to verify whether they form a right triangle, the longest side must be the hypotenuse. Check whether the square of the longest side equals the sum of the squares of the other two sides. If it does, you have a right triangle with that longest side as the hypotenuse.

If a^2 + b^2 does not equal c^2, the triangle is not a right triangle. If a^2 + b^2 is greater than c^2, the triangle is acute (all angles less than 90 degrees). If a^2 + b^2 is less than c^2, the triangle is obtuse (one angle greater than 90 degrees). This property makes the Pythagorean theorem a useful diagnostic tool: by comparing the sum of squares of the two shorter sides to the square of the longest side, you can classify any triangle without measuring angles directly.

Sources & References

  1. Wolfram MathWorld — Mathematical proofs and properties of the Pythagorean theorem: mathworld.wolfram.com
  2. Math Is Fun — Interactive explanations and visual proofs of the Pythagorean theorem: mathsisfun.com
  3. Math Is Fun — Area calculations and geometric shape reference: mathsisfun.com
Share this article:

CalculatorGlobe Team

Content & Research Team

The CalculatorGlobe team creates in-depth guides backed by authoritative sources to help you understand the math behind everyday decisions.

Related Calculators

Related Articles

Disclaimer: This calculator is for informational and educational purposes only. Results are estimates and may not reflect exact values.

Last updated: February 23, 2026