f(x) = cos2x + sin x
f’(x) = 2 cos x (–sin x) + cos x
= 2 sin x cos x + cos x
Now,
f’(x) = 0
⇒ 2 sin x cos x = cos x
⇒ cos x(2sin x – 1) = 0
⇒ sin x = 1/2 or cos x = 0
⇒ x = \(\frac{\pi}{6}\) or \(\frac{\pi}{2}\) as x ∈ [0,π]
So,
The critical points are x = \(\frac{\pi}{2}\) and x = \(\frac{\pi}{6}\) and at the end point of the interval [0,π] we have,
Thus,
We conclude that the absolute maximum value of f is 5/4 at x = \(\frac{\pi}{6}\) and absolute minimum value of f is 1 which occurs at x = 0,\(\frac{\pi}{2}\) and π