Với \(cos2x=0\) không phải nghiệm
Với \(cos2x\ne0\) chia cả 2 vế cho \(cos^22x\)
\(\Rightarrow\sqrt{3}tan^22x-\left(1+\sqrt{3}\right)tan2x+1=0\)
\(\Rightarrow\left[{}\begin{matrix}tan2x=1\\tan2x=\dfrac{1}{\sqrt{3}}\end{matrix}\right.\)
\(\Rightarrow\left[{}\begin{matrix}2x=\dfrac{\pi}{4}+k\pi\\2x=\dfrac{\pi}{6}+k\pi\end{matrix}\right.\)
\(\Rightarrow\left[{}\begin{matrix}x=\dfrac{\pi}{8}+\dfrac{k\pi}{2}\\x=\dfrac{\pi}{12}+\dfrac{k\pi}{2}\end{matrix}\right.\)
\(\Rightarrow\left|a-b\right|=\left|8-12\right|=4\)