Algebra/geometry question

At least I don’t think resorting to Trigonometry should be necessary; but here’s hoping.

My question is related to what’s known as the right triangle altitude theorem, aka. the geometric mean theorem. Basically, when you have a right triangle with the hypotenuse taken as the base, the theorem relates the relationship between the hypotenuse, the vertical altitude, and the bases of the two resulting smaller similar triangles:

If h denotes the altitude in a right triangle and p and q the segments on the hypotenuse then the theorem can be stated as h = {\sqrt {p×q}}

To give an example with all whole numbers, if you have a 3-4-5 right triangle of hypotenuse 25 with sides of 15 and 20, the altitude will be 12 and p and q will be 9 and 16.

My question is concerned with a rectangle containing the right triangle, with height the same as the altitude and a length of p + q. I want to be able to take the ratio of length to width of the rectangle as a single number, and plug that into a formula that will give the ratio p : q. This should be doable, yet my algebra skills seem insufficient. Anyone?

If I understand correctly, here’s the formula you’re looking for. If r = (p+q)/\sqrt{pq} is the ratio of length to width, then

\frac pq = \tfrac 12\left( r^2 - 2 + r\sqrt{r^2-4} \right).

The square root is OK because r\geq 2 by the arithmetic-geometric mean inequality.

Here’s how I derived it: Let x = p/q. Then

r = \frac{p+q}{\sqrt{pq}} = \sqrt{x} + \frac{1}{\sqrt x}

so

r^2 = x + 2 + \frac 1x.

Rearranging,

x^2 + (2-r^2)x + 1 = 0

and now you can write down the solutions using the quadratic formula. One of those will give you x and the other gives you 1/x.

I don’t know if I understand the question either, but if

x = \frac{p+q}{\sqrt{pq}}

then

\frac{p}{q} = \frac{x^2+x\sqrt{x^2-4}-2}{2}.

It must be right, we both got the same formula!

Last comment while I’m in the edit window: This formula assumes p\geq q. Put another way, it gives the larger of p/q or q/p.

Got it (I think). I’ll play around with it and see if some examples give the expected answers. Thanks all!

I’m sorry but this left me completely dead in the water. I don’t know how you derive the second half of the equation from the first half. I’m missing a step somewhere.

It might be easier to go from the right side to the left?
\sqrt{x}+\frac{1}{\sqrt{x}}
\sqrt\frac{p}{q}+\sqrt\frac{q}{p}
\frac{p}{\sqrt{pq}}+\frac{q}{\sqrt{pq}}
\frac{p+q}{\sqrt{pq}}

Right. I left out the intermediate steps. But the key in either direction is realizing that you can rewrite the fraction

\frac{p+q}{\sqrt{pq}} = \frac{p}{\sqrt{pq}} + \frac{q}{\sqrt{pq}}.

That much I got; but apparently if I was ever taught how to rework square roots in fractions, I’ve forgotten it.
\sqrt\frac{q}{p} equals \frac{q}{\sqrt{pq}} ??

Inside the square root, multiply and divide by q:

\sqrt{\frac qp} = \sqrt{\frac{q^2}{pq}} = \frac{\sqrt{q^2}}{\sqrt{pq}} = \frac{q}{\sqrt{pq}}

Or, you can work it from right to left, first using that q = \sqrt{q^2}.

Well it’s apparent why I couldn’t come up with a formula on my own. And yet given concrete numbers for the hypotenuse and the altitude, I was calculating 𝑝 and 𝑞 fairly easily; I just couldn’t figure out how to generalize it.