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: $$|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
A: Count the solutions carefully.
You have:
$$4x = (2m \pm 1) \frac\pi2 \qquad \text{or} \qquad  2x = (2n \pm 1) \frac\pi2.$$
You do not need the $\pm$ signs; $+$ would be sufficient, 
because $2m - 1 = 2(m - 1) + 1$.
Moreover, we can divide by $4$ (or by $2$) to get just $x$ on the left, so
$$x = (2m + 1) \frac\pi8 = \frac\pi8 + m\frac\pi4
 \qquad \text{or} \qquad 
 x = (2n + 1) \frac\pi4 = \frac\pi4 + n\frac\pi2.$$
That is, any odd multiple of $\frac\pi8$ is a solution, and so is any odd multiple of $\frac\pi4.$ 
You are supposed to find solutions in the interval $[-2\pi, 2\pi].$
The odd multiples of $\frac\pi8$ in that interval are
$-15\frac\pi8, -13\frac\pi8, \ldots, 15\frac\pi8.$
That is, you have solutions of the form $\frac\pi8 + m\frac\pi4$
for $m = -8, -7, \ldots, 7.$ There are $16$ of these.
You also have solutions of the form $\frac\pi4 + m\frac\pi2$
for $m = -4, -3, \ldots, 3.$ There are $8$ of these, and none of them
matches any of the first $16$ solutions.
