Find the absolute maximum and minimum values of the function $f$ given by
$f(x) = {\cos ^2}x + \sin x,x \in [0,\pi ]$
Show solutionHide solution
Ans: $f(x) = {\cos ^2}x + \sin x$
${f^\prime }(x) = 2\cos x( - \sin x) + \cos x$
$= - 2\sin x\cos x + \cos x$
${f^\prime }(x) = 0{\text{ }}$
$\Rightarrow 2\sin x\cos x = \cos x \Rightarrow \cos x(2\sin x - 1) = 0$
$\Rightarrow \sin x = \dfrac{1}{2}$ or $\cos x = 0$
$\Rightarrow x = \dfrac{\pi }{6}$, or $\dfrac{\pi }{2}$ as $x \in [0,\pi ]$
$f\left( {\dfrac{\pi }{6}} \right) = {\cos ^2}\dfrac{\pi }{6} + \sin \dfrac{\pi }{6} = {\left( {\dfrac{{\sqrt 3 }}{2}} \right)^2} + \dfrac{1}{2} = \dfrac{5}{4}$
$f(0) = {\cos ^2}0 + \sin 0 = 1 + 0 = 1$
$f(\pi ) = {\cos ^2}\pi + \sin \pi = {( - 1)^2} + 0 = 1$
$f\left( {\dfrac{\pi }{2}} \right) = {\cos ^2}\dfrac{\pi }{2} + \sin \dfrac{\pi }{2} = 0 + 1 = 1$
absolute maximum value of $f$ is $\dfrac{5}{4}$ at $x = \dfrac{\pi }{6}$
The absolute minimum value of $f$ is 1 at $x = 0,x = \dfrac{\pi }{2}$, and $\pi $.