I'm trying to find the local maximum and minimum values for the equation $\displaystyle f(x)=sin2x-x, 0 < x < \pi $ but I seem to keep coming up with the wrong answer.

My working goes like this (in radians):

$\displaystyle f'(x)=2cos2x-1$

$\displaystyle f''(x)=-4sin2x$

Local maximums and minimums appear where the gradient is 0, so:

$\displaystyle 2cos2x-1=0$

$\displaystyle 2cos2x=1$

$\displaystyle cos2x=\frac{1}{2}$

$\displaystyle x=\frac{1}{6}\pi $

$\displaystyle f''(\frac{1}{6}\pi ) = -4sin\frac{1}{3}\pi = -4\times 0.866 = -3.464$

Therefore there is a local maximum at $\displaystyle x=\frac{1}{6}\pi $

What I can't work out is how to find the local minimum in the same range. I think that, because local maximums and minimums are $\displaystyle \pi$ radians apart on the Cosine graph, they will be $\displaystyle x=\frac{1}{2}\pi $ radians apart on the graph of Cos 2x, which would put the minimum point at $\displaystyle x=\frac{2}{3}\pi $ but the book I'm working from puts it at $\displaystyle x=\frac{5}{6}\pi $.