I have the following equations \begin{align*} R_1\cos(\omega T_1-\phi_{1})& =Q_1-R_2\cos(\omega T_2-\phi_{2})\\ R_1\sin(\omega T_1-\phi_{1})& =-Q_2-R_2\sin(\omega T_2-\phi_{2}). \end{align*}
From these equations how can I obtain the following solution $$\omega T_2=\pm \arccos\left(\frac{Q_1^2+Q_2^2-R_1^2+R_2^2}{2R_2\sqrt{Q_1^2+Q_1^2}}\right)-\arctan\left(\frac{Q_2}{Q_1}\right)+\phi_2+2k\pi .$$
As mentioned in the comments by @Blue the problem can be reduced into $$ a \sin \theta + b \cos \theta +c = 0 $$
to be solved for $\theta$.
The way I have dealt with this equation in the past was to split the angle into two angles $\theta = \varphi + \psi$, and expand
$$\sin \theta = \sin(\varphi+\psi) = \cos\varphi \sin\psi + \sin\varphi \cos\psi$$ $$\cos \theta = \cos(\varphi+\psi) = \cos\varphi \cos \psi - \sin\varphi \sin\psi$$
Then my equation to be solved is
$$ \Bigl( \cos\varphi ( b \cos\psi + a \sin \psi) \Bigr) + \Bigl( \sin\varphi (a \cos\psi - b \sin\psi)+c \Bigr) =0 $$
and you can set each part equal to zero individually
$$\begin{aligned} \cos\varphi ( b \cos\psi + a \sin \psi) & = 0 \\ \sin\varphi (a \cos\psi - b \sin\psi)+c & = 0 \end{aligned} $$
The first one is solved by $\boxed{\psi = -\tan^{-1} \left( \frac{b}{a} \right) + k \pi }$ which transforms the second one into
$$ \sin\varphi \sqrt{a^2+b^2}+c = 0 $$
with solution $\boxed{ \varphi = \sin^{-1}\left( \frac{c}{\sqrt{a^2+b^2}} \right) +2 k \pi}$
So all together you have
$$ \boxed{ \color{blue}{ \theta = \sin^{-1}\left( \frac{c}{\sqrt{a^2+b^2}} \right)-\tan^{-1} \left( \frac{b}{a} \right) +2 k \pi} } $$