<s>[INST] How to solve $\sin(x) = \pm a$ for $a \not = 0$? I was solving the below equation: $\left|\sqrt{2\sin^2x  + 18 \cos^2x} - \sqrt{2\cos^2x  + 18 \sin^2x} \right| = 1$ for $x \in [0, 2\pi]$.
My attempt:
$$\begin{align}&\left|\sqrt{2\sin^2x  + 18 \cos^2x} - \sqrt{2\cos^2x  + 18 \sin^2x} \right| = 1\\\implies& \left|\sqrt{2\sin^2x  + 2 \cos^2x + 16\cos^2x} - \sqrt{2\cos^2x  + 2 \sin^2x + 16\sin^2x} \right| = 1
\\\implies& \left|\sqrt{2(\sin^2x  + \cos^2x) + 16\cos^2x} - \sqrt{2(\cos^2x  +  \sin^2x) + 16\sin^2x} \right| = 1
\\\implies& \left|\sqrt{2+ 16\cos^2x} - \sqrt{2 + 16\sin^2x} \right| = 1\end{align}$$
Squaring both sides,
$$\begin{align}\implies& (2+ 16\cos^2x) + (2 + 16\sin^2x) - 2\sqrt{(2+ 16\cos^2x) (2 + 16\sin^2x)} = 1
\\\implies& 4 + 16(\sin^2x + \cos^2x) - 2\sqrt{2\cdot 2 \cdot (1+ 8\cos^2x) (1+ 8\sin^2x)} = 1
\\\implies &20 - 4\sqrt{1+8\cos^2x + 8\sin^2x + 8^2 \sin^2x \cos^2x } = 1
\\\implies &19 = 4\sqrt{1+8(\cos^2x + \sin^2x) + 16 \cdot (2\sin x \cos x)^2 }
\\\implies &\frac{19}{4} = \sqrt{9 + 16 \cdot (2\sin x \cos x)^2 }
\\\implies &\frac{19}{4} = \sqrt{9 + 16 \sin^2(2x) }\end{align}$$
Again squaring both sides,
$$\begin{align}\implies& \frac{361}{16} = 9 + 16 \sin^2(2x)
\\\implies& \frac{361}{16} - 9 =  16 \sin^2(2x)
\\\implies &\frac{361 - 144}{16} =  16 \sin^2(2x)
\\\implies& \frac{217}{256} =  \sin^2(2x)
\\\implies& \pm\frac{\sqrt{217}}{16} =  \sin(2x)\end{align}$$

Now I'm not getting any way to solve this equation. Although the question states to find only the solutions in the interval $[0, 2\pi]$, can we find the general form for all the solutions in $\mathbb{R}$ i.e. for all real numbers?
Desmos shows that there are $8$ solutions over the interval $[0, 2\pi]$.
 [/INST] In order to solve $\sin(x)=a$; such that $a\in[-1,1]$ and $x\in [-\pi/2,\pi/2]$, one can use the $\arcsin$ function indeed for all $a\in[-1,1]$, $\arcsin(a)=x$ where $x\in[-\pi/2,\pi/2]$, in order to find all solutions one can use the periodicity of $\sin$, note that as long as $a\in [-1,1]$ there will be an infinite amount of solutions in $\mathbb{R}$. Note that there is no algebraic way to solve this in general since $\sin$ is a transcendental function.
</s>