|`
| ` x
| `
| ` c
a | z /`
| / ` y
|_/ `
|/|_____`
b
I'm new to this SE, but I have an SO account, so hello!
Assume that z is the altitude that intersects the hypotenuse, and x and y are the resulting line segments. This is what my friend had to say about this.
$$ z = \sqrt{xy} $$
You cannot find $z$ with $a$ and $b$.
Here's what I said.
Somehow, $a$ and $b$ must be related to $x$ and $y$. At first I thought that $$\frac{a}{a+b} * c = x$$ That was wrong, as the altitude did not bisect the right angle. Through some thinking, but not proving, I said this, which was correct, AFAIK.
$$\frac{a^2}{a^2+b^2} * c = x\\\\\frac{b^2}{a^2+b^2} * c = y $$ Some simplifying ensued. $$\frac{a^2}{c^2} * c = x\\\\\frac{b^2}{c^2} * c = y $$ More. $$\frac{a^2}{c} = x\\\\\frac{b^2}{c} = y $$
Now that $a$ and $b$ were used to find $x$ and $y$, I got $z$ with the geometric mean.
$$ z = \sqrt{\frac{a^2}{c} * \frac{b^2}{c}} $$ That goes to: $$ z = \frac{ab}{c} $$
This was all and well, but then I was asked how did you come up with the first step?
$\newcommand{\area}{\operatorname{Area}}$ As usual, let $A,B,C$ be the vertices opposing the sides $a,b$ and $c$, respectively. Let $Z$ be the remaining vertex (i.e. where the altitude intersects the hypothenuse).
Then, you will notice that $$\frac{x}{c}=\frac{\area(\triangle ZBC)}{\area(\triangle ABC)}\quad\text{and}\quad\frac{y}{c}=\frac{\area(\triangle AZC)}{\area(\triangle ABC)}.$$ This is because these triangles have the altitude $ZC$ in common. Therefore, their areas are proportional to the remaining sides.
But the areas of the three similar right triangles are proportional to the areas of the squares over their hypothenuses. This yields $$\frac{\area(\triangle ZBC)}{\area(\triangle ABC)}=\frac{a^2}{c^2}\quad\text{and}\quad\frac{\area(\triangle AZC)}{\area(\triangle ABC)}=\frac{b^2}{c^2}.$$ Observing that $c^2=a^2+b^2$ now yields your "problem part".