I'm trying to draw this figure:
Given:
$\omega - \odot(O,OX=R)$
$\ell \perp OX$
$\gamma = (ABE)$ is given, it has radius $r$ and it is tangent to $\ell$ at $A$ and $\omega$ at $B$.
I'm trying to find point $D$ such that $(DEC)$ is also tangent to $\omega$ (in $C$) and $\ell$ (in $D$) and $D$ is colinear to $E = (DEC) \cap (AEB)$ and $B$.
My attempt was with analytic geometry after getting stuck with the basic results you can see above.
It didn't get pretty.
Let's call $Z = \ell \cap OX$ and define $x_0 = ZO > 0$.
$AZ = d_r$, so $d_r^2 = (R+x_0)(R-x_0-2r)$
If $\rho$ is the radius of $(DEC)$ and $d_{\rho}^2 = (R+x_0)(R-x_0-2\rho)$
Let's finally call $\square = (R+x_0)(1-\frac rR) + \frac{d_r-d_{\rho}}{\rho-r}(\frac rR d_{\rho} - d_r)$
The equation that I've found that solves $\rho = f(R,r,x_0)$ is:
$(\square \cdot r \cdot (\rho-r))^2 = ((R+x_0)(d_r-d_{\rho})^2 + \square \cdot (R+x_0+r)(\rho - r))^2 + (\rho-r)^2((R+x_0)(d_r-d_{\rho}) + d_r \cdot \square)^2$
I kinda can't expand it with my notebook tho, is there any smart way to construct this image?

OP's diagram correctly indicates that $\overleftrightarrow{AB}$, $\overleftrightarrow{CD}$, and the radical axis of the smaller circles all pass through $X'$. (The first two collinearities follow from dilating the semicircle on $\overline{XX'}$ with respect to $B$ and $C$. The third is less obvious, but since OP is aware of it we'll take it as "known".)
Altering notation considerably, consider a circle with diameter $\overline{PQ}$, take $\overline{OA}\perp\overline{PQ}$ (where $O$ is not necessarily the center of the circle), and $B$ on $\overline{OA}$. Extending $\overline{PA}$ and $\overline{PB}$ gives points of tangency $A'$ and $B'$.
Define $\alpha := \angle APQ$ and $\beta := \angle BPQ$, and also $$p := |OP| \qquad q := |OQ| \qquad a := |OA|=p \tan\alpha \qquad b := |OB|=p\tan\beta \tag1$$ Coordinatizing with $O$ at the origin, we have $$P = (-p,0) \qquad Q = ( q, 0) \qquad A = (0,a)=(0,p\tan\alpha) \qquad B = (0,b)=(0,p\tan\beta) \tag2$$ Also, since $|PA'|=(p+q)\cos\alpha$ and $|PB'|=(p+q)\cos\beta$, we can write $$\begin{align} A' &= P + (p+q)\cos\alpha\;(\cos\alpha,\sin\alpha) = \frac{p}{a^2+p^2}\;(pq-a^2,a(p+q))\\[4pt] B' &= P + (p+q)\cos\beta\; (\cos\beta, \sin\beta) = \frac{p}{b^2+p^2}\;(pq-b^2,b(p+q)) \end{align} \tag3$$
Let $E$ be the intersection of $\overline{A'B}$ and the radical axis of the two circles. Conveniently, since the radical axis must pass through the midpoint of tangent segment $\overline{AB}$, we don't need to know much else about the circles (centers, radii, etc) to know the axis' equation. In fact, we don't even assume that the circles meet or that $E$ lies on either circle.
Without too much trouble, we find that $$E = \left(\frac{p(p q-a^2)}{a^2+2p^2+pq}, \frac{p (p + q)(a + b)}{a^2+2p^2+pq}\right) \tag4$$ Conveniently, the $x$-coordinate is independent of $B$. That is, all possible $E$-points lie on the line $$x = \frac{p(p q-a^2)}{a^2+2p^2+pq} \tag5$$
For OP's specific needs —where the circles do meet and $E$ does lie on both— we take $E$ to be the intersection of this auxiliary line and the $A$-circle. So, "all we need to" is provide a construction for that line; this is actually pretty easy: we exploit the extreme positions of point $B$.
Extend $\overline{OA}$ to meet the circle at $S$ and $T$. Let $M$ and $N$ be the midpoints of $\overline{AS}$ and $\overline{AT}$, and extend $\overline{PM}$ and $\overline{PN}$ to meet $\overline{A'S}$ and $\overline{A'T}$ at $M'$ and $N'$. Then $\overleftrightarrow{M'N'}$ is the auxiliary line whose intersections with the $A$-circle are candidates for OP's point $E$. (Either point will do.) From there, although this isn't shown in the figure, we can extend $\overline{A'E}$ to meet $\overleftrightarrow{OA}$ at $B$, which defines the $B$-circle. Done.