Problem 5. The lengths of the legs of the right triangle $ABC$ are $a$ and $b$. The angle bisector of the right angle at vertex $C$ intersects the hypotenuse at point $D$. Calculate the length of the segment $CD$.
Solution. Let $M$ and $N$ be the feet of the perpendiculars dropped from point $D$ to the legs $A C$ and $B C$, respectively. Triangles $\triangle C M D$ and $\triangle C N D$ are isosceles and right-angled, from which it follows that quadrilateral $MDNC$ is a square. Let $x$ be the side length of this square. Since

$$
P_{\triangle A B C}=P_{\triangle C D B}+P_{\triangle A D C}
$$

we get $\frac{a b}{2}=\frac{a x}{2}+\frac{b x}{2}$, which simplifies to $x=\frac{a b}{a+b}$. Since $\overline{C D}$ is the diagonal of square $M D N C$, we get $\overline{C D}=x \sqrt{2}=\frac{a b \sqrt{2}}{a+b}$.

![](https://cdn.mathpix.com/cropped/2024_06_05_a1dcf8241dfa57377282g-10.jpg?height=326&width=451&top_left_y=1863&top_left_x=1029)