7. $y=\sin 2x - x$ on $x \in \left[-\frac{\pi}{2}, \frac{\pi}{2}\right]$ has the maximum value of

Translate the text above into English, please keep the original text's line breaks and format, and output the translation result directly. 

7. $y=\sin 2x - x$ on $x \in \left[-\frac{\pi}{2}, \frac{\pi}{2}\right]$ has the maximum value of
7. $\frac{\pi}{2}$, Hint: $y^{\prime}=0$. We have $x= \pm \frac{\pi}{6}$, it is only necessary to compare $f\left(\frac{\pi}{2}\right), f\left(-\frac{\pi}{2}\right), f\left(\frac{\pi}{6}\right), f\left(-\frac{\pi}{6}\right)$.