# How to solve this system of trigonometric trancendental equations over the reals?

Namely,

$$\left\{x^2+2 x \sin (y)+3 \cos (y)=0,\sin ^{-1}\left(\frac{x}{2}+\sin (y)\right)=y-\frac{\pi }{3}\right\}$$ My simple-minded trial

Reduce[{x^2 + 2x Sin[y] + 3Cos[y] == 0,  ArcSin[x/2 + Sin[y]] == y - Pi/3},
{x, y}, Reals]


is unsuccessful: the command is running for hours, almost crashing my computer. The plot

ContourPlot[{x^2 + 2x Sin[y] + 3Cos[y] == 0, ArcSin[x/2 + Sin[y]] == y - Pi/3},
{x, -5, 5}, {y, 0, 2Pi}] demonstrates the only real solution. It is easy to solve it numerically with

FindRoot[{x^2 + 2x Sin[y] + 3Cos[y] == 0, ArcSin[x/2 + Sin[y]] == y - Pi/3},
{{x, 0}, {y, 1}}]

{ x->-1.40126, y->1.31812}


however I am interested in a symbolic solution. At first sight, I can't see a way to solve this quite nonstandard system under consideration by hand. Maple 2017.2 cracks it in a moment, outputting $$\left\{ x=-2\,\cos \left( \arctan \left( \sqrt {15} \right) +\pi/6 \right) -1/2\,\sqrt {15},y=\arctan \left( \sqrt {15} \right) \right\} .$$

• If you take Sin of the second equation then the system is much more tractable. – b.gates.you.know.what Sep 13 '17 at 11:55
• @b.gatessucks: But not equivalent. – user64494 Sep 13 '17 at 12:13
• Yes, true, but easy to filter a afterwards. – b.gates.you.know.what Sep 13 '17 at 12:39
• @b.gatessucks: Can you kindly elaborate your suggestion, giving an answer? – user64494 Sep 13 '17 at 12:53

This is an extension of my earlier comment. The solution of the equations, transformed as suggested by b.gatessucks, is

s = Reduce[{x^2 + 2*x*Sin[y] + 3*Cos[y] == 0,
x/2 + Sin[y] == Sin[y - Pi/3]}, {x, y}, Reals]
(* (C ∈ Integers && ((x == 1/4 (-Sqrt - Sqrt) &&
y == 2 ArcTan[Sqrt[3/5]] + 2 π C) || (x == 1/4 (-Sqrt + Sqrt) &&
y == -2 ArcTan[Sqrt[3/5]] + 2 π C))) || (C ∈ Integers && x == Sqrt &&
y == π + 2 π C) *)


Now substitute the first of the three solutions into the original equations

FullSimplify[{x^2 + 2*x*Sin[y] + 3*Cos[y] == 0,
ArcSin[x/2 + Sin[y]] == y - Pi/3} /. (s[[1, 2, 1]] // ToRules), s[[1, 1]]]
(* {True, C == 0} *)


Therefore, the C == 0 member of the first family of solutions is valid,

({x, y} /. (s[[1, 2, 1]] // ToRules) /. C -> 0)
(* {1/4 (-Sqrt - Sqrt), 2 ArcTan[Sqrt[3/5]]} *)


Doing the same with the second family of solutions, however, yields,

FullSimplify[{x^2 + 2*x*Sin[y] + 3*Cos[y] == 0,
ArcSin[x/2 + Sin[y]] == y - Pi/3} /. (s[[1, 2, 2]] // ToRules), s[[1, 1]]]
(* {True, False} *)


and similarly for the third family of solutions.

Note that the one valid solution is equivalent to that from Maple.

FullSimplify[({x, y} /. (s[[1, 2, 1]] // ToRules) /. C -> 0) ==
{-2 Cos[ArcTan[Sqrt] + Pi/6] - Sqrt/2, ArcTan[Sqrt]}]
(* True *)


Sin is defined in the whole complex plane, while ArcSin is not. Solving a system involving ArcSin makes unneccessary problems therefore it is better to use Sin instead ArcSin. Let's take a look at this:

ContourPlot[{x^2 + 2x Sin[y] + 3Cos[y] == 0, x/2 + Sin[y] == Sin[y - Pi/3]},
{x, -25, 25}, {y, -5 Pi, 5 Pi}] We can see there are infinitely many solutions, however one seems to ask about the only one solution equivalent to that observed with ContourPlot involving ArcSin. Thus we are interested in solutions -4<= x <=4 and -1 <= y - Pi/3 <= 1. We are solving the system without ArcSin (it make the problem easier) however we have to add appropriately modified restriction on variables x and y:

sol = {x, y} /. { ToRules @ Reduce[{x^2 + 2x Sin[y] + 3Cos[y] == 0,
x/2 + Sin[y] == Sin[y - Pi/3],
-4 <= x <= 4,
-1 <= y - Pi/3 <= 1},
{x, y}]}

{{1/4 (-Sqrt - Sqrt), 2 ArcTan[Sqrt[3/5]]}}

ContourPlot[{x^2 + 2 x Sin[y] + 3 Cos[y] == 0, ArcSin[x/2 + Sin[y]] == y - Pi/3},
{x, -4, 4}, {y, 0, 2 Pi},
Epilog -> {Red, PointSize[0.025], Point[sol]}, ContourStyle -> Thick,
PlotPoints -> 25, MaxRecursion -> 4, AspectRatio -> Automatic] • Thank you for your realization of the idea suggested by @b.gatesucks. Can you base your statement "So we are interested in solutions $-5\le x \le5$and $0 \le y \le 2\pi$"? You solve a different system which is not equivalent to the assigned one. AFAIKI,the original system has the unique real solution (and a lot of complex solutions). – user64494 Sep 13 '17 at 13:17
• @user64494 You are correct. Substituting the three solutions into the original equations shows that only one is valid. – bbgodfrey Sep 13 '17 at 13:23
• @bbgodfrey: The transformed system has infinite number of real solutions. The point is how to select (with Mathematica, not by hand) the only right one. – user64494 Sep 13 '17 at 13:26
• @user64494 The three solutions of the transformed equation contains C, with C an integer. Hence, there are three infinite families of solutions. Substitute each of the three solutions into the original equations to obtain {True, C == 0} for one family and {True, False} for the others. I can provide more detail, if desired. – bbgodfrey Sep 13 '17 at 13:30
• @bbgodfrey: It would be kind of you. Thanks in advance. – user64494 Sep 13 '17 at 13:35