I am trying to find the number of solutions of the equation $$\sin\theta +\cos\theta=\sin2\theta $$ in the interval $[-\pi,\pi].$
Here's what I did: $$\sin\theta +\cos\theta=\sin2\theta \\ \Rightarrow (\sin\theta +\cos\theta)^2=(\sin2\theta)^2 \\ \Rightarrow1+\sin2\theta=(\sin2\theta)^2$$
Hence, we get $\sin2\theta=\frac{1\pm\sqrt{5}}{2},$ with only $\sin2\theta=\frac{1 -\sqrt{5}}{2}$ being valid. This gives four solutions in the interval $[-\pi,\pi].$
But on plotting the graph, I find that there are only two solutions.
Why are there only two solution instead of four, and how can I prevent this mistake in future?