2. Two circles with radii $R$ and $r$ touch at the point $M$. On the circle with radius $r$, there is a point $N$, diametrically opposite to $M$, and a tangent is drawn at this point. Find the radius of the circle that touches both circles and the tangent passing through point $N$.
Solution. Case I. The circles touch each other externally. We have:

$$
\begin{aligned}
& (R+2 r-x)^{2}+y^{2}=(R+x)^{2} \\
& (x-r)^{2}+y^{2}=(r+x)^{2}
\end{aligned}
$$

from which, by eliminating $y$, we get $x=\frac{r(R+r)}{R}$.

The other circle that touches both given circles and the tangent has its center at point $S$ and radius $\frac{R+r}{2}$.

![](https://cdn.mathpix.com/cropped/2024_06_05_12f9fb0299f2ef2e3407g-5.jpg?height=368&width=950&top_left_y=1003&top_left_x=395)

Case II. The circles touch each other internally. (In this case, it can be assumed that $R>r$).

It is easily seen that there are three such circles. One of them has its center at point $P$ and radius $x=\frac{R-r}{2}$, while the other two are symmetric to each other. Their radii are obtained from the following equations:

$$
\begin{aligned}
& (r-x)^{2}+y^{2}=(r+x)^{2} \\
& (R-2 r-x)^{2}+y^{2}=(R-x)^{2}
\end{aligned}
$$

from which we get $x=\frac{r(R-r)}{R}$.