<s>[INST] 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.)
 [/INST] 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.$$
</s>