# Finding maximum and minimum of $f(x)=x-2\cos(x)$

Finding maximum and minimum of $$f(x)=x-2\cos(x)$$

I don't know how to proceed with this problem. The first derivative is $$1+2\sin(x)$$. Set this equal $$0$$, one obtains $$x = \dfrac{7\pi}{6}+2k\pi$$ and $$x = \dfrac{11\pi}{6}+2k\pi$$. I know that maximum value of $$1+2\sin(x)=2$$ and minimum $$=-2$$

What should I do next to determine whether these values are local minimum or maximum? Graphing this function on Desmos shows that it is monotonically increasing, but how do I show this via the first derivative test?

• Take the second derivative. – John Douma Mar 31 '19 at 23:13
• @John Douma Should I insert test points? The first derivative is a periodic function, so I don't know how to determine its signs? Usually, with polynomials, you can judge the sign within each interval of maximum and minimum. In this case, I don't know how to work it out. – James Warthington Mar 31 '19 at 23:17
• This function is not monotonic. since its slope varies between $-1$ and $3$. It has infinitely many local max and min. You can use either the sign of $f'$ around them or the sign of $f''$ at the points themselves. – GReyes Mar 31 '19 at 23:18
• You take the second derivative at the points where the first derivative is $0$. This tells you the concavity which tells you whether you have a minimum or maximum. – John Douma Mar 31 '19 at 23:18
• @John Douma The second derivative is $2cos(x)$, what should I do next? Set this derivative = 0? – James Warthington Mar 31 '19 at 23:28

You have correctly found the critical points, that is, the points at which the first derivative is equal to zero. To determine the relative extrema, we have two options. We can apply the First Derivative Test or the Second Derivative Test.

First Derivative Test. Let $$f$$ be a function that is continuous on $$[a, b]$$ and differentiable on $$(a, b)$$ except possibly at a point $$c$$.
(a) If $$f'(x) > 0$$ for all $$x < c$$ and $$f'(x) < 0$$ for all $$x > c$$, then $$f$$ has a relative maximum at $$c$$.
(b) If $$f'(x) < 0$$ for all $$x < c$$ and $$f'(x) > 0$$ for all $$x > c$$, then $$f$$ has a relative minimum at $$c$$.

Second Derivative Test. If $$f$$ has a critical point $$c$$ and $$f''$$ exists in an open interval $$(a, b)$$ and
(a) if $$f''$$ is negative in $$(a, b)$$, then $$f$$ has a relative maximum at $$c$$;
(b) if $$f''$$ is positive in $$(a, b)$$, then $$f$$ has a relative minimum at $$c$$.

In this case, it is easier to apply the Second Derivative Test. We have \begin{align*} f(x) & = x - 2\cos x\\ f'(x) & = 1 + 2\sin x\\ f''(x) & = 2\cos x \end{align*} As you determined, the critical points are \begin{align*} x & = \frac{7\pi}{6} + 2k\pi, k \in \mathbb{Z}\\ x & = \frac{11\pi}{6} + 2k\pi, k \in \mathbb{Z} \end{align*} At the points $$x = \frac{7\pi}{6} + 2k\pi, k \in \mathbb{Z}$$, which lie in the third quadrant, $$f''(x) = \cos x < 0$$, so the Second Derivative Test tells us these points are relative maxima. At the points $$x = \frac{11\pi}{6} + 2k\pi, k \in \mathbb{Z}$$, which lie in the fourth quadrant, $$f''(x) = \cos x > 0$$, so the Second Derivative Test tells us these points are relative minima.

We get the same result if we apply the First Derivative Test. Since the sine function decreases from $$0$$ to $$-1$$ in the third quadrant, the first derivative $$f'(x) = 1 + 2\sin x$$ changes from positive to negative at the points $$x = \frac{7\pi}{6} + 2k\pi, k \in \mathbb{Z}$$, so the First Derivative Test tells us that these points are relative maxima. Since the sine function increases from $$-1$$ to $$0$$ in the fourth quadrant, the first derivative $$f'(x) = 1 + 2\sin x$$ changes from negative to positive at the points $$x = \frac{11\pi}{6} + 2k\pi, k \in \mathbb{Z}$$, so the First Derivative Test tells us that these points are relative minima.