Length of side of biggest square inscribed in a triangle I have seen that the length of each side of the biggest square that can be inscribed in a right triangle is half the harmonic mean of the legs of the triangle.  I have not seen a rigorous explanation for it, though.  I would appreciate such an explanation.  (This is intriguing - it is an optimization problem that does not require Calculus to explain.)
 A: Let we assume that the legs $CB$ and $CA$ of our right triangle $ACB$ have lengths $a$ and $b$.
First case: we consider the largest inscribed with a vertex at $C$. Assuming that its side length is $l$,
by triangle similarities we have
$$ c = \sqrt{a^2+b^2} = l\cdot\left(\frac{c}{b}+\frac{c}{a}\right), $$
from which $l=\frac{1}{2}HM(a,b)$.
Second case: we consider the largest inscribed square with a side on $AB$. By triangle similarities we have:
$$ c = l+l\cdot\left(\frac{a}{b}+\frac{b}{a}\right)=l\cdot\frac{ab+c^2}{ab} $$
from which $l=\frac{abc}{ab+c^2}=\frac{ab\sqrt{a^2+b^2}}{a^2+ab+b^2}$. I leave to you to check if the inequality
$$ \frac{ab}{a+b}\geq \frac{ab\sqrt{a^2+b^2}}{a^2+ab+b^2} $$
holds or not. Hint:
$$ (a^2+ab+b^2)^2-(a+b)^2(a^2+b^2) = a^2b^2.$$
A: I think the point is that there are only finitely many squares that can be inscribed in a right triangle, so you just have to write them down and take the maximum area. Thus, there is no need for calculus. 
How does one check the above claim? Note that two vertices of the square must lie one side of the triangle by the pigeonhole principle. 
Case (1): Suppose the right triangle has legs of lengths $a$ and $b$. If two vertices lie on the leg of length $a$, then the square must share an angle with the right angle of the triangle, and an adjacent side of the square must lie on the leg of length $b$. Let the side of the square be $s$, and let $\theta$ denote the angle between the leg of length $a$ and the hypotenuse. Then $(a - s) \tan \theta = s$, and this equation has only one solution in $s$, namely $s = \frac{ab}{a+b}$.
Case (2): Otherwise, the square must have one edge lying on the hypotenuse. In that case, $\sin \theta = \frac{cs}{a(c-s)}$, which again has only one solution in $s$, namely $s = \frac{ab\sqrt{a^2+b^2}}{a^2 + ab + b^2}$.
You then need to take the maximum of these two possibilities; the answer will always be $\frac{ab}{a+b}$, which is the desired half-harmonic-mean.
