A light inextensible string of length $a$ is threaded through a fixed smooth ring $R$. One end of the string is attached to a particle $A$ of mass $3m$. The other end of the string is attached to a particle $B$ of mass $m$. The particle $A$ hangs in equilibrium at a distance $x$ vertically below the ring. The angle between $AR$ and $BR$ is $\theta$ (see diagram). The particle $B$ moves in a horizontal circle with constant angular velocity $2\sqrt{\frac{g}{a}}$.
Show that $\cos \theta = \frac{1}{3}$ and find $x$ in terms of $a$.
What I tried:
B experiences two external forces: its weight and the inward radial acceleration. These two forces are balanced by the tension in the string. So I wrote down the following: $$T = 3mg \\ T = \sqrt{\left(\frac{mg}{\text{cos }\theta}\right)^2+\left(\frac{m\cdot a_{radial}}{\text{sin }\theta}\right)^2}$$ But when I equate the two values of T together, I'm not really able to get anywhere. You're left with three unknowns: the radius $r$, $\theta$, and $a$.
$r$ can be substituted with $(a-x)\sin \theta$, but you'd still have three unknowns.