Solution (source code)

= Solution

On the specified domain $\sin x\ne0$, so multiplying by $\sin x$ is legitimate. Use the double-angle identity to find
$$
\cos x=2\sin^2x\cos x,
\qquad \cos x\,(1-2\sin^2x)=0.
$$
The first factor gives $x=\pm\pi/2$. The second gives $\sin^2x=1/2$, yielding four more values in the interval. Thus
$$
\boxed{x\in\left\{-\frac{3\pi}{4},-\frac\pi2,-\frac\pi4,
\frac\pi4,\frac\pi2,\frac{3\pi}{4}\right\}.}
$$
Every listed value has nonzero <sine> and satisfies the original equation. Dividing by $\cos x$ would incorrectly lose the two solutions $\pm\pi/2$.