5. Given two parallel lines and a point $\boldsymbol{A}$ between them, which is the vertex of a right angle of a right triangle, with the other two vertices lying on each of the parallel lines. What position should the triangle be in to have the smallest area?
5. From Fig. 27, it is visible that

$$
A C=\frac{b}{\cos \varphi} ; \quad A B=\frac{a}{\sin \varphi} ; \quad S_{A B C}=\frac{a b}{\sin 2 \varphi}
$$

The minimum value of the area $S=a b$ is obtained when $\varphi=\frac{\pi}{4}$.