<s>[INST] How to solve the following trigonometrical equation? 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 .$$
 [/INST] From $$a\sin\theta+b\cos\theta+c=0,$$
$$a^2\sin^2\theta=a^2(1-\cos^2\theta)=(b\cos\theta+c)^2$$
and
$$(a^2+b^2)\cos^2\theta+2bc\cos\theta+c^2-a^2=0.$$
You solve the quadratic equation for $\cos\theta$, and $\sin\theta$ follows.
</s>