The function is $$f(x)=x+\sin(2x)$$ I need to find the absolute maxima and minima of several different domains using this function. I have found that the derivative of this function is $$f'(x)=1+2\cos(2x)$$ Then, I set this derivative equal to zero and got $x=\dfrac{1}{2}\cos^{-1}(-\dfrac{1}{2})$. One of the domains was $[1,5]$ and I plugged into the x of the original function $1$, $\dfrac{1}{2}\cos^{-1}(-\dfrac{1}{2})$, $5$, and found out that $1$ was the minimum and $5$ was the maximum with the resulting values of $1.909297427$ and $4.455978889$, respectively.
The resulting value of $x=\cos^{-1}(-\dfrac{1}{2})$ was $1.913222955$. But WebAssign says that $1$ and $5$ are wrong. I have applied the same concept to solving the answers to other intervals and got them all right. What could I be possibly doing wrong? Thanks.

Periodicity of cosine means that you will have multiple possible values of $x$ that satisfy $\cos(2x)=-\frac{1}{2}$. You need to test $x = \pi (n\pm\frac{1}{3})$ for integer values of $n$ that yield $x$ in $[1,5]$.
PS: Whenever possible, you should graph your function (e.g., with Desmos) to make sure what you see agrees with what you calculate.