\(cos^2x-sin^2x=sinx-cosx\)
\(\Leftrightarrow\left(cosx-sinx\right)\left(cosx+sinx\right)=-\left(cosx-sinx\right)\)
\(\Leftrightarrow\left[{}\begin{matrix}cosx-sinx=0\\sinx+cosx=-1\end{matrix}\right.\)
\(\Leftrightarrow\left[{}\begin{matrix}tanx=1\\sin\left(x+\dfrac{\pi}{4}\right)=-\dfrac{\sqrt{2}}{2}\end{matrix}\right.\)
\(\Rightarrow\left[{}\begin{matrix}x=\dfrac{\pi}{4}+k\pi\\x+\dfrac{\pi}{4}=-\dfrac{\pi}{4}+k2\pi\\x+\dfrac{\pi}{4}=\dfrac{5\pi}{4}+k2\pi\end{matrix}\right.\)
\(\Rightarrow\left[{}\begin{matrix}x=\dfrac{\pi}{4}+k\pi\\x=-\dfrac{\pi}{2}+k2\pi\\x=\pi+k2\pi\end{matrix}\right.\)