Inscribe a rectangle of the largest area in the given right triangle so that all vertices of the rectangle lie on the sides of the triangle.

#
First, consider the case when one vertex of the rectangle coincides with the vertex of the right angle of the triangle. Then triangles \(A D E\) and \(A C B\) are similar. Let \(A C = b\), \(B C = a\), \(C D = E F = b_1\), \(D E = C F = a_1\). From the similarity of the triangles, we get \(D A : A C = E D : B C\) or \(\frac{b - b_1}{b} = \frac{a_1}{a}\), from which \(b_1 = \left(a - a_1\right) \frac{b}{a}\). The area of the rectangle is \(a_1 b_1 = \left(a - a_1\right) a_1 \frac{b}{a}\). Discarding the constant factor \(\frac{b}{a}\), we investigate the expression \(\left(a - a_1\right) a_1\). It takes its maximum value when \(a_1 = \frac{a}{2}\). The area of the corresponding rectangle is \(\frac{a b}{4}\). From this, it is clear that the other side of the rectangle is half of the corresponding leg.

The case when one side of the rectangle lies on the hypotenuse \(A B\) reduces to the previous one. Indeed, the height \(C D\) divides the rectangle into two rectangles, each of which is inscribed in the corresponding right triangle as considered above. By the proven result, the area of the rectangle will not exceed \(\frac{1}{2} S_{A B C}\).