\(tan\left(\frac{\pi}{4}\left(cosx-sinx\right)\right)=1\)
\(\Leftrightarrow\frac{\pi}{4}\left(cosx-sinx\right)=\frac{\pi}{4}+k\pi\)
\(\Leftrightarrow cosx-sinx=1+4k\)
\(\Leftrightarrow\sqrt{2}cos\left(x+\frac{\pi}{4}\right)=1+4k\)
\(\Leftrightarrow cos\left(x+\frac{\pi}{4}\right)=\frac{1+4k}{\sqrt{2}}\)
Do \(-1\le cos\left(x+\frac{\pi}{4}\right)\le1\Rightarrow-1\le\frac{1+4k}{\sqrt{2}}\le1\) \(\Rightarrow k=0\)
\(\Rightarrow cos\left(x+\frac{\pi}{4}\right)=\frac{1}{\sqrt{2}}\)
\(\Leftrightarrow\left[{}\begin{matrix}x+\frac{\pi}{4}=\frac{\pi}{4}+k2\pi\\x+\frac{\pi}{4}=-\frac{\pi}{4}+k2\pi\end{matrix}\right.\)
\(\Leftrightarrow\left[{}\begin{matrix}x=k2\pi\\x=-\frac{\pi}{2}+k2\pi\end{matrix}\right.\)