Trigonometry equation solution I have to solve this equation for all solutions
$$\sin(2x) = -\cos(2x)$$
Here are my steps
$$\sin(2x) + \cos(2x) = 0$$
$$\cos(2x)(\tan(2x) + 1) = 0$$
Upon solving these two equations, I find:
For cosine, $x = \frac{\pi}{4} + \pi n$
For both, $x = \frac{3 \pi}{8} + \pi n$
For both, $x = \frac{7 \pi}{8} + \pi n$
Where n is an integer.
The problem is that the first solution is incorrect, because
$$\sin\left(2\times\frac{\pi}{4}\right) + \cos\left(2\times\frac{\pi}{4}\right) = 1 + 0 = 1$$
But,
$$\cos\left(2 \times \frac{\pi}{4}\right) = 0$$
I know this solution is invalid, but why? Why, upon factorization, did one of the solutions give me an incorrect answer?  Shouldn't it also be correct, mathematically speaking, because when expanding the equation I get $\sin(2x) = -\cos(2x)$

Note that $\;\tan 2x = \frac{\sin 2x}{\cos 2x}\;$ is undefined when $\cos 2x = 0$, i.e., when $x = \pi/4 + k\pi$, so it cannot be a solution to either the original or factored equation.
