I was solving a basic equation : $\cos 3x=\cos x.$ I found a strange anomaly, which is described as follows:
If we solve this equation by using $\cos^{-1}$ function i.e as $\cos 3x =\cos x$ then, we get $3x+2n\pi=x$ or $x=-n\pi$( such $n\in \Bbb Z$) which can also be written as $x=n\pi.$ But, if we solve it in this way: $\cos 3x-\cos x =0$ or $2\cos (2x)\sin (-x)=0$ which implies either $\sin x =0$ or $\cos 2x=0.$ In the former case, $x=n\pi$ (same as earlier) and in the later case $2x=2n\pi +\frac{\pi}{2}$, where $n$ is an integer. Thus we see by solving in this method, we are getting two different solutions contrary to the previous method where we got only one set of solutions.
Why is this anomaly? I can't find the explicit reason for this. Rather, what's wrong with the first method?