Artificial intelligent assistant

Minimum value of $y=\sin( 2x) - x$, where $x\in [-\frac{\pi}2,\frac{\pi}2]$ I tried applying the concept that at minima, derivative of $y$ with respect to $x$ should be zero, but realised that it fails as the domain is restricted. Rightly, upon plotting the graph, we can see that we cannot equate $\frac{\mathrm dy}{\mathrm dx}$ to be zero. Can you help me arrive at the solution in a way that doesn't require graph plotting?

The derivative test claims that _local extrema_ in the _interior_ of the domain are to be found among the zeros of the derivative; as noted above, in this case $\pm{\frac{\pi}{6}}$ are the zeros of the derivative and it is easy to see that the plus one is a local maximum and the minus one is a local minimum.

However, the boundary points need also to be checked as there the function may have an extremum without the derivative being zero, and in this case it is trivial to see that $-\frac{\pi}{2}$ is _the global minimum_ attained at $\frac{\pi}{2}$ since $\sin({2x}) \ge 0, x \in [0,\frac{\pi}{2}]$, hence $\sin({2x})-x \ge -x \ge -\frac{\pi}{2}$ there while the function is odd and for negative $x$ obviously at least $-1$ (actually the local minimum for negative $x$ is at $-\frac{\pi}{6}$ and hence it is $-\frac{\sqrt{3}}{2}+\frac{\pi}{6}=-0.34...$

xcX3v84RxoQ-4GxG32940ukFUIEgYdPy 2128bfda0d5d55f4c0feae08d7e79f84