5. Circles $K_{1}$ and $K_{2}$ with centers at points $O_{1}$ and $O_{2}$ have the same radius $r$ and touch the circle $K$ of radius $R$ with center at point $O$ internally. The angle $O_{1} O O_{2}$ is $120^{\circ}$. Find the radius $q$ of the circle that touches $K_{1}$ and $K_{2}$ externally and the circle $K$ internally.
5. Solution. Let $Q$ be the center of the desired circle, and $q$ be its radius.

Case 1. The center $O$ does not lie inside the desired circle (Fig. 1).

![](https://cdn.mathpix.com/cropped/2024_05_06_11915f146f5dec4069c7g-3.jpg?height=539&width=497&top_left_y=370&top_left_x=745)

Fig 1

From the equality of triangles $O_{1} O Q$ and $Q O O_{2}$ and the condition of the problem, it follows that $\angle O_{1} O Q = \angle O_{2} O Q = 60^{\circ}$.

Consider triangle $O O_{1} Q$. Write the cosine theorem:

$(r+q)^{2} = (R-r)^{2} + (R-q)^{2} - 2(R-r)(R-q) \cos 60^{\circ}$.

From this, we find: $q = \frac{R(R-r)}{R+3r}$.

Case 2. The center $O$ lies inside the desired circle (Fig. 2).

From the equality of triangles $O_{1} O Q$ and $Q_{2}$ and the condition of the problem, it follows that $\angle O_{1} O Q = \angle O_{2} O Q = 120^{\circ}$.

Consider triangle $O O_{1} Q$. Write the cosine theorem:

$(r+q)^{2} = (R-r)^{2} + (R-q)^{2} - 2(R-r)(R-q) \cos 120^{\circ}$.

From this, we find: $q = \frac{3R(R-r)}{3R+r}$.

![](https://cdn.mathpix.com/cropped/2024_05_06_11915f146f5dec4069c7g-3.jpg?height=540&width=508&top_left_y=2037&top_left_x=748)

Fig 2