How do I solve for $x$ in the equation : $\lvert \sin x \rvert = \lvert \cos 3x \rvert$? The exact question asked for the number of solutions to the equation in the interval $[-2\pi , 2\pi]$. 
My understanding & approach : 
$\lvert \sin x \rvert = \lvert \cos 3x \rvert$ 
$\Rightarrow \sin x = \cos 3x$     or      $\sin x = -\cos 3x$
$\Rightarrow 4x = ( 2m \pm 1 ) \dfrac{\pi}{2}$   or   $\Rightarrow  2x = (2n \pm 1 ) \dfrac{\pi}{2}$ 
But by this approach , I get only $8$ solutions after applying general rule. 
The answer says : There are $24$ solutions.

$$|a|=|b| \to \pm a=\pm b \to a^2=b^2$$hence
$$|\sin x|=|\cos 3x|\\ \sin^2x=\cos^23x $$wen know $$\sin^2a=\frac{1-\cos2a}{2},\cos^2a=\frac{1+\cos2a}{2}$$ so 
$$\frac{1-\cos2x}{2}=\frac{1+\cos6x}{2}\\-\cos(2x)=\cos(6x)\\ \cos(2x+\pi)=\cos (6x)\\6x=\pm(2x+\pi)+2k\pi\\3x=\pm(x+\frac{\pi}{2})+k\pi $$
$$3x=(x+\frac{\pi}{2})+k\pi \to 2x=\frac{\pi}{2}+k\pi \\x=\frac{\pi}{4}+k\frac{\pi}{2} \to -2\pi \leq \-frac{\pi}{4}+k\frac{\pi}{2} \leq 2\pi \\-8 \leq 1+2k \leq 8 \to k=-4,-3,-2,-1,0,1,2,3$$there is 8 solution
$$3x=-x-\frac{\pi}{2}+k\pi\\x=\frac{-\pi}{8}+\frac{k\pi}{4} \\ 
-2\pi \leq \frac{-\pi}{8}+\frac{k\pi}{4} \leq 2\pi\\-7.5 \leq k \leq 8.5 \to k=-7,-6,...,0,1,...,7,8$$there is 16 solution
8+16 =24 solution overall
