In a semicircle of radius $R$, two circles are inscribed, touching each other, the semicircle, and its diameter. The radius of one of them is $r$. Find the radius of the other.
Let $O$ be the center of the semicircle, $O_1$ the center of a circle of radius $r$, $O_2$ the center of a circle of unknown radius $x$, $M$ and $N$ the points of tangency of the first and second circles with the diameter of the semicircle, respectively. Then,

$$
O_1 M = r, \quad O_2 N = x, \quad O_1 O_2 = r + x, \quad M N = 2 \sqrt{x r}, \quad O O_1 = R - r, \quad O O_2 = R - x
$$

From the right triangles $OMO_1$ and $ONO_2$, we find that

$$
\begin{aligned}
& O M = \sqrt{O O_1^2 - O_1 M^2} = \sqrt{(R - r)^2 - r^2} = \sqrt{R^2 - 2 R r} \\
& O N = \sqrt{O O_2^2 - O_2 N^2} = \sqrt{(R - x)^2 - x^2} = \sqrt{R^2 - 2 R x}
\end{aligned}
$$

Further, we have:

$$
\begin{gathered}
\sqrt{R^2 - 2 r R} + \sqrt{R^2 - 2 x R} = 2 \sqrt{x r} \Rightarrow 2 \sqrt{x r} - \sqrt{R^2 - 2 x R} = \sqrt{R^2 - 2 r R} \Rightarrow \\
\Rightarrow \left(2 \sqrt{x r} - \sqrt{R^2 - 2 x R}\right)^2 = R^2 - 2 r R \Rightarrow 4 x r + R^2 - 2 x R - 4 \sqrt{x r (R^2 - 2 x R)} = R^2 - 2 r R \Rightarrow \\
\Rightarrow 2 \sqrt{x r (R^2 - 2 x R)} = r R - (R - 2 r) x \Rightarrow 4 x r (R^2 - 2 x R) = (r R - (R - 2 r) x)^2 \Rightarrow \\
\Rightarrow (R + 2 r)^2 x^2 - 2 r R (3 R - 2 r) x + r^2 R^2 = 0 \Rightarrow x = \frac{r R (3 R - 2 r \pm 2 \sqrt{2 R (R - 2 r)}}{(R + 2 r)^2}.
\end{gathered}
$$

## Answer

$\frac{r R (3 R - 2 r \pm 2 \sqrt{2 R (R - 2 r)}}{(R + 2 r)^2}$