tricky system of trigonometric equations

Solution 1:

Let $x-y=U, z-y=V$. Then $$A\sin U+B \sin V=C$$ $$A\cos U+B \cos V=D$$ Let $\tan \frac U2=t, \tan \frac V2=w$ Then $$A \frac {2t}{1+t^2}+B\frac {2w}{1+w^2}=C$$

$$A \frac {1-t^2}{1+t^2}+B\frac {1-w^2}{1+w^2}=D$$

Solution 2:

Let $x-y=U, z-y=V$. Then $$A\sin U+B \sin V=C$$ $$A\cos U+B \cos V=D$$

Square both equations: \begin{align} A^2\sin^2 U + B^2 \sin^2 V + 2 AB \sin U \sin V&=C^2\\ A^2\cos^2 U + B^2 \cos^2 V + 2AB \cos U \cos V &=D^2 \end{align} Add to get \begin{align} A^2(\sin^2 U + \cos^2 U) + B^2 (\sin^2 V + cos^2 V) + 2 AB (\sin U \sin V + \cos U \cos V) &=C^2 + D^2\\ A^2 + B^2 + 2 AB (\sin U \sin V + \cos U \cos V) &=C^2 + D^2\\ 2 AB (\sin U \sin V + \cos U \cos V) &=C^2 + D^2 - A^2 - B^2\\ \sin U \sin V + \cos U \cos V &=\frac{C^2 + D^2 - A^2 - B^2}{2AB}\\ \cos (U-V) &=\frac{C^2 + D^2 - A^2 - B^2}{2AB}\\ (U-V) &=\cos^{-1} \frac{C^2 + D^2 - A^2 - B^2}{2AB}\\ \end{align} Since $U - V = (x-y) - (z-y) = x - z$, this gives you \begin{align} z &=x - \cos^{-1} \frac{C^2 + D^2 - A^2 - B^2}{2AB}. \end{align} Now you can plug in $z$ and $x$ in either of your first two equations to find $y$.

Of course, this all depends on $AB \ne 0$.

If either $A$ or $B$ is zero, then you can solve the first equation directly to find $U$ or $V$, and work from there.

Solution 3:

If you're not fresh at math, complex formalism may not be of much help, but for posterity:

Using $$ e^{i\theta} = \cos \theta + i\sin\theta, $$ your system can be written $$ A e^{i(x - y)} + Be^{i(z - y)} = D + iC. $$ Multiplying through by $e^{iy}$ and dividing by $D + iC$ gives $$ \frac{(A e^{ix} + Be^{iz})(D - iC)}{D^{2} + C^{2}} = e^{iy}. \tag{1} $$ Conjugating, $$ \frac{(A e^{-ix} + Be^{-iz})(D + iC)}{D^{2} + C^{2}} = e^{-iy}. \tag{2} $$ Multiplying (1) and (2) eliminates $y$: \begin{align*} 1 = e^{iy}\, e^{-iy} &= \frac{(A e^{ix} + Be^{iz})(D - iC)}{D^{2} + C^{2}}\, \frac{(A e^{-ix} + Be^{-iz})(D + iC)}{D^{2} + C^{2}} \\ &= \frac{(A e^{ix} + Be^{iz})(A e^{-ix} + Be^{-iz})}{D^{2} + C^{2}}. \end{align*} Expanding and rearranging, $$ D^{2} + C^{2} = A^{2} + B^{2} + 2AB\cos(x - z), $$ whereupon you can proceed as in John Hughes' answer.