5. Find all solutions of the equation $|\sin 2 x-\cos x|=|| \sin 2 x|-| \cos x||$ on the interval $(-2 \pi ; 2 \pi]$. Answer: $(-2 \pi ;-\pi] \cup[0 ; \pi] \cup\left\{-\frac{\pi}{2} ; \frac{3 \pi}{2} ; 2 \pi\right\}$.
Solution.

$$
\begin{aligned}
& |\sin 2 x-\cos x|=|| \sin 2 x|-| \cos x|| \Leftrightarrow(\sin 2 x-\cos x)^{2}=(|\sin 2 x|-|\cos x|)^{2} \Leftrightarrow \\
& \Leftrightarrow \sin 2 x \cos x=|\sin 2 x| \cdot|\cos x| \Leftrightarrow \sin 2 x \cos x \geqslant 0 \Leftrightarrow \sin x \cos ^{2} x \geqslant 0 \Leftrightarrow\left[\begin{array}{c}
\cos x=0 \\
\sin x \geqslant 0
\end{array} \Leftrightarrow\right. \\
& \Leftrightarrow x \in(-2 \pi ;-\pi] \cup[0 ; \pi] \cup\left\{-\frac{\pi}{2} ; \frac{3 \pi}{2} ; 2 \pi\right\}
\end{aligned}
$$