# Finding the absolute minimum and maximum of a function

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.

• yes it is very nice advice – dato datuashvili May 28 '14 at 6:13

The absolute min/max may be attained either at interval bounds or inside intervals, at points where derivative is null. You have to check. On interval $[1,5]$, for instance, you get the following graph:

So here obviously $1$ and $5$ won't give you absolute min/max. You still have to check numerical values, though.

The local extrema are found, as you wrote, where derivative is null, i.e. $1+2\cos 2x=0$ or $x=\pm\frac\pi3+k\pi$. In $[1,5]$, that gives you only $\{\pi/3,2\pi/3,4\pi/3\}$. Now check numerical value of $f(x)$ for $x\in\{1,\pi/3,2\pi/3,4\pi/3,5\}$.

Visually, absolute minimum is obtained for $x=2\pi/3$, and absolute maximum for $x=4\pi/3$.