[ Tangent circles [ Auxiliary area. The area helps to solve the task]

Two circles of radii $R$ and $r$ touch each other externally at point $A$. On the circle of radius $r$, a point $B$ diametrically opposite to point $A$ is taken, and a tangent $l$ is constructed at this point. Find the radius of the circle that is tangent to both given circles and the line $l$.
## First Method.

If the third circle touches the line $l$ at point $B$, then its radius is $r+R$.

Now let the third circle (with center $Q$ and radius $x$) touch the line $l$ at point $C$, different from point $B$. If $O_1$ and $O_2$ are the centers of the circles with radii $r$ and $R$ respectively, then the sides of triangle $O_1 O_2 Q$ are:

$$
O_1 O_2 = r + R, \quad O_1 Q = r + x, \quad O_2 Q = R + x
$$

By Heron's formula,

$$
S_{\triangle O_1 O_2 Q} = \sqrt{(I + R + \tau) \cdot I \cdot \tau \cdot R}
$$

If $Q M$ is the height of this triangle, then

$$
Q M = B C = 2 \sqrt{\tau I}, \quad S_{\triangle O_1 O_2 Q} = \frac{1}{2}(r + R) \cdot 2 \sqrt{\tau I}
$$

Solving the equation

$$
\sqrt{(I + R + \tau) I \tau R} = (r + R) \sqrt{\tau I}
$$

we find that $x = \frac{r(R + r)}{R}$.

If the third circle touches the line $l$ at point $B$, then its radius is $r + R$.

Now let the third circle with center $Q$ and radius $x$ touch the line $l$ at point $C$, different from point $B$. If $O_1$ and $O_2$ are the centers of the circles with radii $r$ and $R$ respectively, and $M$ is the projection of point $Q$ on the line $O_1 O_2$, then

$$
O_1 Q = r + x, \quad O_2 Q = R + x, \quad O_2 M = |R + 2r - x|, \quad O_1 M = x - r
$$

By the Pythagorean theorem, $O_2 Q^2 - O_2 M^2 = O_1 Q^2 - O_1 M^2$, or

$$
(R + x)^2 - (R + 2r - x)^2 = (r + x)^2 - (x - r)^2
$$

From this equation, we find that $x = \frac{r(R + r)}{R}$.

## Answer

$\frac{r(R + r)}{R}$ or $r + R$