\(\cos^2x-\sin^2x=\frac{1}{2}\Rightarrow\cos^2x-\left(1-\cos^2x\right)=\frac{1}{2}\)
\(\Rightarrow2\cos^2x=\frac{3}{2}\Rightarrow\cos^2x=\frac{3}{4}\Rightarrow\orbr{\begin{cases}\cos x=\frac{\sqrt{3}}{2}\\\cos x=\frac{-\sqrt{3}}{2}\end{cases}}\)
\(\Rightarrow\orbr{\begin{cases}x=\frac{\pi}{6}+k2\pi\\x=\frac{5\pi}{6}+k2\pi\end{cases}}\)