\(\Leftrightarrow sinx-cosx=cos2x-sin2x\)
\(\Leftrightarrow\sqrt{2}sin\left(x-\frac{\pi}{4}\right)=\sqrt{2}cos\left(2x+\frac{\pi}{4}\right)\)
\(\Leftrightarrow sin\left(x-\frac{\pi}{4}\right)=sin\left(\frac{\pi}{4}-2x\right)\)
\(\Rightarrow\left[{}\begin{matrix}x-\frac{\pi}{4}=\frac{\pi}{4}-2x+k2\pi\\x-\frac{\pi}{4}=\frac{3\pi}{4}+2x+k2\pi\end{matrix}\right.\)
\(\Rightarrow\left[{}\begin{matrix}x=\frac{\pi}{6}+\frac{k2\pi}{3}\\x=-\pi+k2\pi\end{matrix}\right.\)