# Solving a system of equations with trig

How do you solve a system of the following form: $$a = 2\sin(x) - \sin(y) + \sin(x+y)\tag1$$ $$b = 2\sin(y) - \sin(x) + \sin(x+y)\tag2$$ where $$a,b$$ are constants, and $$x,y$$ the variables I'd like to solve for. Subtracting $$(1)-(2)$$ gives an expression for $$\sin(y)$$. However, rewriting $$\sin(x+y)=\sin(x)\cos(y)+\sin(y)\cos(x)$$ requires an expression for $$\cos(y)$$. Using $$\cos(y)=\sqrt{1-\sin^2(y)}$$ results in a complicated equation, which I cannot solve.

Is there an easier way to solve this system?

• What makes you think there is a nice solution to this problem? When I try, I get a sixth-degree polynomial.
– Blue
Mar 2 '19 at 11:15
• @Blue The problem is much harder than it seems! Mar 2 '19 at 11:25

You are on the right track. Subtracting $$(2)$$ from $$(1)$$ gives $$\sin x=c+\sin y$$ where $$c=\frac{a-b}3$$ and putting this into $$(1)$$ gives $$a=2c+\sin y+\sin x\cos y+\sin y\cos x$$ so $$\cos x=-1-\cos y+\frac{b+c-c\cos y}{\sin y}$$ Thus $$\small \sin^2x+\cos^2x\\=\\\small c^2+2c\sin y+\sin^2y+1+\cos^2y+\left(\frac{b+c-c\cos y}{\sin y}\right)^2+2\cos y-2\frac{b+c-c\cos y}{\sin y}-2\cos y\frac{b+c-c\cos y}{\sin y}$$ so $$\left(\frac{b+c-c\cos y}{\sin y}-1\right)^2-2\cos y\left(\frac{b+c-c\cos y}{\sin y}-1\right)+c^2+2c\sin y=0$$ giving $$\frac{b+c-c\cos y}{\sin y}-1=\frac{2\cos y\pm\sqrt{4\cos^2y-4(c^2+2c\sin y)}}2$$ and the half-angle identities give $$\frac b{\sin y}+c\tan\frac y2=2\cos^2\frac y2\pm\sqrt{1-(c+\sin y)^2}$$ I highly doubt there is an analytical solution to this, but once $$y$$ is found perhaps numerically, $$x=\sin^{-1}(c+\sin y)$$.

With a couple of rounds of squaring, one can re-write the two equations using, say, sines alone. The polynomials are degree $$6$$ in both $$\sin x$$ and $$\sin y$$. From there, the Method of Resultants (eg, invoking Mathematica's Resultant function) can eliminate one, leaving a polynomial in the other; when I try this, the final polynomial has four degree-six factors (presumably with many extraneous solutions).

Alternatively, we can convert to complex exponentials via $$\cos \theta = \frac12\left(e^{i\theta}+e^{-i\theta}\right)\qquad \sin \theta = \frac12\left(e^{i\theta} - e^{-i\theta}\right)$$ Defining $$u := e^{ix}$$ and $$v := e^{iy}$$, and noting that a comment from OP expresses $$a=3c$$ and $$b=3d$$, the equations can be written \begin{align} u^2 v^2 + 2 u^2 v - u v^2 + u - 2 v - 1 - 6 i c u v &= 0 \tag{1} \\ u^2 v^2 - u^2 v + 2 u v^2 - 2 u + v - 1 - 6 i d u v &= 0 \tag{2} \end{align} Using resultants to eliminate $$v$$ gives \begin{align} 0 &= \phantom{2}u^6 \\ &+ \phantom{2}u^5 \left(1 - 6 ci\right) \\ &- \phantom{2}u^4 \left( 1 + \phantom{1}8 c^2 - 4 c d - 4 d^2 + 12 ci \right) \\ &- 2 u^3 \left( 1 + 10 c^2 + 4 c d + 4 d^2 \right) \\ &- \phantom{2}u^2 \left( 1 + \phantom{1}8 c^2 - 4 c d - 4 d^2 - 12 ci \right) \\ &+ \phantom{2} u\phantom{^2} \left(1 + 6 ci \right) \\ &+ 1 \end{align} \tag{3} So, we still obtain a sixth-degree polynomial to solve (by numerical methods, unless there's some super-convenient relation between $$c$$ and $$d$$ that causes $$(3)$$ to factor). Of course, by $$(1)$$, each value of $$u$$ gives rise to up to two values of $$v$$; and all candidate $$u$$s and $$v$$s will have to tested for viability.

Hint: Multiplying the first equation by $$-1$$ and adding to the second equation we get $$b-a=3\sin(y)-3\sin(x)$$, solving this equation for $$y$$ we obtain $$y=-\arcsin(\frac{1}{3}a-\frac{1}{3}b-\sin(x))$$ this equation can be used to eliminate the variable $$y$$

• @drsonnhardgraubner using $$y=\arcsin(\tfrac{b}{3} - \tfrac{a}{3} + \sin(x))$$ and filling this in in $$a + b = \sin(x) + \sin(y) + 2\sin(x+y)$$ I find $$a+b =\sin(x) + \tfrac{b}{3} - \tfrac{a}{3} + \sin(x) + 2\sin(x)\cos(y)+2\sin(y)\cos(x)$$ Again using the expression for $y$ $$a+b+\tfrac{a}{3} - \tfrac{b}{3} = 2\sin(x) + 2\sin(x)\sqrt{1-(\tfrac{b}{3} - \tfrac{a}{3} + \sin(x))^2} + 2(\tfrac{b}{3} - \tfrac{a}{3} + \sin(x))\sqrt{1-\sin^2(x)}$$ Mar 2 '19 at 10:51
• @sonnhardg reordering gives $$a+b+\tfrac{a}{3} - \tfrac{b}{3} = 2\sin(x) \left( 1 + \sqrt{1-(\tfrac{b}{3} - \tfrac{a}{3} + \sin(x))^2} + \sqrt{1-\sin^2(x)} \right) + 2(\tfrac{b}{3} - \tfrac{a}{3})\sqrt{1-\sin^2(x)}$$ How can this equality be simplified to an expression in the form $$sin(x) = ...$$ Mar 2 '19 at 10:54
• To solve this equation is not easy, are values for $a,b$ given? Mar 2 '19 at 10:56
• @sonnhardg No,these values are unknown. (In fact they are given in the form $a=3c$, $b=3d$, so the left side can be reduced to $2(2c+d))$) Mar 2 '19 at 11:05

The easiest way to solve the system exists.

We can greatly reduce the degree of the equation (from 6 to 2), simply by calculating the $$cos(x+y)$$, and then apply the fundamental formula of trigonometry.

The resulting equation is:

$$9B sin(y)^{2}+6C sin(y)+F=0$$,

with

$$B=4(a-b)^{2}+9$$,

$$C=2a^{3}-6a^{2}b+6ab^{2}-9ª-2b^{3}-18b$$,

$$F=H+9s^{2}-81$$,

$$H=(a-b)^{4}$$,

$$s=a+2b$$.

The solutions of the equation are:

$$sin(y)=+\frac{-C+\sqrt{C^{2}-BF}}{3B}$$,

$$sin(y)=-\frac{+C+\sqrt{C^{2}-BF}}{3B}$$.

Choosing the first solution we have:

$$sin(x)=+\frac{-C+B(a-b)+\sqrt{C^2-BF}}{3B}$$,

$$sin(x+y)=-\frac{-C-B(a-b)+\sqrt{C^2-BF}}{3B}$$.