10.2. Given a right triangle $A B C$ with legs $A C=a$ and $C B=b$. Find a) the side of the square with vertex $C$ of the largest area, entirely lying within the triangle $A B C$; b) the dimensions of the rectangle with vertex $C$ of the largest area, entirely lying within the triangle $A B C$.
Answer. a) $\frac{a b}{a+b}$; b) $\frac{a}{2}$ and $\frac{b}{2}$. Solution. a) Introduce a coordinate system: the origin - at vertex $C$, the $x$-axis - along $C A$, the $y$-axis - along $C B$. Then the hypotenuse lies on the line $y=b-\frac{b}{a} x$. The diagonal of the square can be written as the equation of the line $y=x$, and therefore the point of intersection of this line with the hypotenuse is obtained by solving the given equations: $x=b-\frac{b}{a} x \Leftrightarrow x=$ $\frac{a b}{a+b}$. b) Let $x, y$ be the sides of the desired rectangle. Using the coordinate method (as in part a), we get that the point ( $x: y$ ) lies on the line passing through the points $(0 ; b)$ and ( $a ; 0$ ), i.e., $\frac{x}{a}+\frac{y}{b}=1$. It is required to find the maximum value of the area $S=x y . \quad$ We have $\quad S=x y=a b \cdot\left(\frac{x}{a} \cdot \frac{y}{b}\right) \leq a b \cdot \frac{1}{4}\left(\frac{x}{a}+\frac{y}{b}\right)^{2}=\frac{a b}{4} . \quad$ Here we used the inequality between the geometric mean and the arithmetic mean; the equality (maximum value) is achieved when $\frac{x}{a}=\frac{y}{b}=\frac{1}{2}$. Remark. Another way to calculate the maximum value is obtained by finding the vertex of the parabola - the graph of the quadratic trinomial $S(x)=x\left(b-\frac{b x}{a}\right)$.