Suppose I am trying to find the absolute maximum of: $f(x) = x + \sin(x)$
on the interval $[0,4].$
- $f(0) = 0 $
- $f(\pi) = \pi$
- $f(4) = 4 + \sin(4)$
My professor taught us how to rationalize that $f(4) > f(\pi)$. However, I cannot remember what he said. How do I rationalize this, given that I do not have a calculator available?
Note that $f'(x)=1+\cos(x)\ge 0$. Thus, the function is monotonically increasing (i.e. for every $x\le y$, we have $f(x)\le f(y)$). If we check $f'(\pi)$, we see $f'(\pi)=0$, so it may not be strictly increasing at $\pi$, but notice that at all values other than odd integer multiples of $\pi$, we have $f'(x)>0$, so $f$ is strictly increasing everywhere else. Thus, $f(4)>f(\pi)$ because $f'(x)>0$ on the interval $(\pi,4]$.
Edit: To see that $\pi$ is not a maximum, you can also use the second derivative test. Note that $f''(\pi)=-\sin(\pi)=0$, and $f'''(\pi)=-\cos(\pi)=1$, so in fact the derivative of $f$ has a minimum at $\pi$. Thus, the derivative cannot be going from positive to negative, and $f$ cannot have a local maximum at $\pi$.