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!