Solving the system $A\cos x +B\cos y=C$, $A\sin x + B\sin y=D$

197 Views Asked by At

It is not a school-related problem, and pretty much the title. I am looking for a way to solve the system of trigonometric equations:
$$ A\cos(x) + B\cos(y) = C \tag{1} $$ $$ A\sin(x) + B\sin(y) = D \tag{2} $$

I have already solved the system for the specific case of $A=B$ and am looking to generalize this to $A \neq B$.

For reference, my solution to the specific case $A=B$ is:

$$x = \cos^{-1}(\frac{C}{A} - \cos(\cot^{-1}(\frac{C}{D})-\cos^{-1}(\frac{D}{2A\sin(\cot(\frac{C}{D})})) \tag{3}$$

$$y = \cot(\frac{C}{D}) - \cos^{-1}(\frac{D}{2A\sin(\cot(\frac{C}{D})})) \tag{4}$$

I have been using computer software such as WolframAlpha to solve it, and they do solve it, but I've been unable to come up with a solution by hand after a couple months of working on it pretty regularly.

Can it be solved by hand?

2

There are 2 best solutions below

6
On BEST ANSWER

Move either the terms with $A$ or $B$ to the other side and square: $$B^2\cos^2y=A^2\cos^2x-2AC\cos x+C^2\\B^2\sin^2y=A^2\sin^2x-2AD\sin x+D^2$$

Now add them together: $$B^2=A^2+C^2+D^2-2AC\cos x-2AD\sin x$$

Now write $C=R\cos\phi$, $D=R\sin\phi$. So $R^2=C^2+D^2$. $$B^2-A^2-C^2-D^2=-2A\sqrt{C^2+D^2}(\cos x\cos\phi+\sin x\sin\phi)\\\cos(x-\phi)=\frac{-B^2+A^2+C^2+D^2}{2A\sqrt{C^2+D^2}}$$

We take inverse to get $x$.
Likewise , we can get $y$.

Can you take it from here?

4
On

Final edit: general solution and constraints

This answer started off as a one-liner for a special case (see rollbacks if you like), but given how long you've worked on the problem (and now me too!) here is rewrite with a general geometric solution, which also shows where @Andrei's solution comes from.

I'm going to treat $A,B,C,D$ as positive, though you could reframe things to accommodate negative values. I also presume $C \leq A+B$ otherwise the first equation cannot be true, and for geometric simplicity that $A,B \leq C$ so that we are not dealing with negative distances at any point. If we fix $A,B$ with $C$ some permissible value of $A,B \leq C \leq A+B$ then we have zero, one, or two solutions as the diagrams below indicate.

Case $A+B < \sqrt{C^2+D^2}$

No solution

enter image description here

Case $A+B = \sqrt{C^2+D^2}$

One solution, $x=y= \arctan{\frac{D}{C}}$

enter image description here

Case $A+B > \sqrt{C^2+D^2}$

Two, one, or zero solutions per diagrams below

enter image description here

enter image description here

enter image description here

In this regime, the solutions form a kite in which the diagonal $R= \sqrt{C^2+D^2}$, at an angle $\phi= \arctan{\frac{D}{C}}$, bisects the angle between solutions as $\delta$.

enter image description here

Since we have $A,B,R$ we can use the Law of Cosines to determine $\delta$:

$$B^2=A^2+R^2-2AR \cos{\delta}$$

And our solutions are $x=\phi \pm \delta$.

With a bit of rearrangement you'll find this coincides with @Andrei's answer. The virtue of this approach is it show you why the suggestions for half-angle formulas, or framing the problem symmetrically, work: it's because of the symmetry of the kite.