The geometric mean of two positive numbers x and y is √(xy), and in a right triangle the altitude drawn to the hypotenuse is the geometric mean of the two segments it creates. Each leg is a geometric mean too: a leg is the geometric mean of the whole hypotenuse and the hypotenuse segment next to that leg. Those three statements are the entire toolkit, and almost every mistake students make is not a calculation error but a labelling error, so this article focuses on reading a diagram correctly and picking the right formula.
The geometric mean, defined
For positive x and y, the geometric mean g satisfies x / g = g / y. Cross multiplying gives g² = xy, so:
The geometric mean of two positive numbers.
It is the number that sits between x and y multiplicatively, the way the arithmetic mean sits between them additively. Some plain examples, each checked by squaring the answer:
| x | y | Product xy | Geometric mean √(xy) | Check |
|---|---|---|---|---|
| 4 | 9 | 36 | 6 | 6² = 36 |
| 2 | 8 | 16 | 4 | 4² = 16 |
| 3 | 12 | 36 | 6 | 6² = 36 |
| 5 | 20 | 100 | 10 | 10² = 100 |
| 3 | 8 | 24 | 2√6 ≈ 4.899 | (2√6)² = 4 · 6 = 24 |
| 4 | 16 | 64 | 8 | 8² = 64 |
Three things to notice. The geometric mean of 4 and 9 is 6, not 6.5, because it is built from the product rather than the sum. The answer is often irrational, as with √24 = 2√6, and the exact radical beats 4.899. And different pairs can share a geometric mean, since 4 · 9 and 3 · 12 both equal 36, which is why knowing only h never pins down p and q on its own.
Notation used throughout
Every formula below depends on strict labelling, so fix it now and never change it.
- The right angle is at vertex C.
- The legs are
aandb; the hypotenuse isc. his the altitude from the right angle, perpendicular to the hypotenuse.hlands on the hypotenuse and splits it intopandq, wherepis the segment touching legaandqis the segment touching legb.- Therefore
c = p + q.
Figure 1
The word “touching” is doing real work. Leg a and segment p meet at a shared vertex; they form a continuous path along the outside of the triangle. Leg b and segment q meet at the other end. If you can point at the vertex where a leg and a segment meet, you have paired them correctly.
The three relationships
The three geometric mean relationships in a right triangle.
Stated as geometric means:
| Quantity | Geometric mean of | Formula |
|---|---|---|
Altitude h | the two hypotenuse segments p and q | h = √(p · q) |
Leg a | the whole hypotenuse c and the adjacent segment p | a = √(c · p) |
Leg b | the whole hypotenuse c and the adjacent segment q | b = √(c · q) |
All three come from the same source: the altitude cuts the original triangle into two smaller triangles that are similar to it and to each other, and corresponding sides of similar figures are in proportion. The full derivation, including the proof that the three triangles really are similar, lives in the article on the right triangle altitude theorem, and the similarity argument behind it is developed in similar right triangles. This article assumes the results and concentrates on using them.
How to identify which relationship you need
This is where problems are won or lost. A textbook diagram rarely uses the letters a, b, c, p, q, h. It shows numbers on segments, and you have to decide what each number is before any formula applies. Use a fixed procedure rather than pattern matching.
The four-step identification procedure
Step 1. Find the right angle and the altitude. The altitude is the segment from the right angle that meets the hypotenuse at a second right angle mark. Everything hinges on this segment, so locate it first. The point where it lands is the foot.
Step 2. Name the hypotenuse and its two pieces. The hypotenuse is the side the altitude is perpendicular to, and the foot divides it in two. Call the whole thing c and the pieces p and q. At this stage you do not yet know which piece is which.
Step 3. Pair each leg with the piece it touches. Walk from the far end of one leg along that leg to the sharp vertex, then continue onto the hypotenuse. The piece you step onto is that leg’s segment. The leg you called a pairs with p; the other leg pairs with q. A leg and its own segment always share a vertex; a leg and the other segment never do.
Step 4. Look at what is given and what is asked, then read the decision table.
The decision table
| What you are given | What you want | Relationship to use |
|---|---|---|
Both hypotenuse segments p, q | the altitude h | h = √(p · q) |
Altitude h and one segment | the other segment | p = h² / q, or q = h² / p |
Hypotenuse c and the segment next to a leg | that leg | a = √(c · p) |
| A leg and the segment next to it | the whole hypotenuse | c = a² / p |
| A leg and the whole hypotenuse | the segment next to that leg | p = a² / c |
Both segments p, q | either leg | add them for c, then a = √(c · p) |
| Two legs | h | h = ab / c after finding c, or c = a² / p |
Altitude h and hypotenuse c | both segments | solve p + q = c with p · q = h² |
The fastest filter
Ask one question: is the whole hypotenuse involved? If a given or wanted length spans the entire hypotenuse, you are in a leg relationship (a² = c · p or b² = c · q). If every hypotenuse length you are handed is only a piece, you are in the altitude relationship (h² = p · q). The altitude formula never contains c; the leg formulas always do.
A worked identification
Figure 2
Run the procedure on Figure 2. The altitude is 4.8 and the foot splits the hypotenuse into 3.6 and 6.4, which sum to 10. The leg of length 6 and the piece of length 3.6 meet at the top vertex, so they pair: 6² = 10 · 3.6 gives 36 = 36. The leg of length 8 and the piece of length 6.4 meet at the right vertex: 8² = 10 · 6.4 gives 64 = 64. And the altitude squared, 4.8² = 23.04, equals 3.6 · 6.4 = 23.04. Every pairing checks out.
Notice that the shorter leg sits above the shorter segment. That is always true, and it is the quickest visual test for a swapped pairing.
Using the relationships
Solving for the altitude
You need both hypotenuse segments. Multiply them and take the square root. The whole hypotenuse never appears.
Problem 1 Altitude from two segments
- Given
- p = 4, q = 9
- Find
- The altitude h
- Formula
- h = √(p · q)
- Substitution
- h = √(4 · 9)
- Calculation
- h = √36
Answer h = 6
Check it: 6² = 36 and 4 · 9 = 36. The hypotenuse here is 4 + 9 = 13, which is not needed for h but is worth writing down for later parts of a question.
Problem 2 An altitude that is an exact radical
- Given
- p = 3, q = 8
- Find
- The altitude h
- Formula
- h = √(p · q)
- Substitution
- h = √(3 · 8)
- Calculation
- h = √24 = √(4 · 6) = 2√6
Answer h = 2√6 ≈ 4.899 (3 d.p.)
Leave the answer as 2√6 unless a decimal is demanded. Squaring it returns 4 · 6 = 24, the product you started with, so the exact form verifies instantly while 4.899² = 24.000201 does not.
Solving for a hypotenuse segment
Two routes reach a segment. If you know h and the other segment, rearrange h² = p · q. If you know a leg and the full hypotenuse, rearrange that leg’s formula.
Problem 3 The second segment from h and one segment
- Given
- h = 12, p = 8
- Find
- The segment q
- Formula
- q = h² / p
- Substitution
- q = 12² / 8
- Calculation
- q = 144 / 8
Answer q = 18
The hypotenuse is then 8 + 18 = 26. Confirm with the leg relationship: a² = 26 · 8 = 208 and b² = 26 · 18 = 468, and 208 + 468 = 676 = 26². The triangle closes.
Problem 4 A segment from a leg and the hypotenuse
- Given
- Leg a = 6, hypotenuse c = 9
- Find
- The segment p next to leg a
- Formula
- p = a² / c
- Substitution
- p = 6² / 9
- Calculation
- p = 36 / 9
Answer p = 4
Because the whole hypotenuse was given, this is a leg relationship, not an altitude one. The remaining segment is q = 9 − 4 = 5.
Solving for the whole hypotenuse
If you are given the two segments, just add them. If you are given a leg and its own segment, rearrange a² = c · p into c = a² / p.
Problem 5 Hypotenuse from a leg and its segment
- Given
- Leg a = 6, segment p = 4
- Find
- The hypotenuse c
- Formula
- c = a² / p
- Substitution
- c = 6² / 4
- Calculation
- c = 36 / 4
Answer c = 9
Problem 6 Hypotenuse from both segments
- Given
- p = 4, q = 16
- Find
- The hypotenuse c
- Formula
- c = p + q
- Substitution
- c = 4 + 16
- Calculation
- No square root is involved; the segments are collinear.
Answer c = 20
Problem 6 catches people out because it looks as if a geometric mean must be used. It does not: p and q lie end to end along one straight line, so they add. Geometric means appear only when a length is perpendicular to, or slanted across, the pieces.
Solving for a leg
A leg needs the whole hypotenuse and the segment adjacent to that same leg.
Problem 7 Leg from the hypotenuse and its segment
- Given
- c = 25, p = 9 (p touches leg a)
- Find
- Leg a
- Formula
- a = √(c · p)
- Substitution
- a = √(25 · 9)
- Calculation
- a = √225
Answer a = 15
Problem 8 A leg in exact radical form
- Given
- c = 9, q = 5 (q touches leg b)
- Find
- Leg b
- Formula
- b = √(c · q)
- Substitution
- b = √(9 · 5)
- Calculation
- b = √45 = √(9 · 5) = 3√5
Answer b = 3√5 ≈ 6.708 (3 d.p.)
Problems 4, 5 and 8 describe the same triangle: a = 6, b = 3√5, c = 9, p = 4, q = 5. Check with the Pythagorean theorem: 6² + (3√5)² = 36 + 45 = 81 = 9². You can drop any two of those values into the right triangle calculator to confirm the third.
Multi-step problems
Harder questions chain the relationships: the output of one becomes the input of the next. Work in a fixed order (segments, then hypotenuse, then altitude, then legs) and the chain writes itself.
Problem 9 Everything from the two segments
- Given
- p = 4, q = 16
- Find
- h, c, a and b
- Formula
- c = p + q, h = √(p · q), a = √(c · p), b = √(c · q)
- Substitution
- c = 4 + 16 = 20; h = √(4 · 16) = √64; a = √(20 · 4) = √80; b = √(20 · 16) = √320
- Calculation
- h = 8; a = √80 = 4√5; b = √320 = 8√5
Answer c = 20, h = 8, a = 4√5 ≈ 8.944, b = 8√5 ≈ 17.889
Check: a² + b² = 80 + 320 = 400 = 20². Also h = ab / c = (4√5)(8√5) / 20 = 160 / 20 = 8, which agrees with the geometric mean result from a completely different formula.
Problem 10 From the altitude and one segment to the whole triangle
- Given
- h = 6, p = 4
- Find
- q, c, a and b
- Formula
- q = h² / p, c = p + q, a = √(c · p), b = √(c · q)
- Substitution
- q = 36 / 4 = 9; c = 4 + 9 = 13; a = √(13 · 4) = √52; b = √(13 · 9) = √117
- Calculation
- a = √52 = 2√13; b = √117 = 3√13
Answer q = 9, c = 13, a = 2√13 ≈ 7.211, b = 3√13 ≈ 10.817
Check: 52 + 117 = 169 = 13². Note how the exact forms 2√13 and 3√13 make the check trivial, whereas 7.211² + 10.817² = 168.99 would leave you wondering about rounding.
Problem 11 Backwards from two known sides
- Given
- Leg a = 12, hypotenuse c = 20
- Find
- p, q and h
- Formula
- p = a² / c, q = c − p, h = √(p · q)
- Substitution
- p = 144 / 20 = 7.2; q = 20 − 7.2 = 12.8; h = √(7.2 · 12.8)
- Calculation
- h = √92.16
Answer p = 7.2, q = 12.8, h = 9.6
The other leg is b = √(20 · 12.8) = √256 = 16, so this is a 12-16-20 triangle, and the standard altitude formula gives h = ab / c = 12 · 16 / 20 = 9.6. Two independent methods, one answer.
Problem 12 Altitude and hypotenuse given, segments unknown
- Given
- h = 12, c = 25
- Find
- p, q, a and b
- Formula
- p + q = 25 and p · q = h² = 144, so p and q are roots of t² − 25t + 144 = 0
- Substitution
- t = (25 ± √(625 − 576)) / 2 = (25 ± √49) / 2 = (25 ± 7) / 2
- Calculation
- t = 9 or t = 16; then a = √(25 · 9) = 15 and b = √(25 · 16) = 20
Answer p = 9, q = 16, a = 15, b = 20
Problem 12 is the one case where a single relationship is not enough. Knowing h fixes only the product p · q, and knowing c fixes only the sum, so you need both together. The quadratic has two roots because the triangle can be drawn either way round; naming the smaller root p simply means leg a is the shorter leg.
Figure 3
Verification table
Three familiar triangles with every quantity computed and checked. The segments are p = a² / c and q = b² / c.
| Triangle | a | b | c | h | p | q | Check |
|---|---|---|---|---|---|---|---|
| 3-4-5 | 3 | 4 | 5 | 2.4 | 1.8 | 3.2 | p + q = 5, h² = 5.76 = 1.8 · 3.2 |
| 6-8-10 | 6 | 8 | 10 | 4.8 | 3.6 | 6.4 | p + q = 10, h² = 23.04 = 3.6 · 6.4 |
| 5-12-13 | 5 | 12 | 13 | 60/13 ≈ 4.6154 | 25/13 ≈ 1.9231 | 144/13 ≈ 11.0769 | p + q = 13, h² = 3600/169 = (25 · 144)/169 |
The 5-12-13 row is the instructive one. Its segments are 25/13 and 144/13, which are exactly a²/c and b²/c, and they refuse to be whole numbers. Keep them as fractions with denominator 13 and the check h² = pq is exact; round them to 1.92 and 11.08 first and the product drifts to 21.2736 instead of 21.3018. More on that triangle in the 5-12-13 triangle article.
Common mistakes
1. Pairing a leg with the segment it does not touch
This is the single biggest error, and it accounts for more lost marks than every other mistake combined. Take the triangle with c = 25, p = 9 and q = 16, where p touches leg a.
The correct calculation is a = √(25 · 9) = √225 = 15. The wrong version reaches for the other segment: a = √(25 · 16) = √400 = 20. That is not a random number, which is what makes it dangerous. It is the length of the other leg, so it looks like a perfectly reasonable answer.
How to catch it. If you accept a = 20 and then compute b the same wrong way, you get b = √(25 · 9) = 15 as well, and the triangle you have described has legs 20 and 15 attached to the wrong segments. Test with 9 and 16 directly: a leg of 20 sitting over a segment of 9 would require 20² = 25 · 9, that is 400 = 225, which is false. The second guard is the size rule: the shorter leg must sit over the shorter segment. Leg 15 over segment 9 and leg 20 over segment 16 is the only consistent arrangement.
2. Using the whole hypotenuse in the altitude formula
Writing h = √(c · p) instead of h = √(p · q) is the second most common slip. The altitude relationship contains only the two pieces. If the number 25 ever appears under the root when you are solving for h, you have used a leg formula by accident.
3. Adding when you should take a geometric mean, or the reverse
p and q add to give c because they are collinear. h does not add to anything, because it is perpendicular to them. Any time you are tempted to write h = p + q, look at the diagram: h leaves the line that p and q live on.
4. Squaring the wrong side of the equation
From a² = c · p, the leg is a = √(c · p), but the hypotenuse is c = a² / p, not c = √(a² / p). Isolate before you root, and rewrite the equation in full each time rather than doing it in your head.
5. Rounding a segment and then reusing it
Computing p = 25/13 ≈ 1.92 and then using 1.92 to find a leg introduces error that compounds. Carry the fraction 25/13 or the exact radical, and round only at the very end. State the precision you used.
Practice set
Use the notation from Figure 1 throughout: p touches leg a, q touches leg b, and c = p + q. Worked solutions follow.
Easy
- The altitude to the hypotenuse divides it into segments of 2 and 8. Find
h. - p = 9 and q = 16. Find
handc. - c = 16 and p = 4. Find leg
a.
Medium
- h = 10 and q = 25. Find
pand thenc. - Leg a = 6 and hypotenuse c = 9. Find
p,qand legb, leavingbexact. - p = 3 and q = 9. Find
h,c,aandb, in exact form.
Hard
- Leg b = 20 and the segment touching it is q = 16. Find
c,p, legaandh. - h = 6 and c = 13. Find
p,q,aandb.
Answer key
1. h = 4. Only pieces of the hypotenuse are given, so this is the altitude relationship: h = √(2 · 8) = √16 = 4. Check: 4² = 16 = 2 · 8. The hypotenuse, if you want it, is 10.
2. h = 12, c = 25. h = √(9 · 16) = √144 = 12, and c = 9 + 16 = 25. Check: 12² = 144 = 9 · 16. This is the 15-20-25 triangle from Figure 3.
3. a = 8. The full hypotenuse appears, so use a leg relationship: a = √(16 · 4) = √64 = 8. Check by completing the triangle: q = 16 − 4 = 12, b = √(16 · 12) = √192 = 8√3 ≈ 13.856, and 8² + (8√3)² = 64 + 192 = 256 = 16².
4. p = 4, c = 29. Rearrange h² = p · q to p = h² / q = 100 / 25 = 4. Then c = 4 + 25 = 29. Check: √(4 · 25) = √100 = 10 = h.
5. p = 4, q = 5, b = 3√5. A leg and the whole hypotenuse are given, so p = a² / c = 36 / 9 = 4. Then q = 9 − 4 = 5 and b = √(9 · 5) = √45 = 3√5 ≈ 6.708. Check: 6² + (3√5)² = 36 + 45 = 81 = 9².
6. h = 3√3, c = 12, a = 6, b = 6√3. Both segments are given, so h = √(3 · 9) = √27 = 3√3 ≈ 5.196 and c = 3 + 9 = 12. Then a = √(12 · 3) = √36 = 6 and b = √(12 · 9) = √108 = 6√3 ≈ 10.392. Check: 36 + 108 = 144 = 12². This is a 30-60-90 triangle, since b = a√3; see the 30-60-90 triangle article for why the segments split 1 to 3.
7. c = 25, p = 9, a = 15, h = 12. Leg b sits over its own segment q, so c = b² / q = 400 / 16 = 25. Then p = 25 − 16 = 9, a = √(25 · 9) = √225 = 15, and h = √(9 · 16) = √144 = 12. Check: 15² + 20² = 225 + 400 = 625 = 25², and h = ab / c = 15 · 20 / 25 = 12.
8. p = 4, q = 9, a = 2√13, b = 3√13. The altitude gives the product p · q = 36; the hypotenuse gives the sum p + q = 13. So p and q solve t² − 13t + 36 = 0, that is (t − 4)(t − 9) = 0, giving 4 and 9. Taking p = 4 as the smaller, a = √(13 · 4) = √52 = 2√13 ≈ 7.211 and b = √(13 · 9) = √117 = 3√13 ≈ 10.817. Check: 52 + 117 = 169 = 13². If you prefer to confirm the finished triangle numerically, enter 7.211 and 10.817 as the legs in the triangle solver on the homepage and read back a hypotenuse of 13.
Frequently Asked Questions
What is the geometric mean of two numbers?
The geometric mean of two positive numbers x and y is √(xy), the number g for which x / g = g / y. For 4 and 9 it is √36 = 6. It differs from the arithmetic mean, which for 4 and 9 would be 6.5, because it is built from the product rather than the sum.
Is the altitude to the hypotenuse always the geometric mean of the two segments?
Yes, in any right triangle, provided the altitude is drawn from the right angle to the hypotenuse. Then h² = p · q always holds. It does not hold for an altitude drawn from either acute vertex, and it does not hold in a triangle that is not right angled.
Which hypotenuse segment goes with which leg?
The segment that shares a vertex with the leg. Leg a and segment p meet at one end of the hypotenuse, so a² = c · p; leg b and segment q meet at the other, so b² = c · q. A quick visual check is that the shorter leg always sits over the shorter segment.
Do I need the whole hypotenuse to find the altitude?
No. The altitude relationship h = √(p · q) uses only the two segments. If the whole hypotenuse c shows up inside your square root while you are solving for h, you have picked a leg formula by mistake. The reverse is also true: a leg formula always contains c.
Can the geometric mean give an irrational answer?
Yes, and it usually does. The geometric mean of 3 and 8 is √24 = 2√6 ≈ 4.899, and the legs in Problem 10 are 2√13 and 3√13. Keep the exact radical through the working and round only at the final step, since squaring the exact form is what lets you verify the answer cleanly.