\(y=\sqrt{3}sin2x-cos2x=2\left(\dfrac{\sqrt{3}}{2}sin2x-\dfrac{1}{2}cos2x\right)=2sin\left(2x-\dfrac{\pi}{6}\right)\)
Do \(-1\le sin\left(2x-\dfrac{\pi}{6}\right)\le1\Rightarrow-2\le y\le2\)
\(y_{max}=2\) khi \(sin\left(2x-\dfrac{\pi}{6}\right)=1\)
\(y_{min}=-2\) khi \(sin\left(2x-\dfrac{\pi}{6}\right)=-1\)