[Similar auxiliary triangles]

The base of the triangle is $a$, and the height dropped to the base is $h$. A square is inscribed in the triangle, one of its sides lying on the base of the triangle, and two vertices on the lateral sides. Find the ratio of the area of the square to the area of the triangle.
Let vertices $K$ and $L$ of square $KLMN$ with side $x$ lie on side $BC=a$ of triangle $ABC$, vertices $M$ and $N$ lie on sides $AC$ and $AB$ respectively, and $Q$ be the intersection point of the altitude $AP=h$ of the triangle with side $MN$ of the square. Then $AQ = AP - PQ = AP - ML = h - x$. Triangle $AMN$ is similar to triangle $ABC$ with the similarity ratio $\frac{AQ}{AP} = \frac{h-x}{h}$, so $MN = BC \cdot \frac{AQ}{AP}$, or $x = a \cdot \frac{h-x}{h}$, from which $x = \frac{ah}{a+h}$. Therefore, $\frac{S_{KLMN}}{S_{ABC}} = \frac{2x^2}{ah} = \frac{2ah}{(a+h)^2}$.

## Answer

$\frac{2ah}{(a+h)^2}$.