\(y=\sqrt{3}cosx-sinx=2\left(\dfrac{\sqrt{3}}{2}cosx-\dfrac{1}{2}sinx\right)=2cos\left(x+\dfrac{\pi}{6}\right)\)
Vì \(cos\left(x+\dfrac{\pi}{6}\right)\in\left[-1;1\right]\Rightarrow y=\sqrt{3}cosx-sinx\in\left[-2;2\right]\)
\(\Rightarrow y_{min}=-2\Leftrightarrow cos\left(x+\dfrac{\pi}{6}\right)=-1\Leftrightarrow x+\dfrac{\pi}{6}=\pi+k2\pi\Leftrightarrow x=\dfrac{5\pi}{6}+k2\pi\)
\(y_{max}=2\Leftrightarrow cos\left(x+\dfrac{\pi}{6}\right)=1\Leftrightarrow x+\dfrac{\pi}{6}=k2\pi\Leftrightarrow x=-\dfrac{\pi}{6}+k2\pi\)