# Find the absolute maximum and minimum values of the function $(f)$ given by $f (x) = cos^2 x + sin\: x, x\: \in [0, \pi]$

Toolbox:
• $\large\frac{d}{dx}$$(\cos x)=-\sin x • \large\frac{d}{dx}$$(\sin x)=\cos x$
• Maxima & minima$\Rightarrow f'(x)=0$
Step 1:
Let $f(x)=\cos^2x+\sin x\;\;x\in [0,\pi]$
Differentiating with respect to $x$
$f'(x)=2\cos x(-\sin x)+\cos x$
$\qquad=\cos x(-2\sin x+1)$
For maxima or minimum $f'(x)=0$
Therefore $\cos x(-2\sin x+1)=0$
$\cos x=0$ (or) $-2\sin x+1=0$
$-2\sin x=-1$
$\sin x=\large\frac{1}{2}$
$x=\large\frac{\pi}{6}$
Step 2:
Now $f(0)=\cos^20+\sin 0$
$\qquad\qquad=(1)^2+0$
$\qquad\qquad=1$
$f(\large\frac{\pi}{6})$$=\cos^2\large\frac{\pi}{6}$$+\sin\large\frac{\pi}{6}$
$\quad\;\;=\big(\large\frac{\sqrt 3}{2}\big)^2+\large\frac{1}{2}$
$\quad\;\;=\large\frac{ 3}{4}+\large\frac{1}{2}$
$\quad\;\;=\large\frac{ 3+2}{4}=\large\frac{5}{4}$
$f(\large\frac{\pi}{2})$$=\cos^2\large\frac{\pi}{2}$$+\sin\large\frac{\pi}{2}$
$\qquad=0+1=1$
$f(\pi)$$=\cos \pi$$+\sin\pi=1+0=1$
Of all these values,the maximum and minimum values of $f(x)$ are $\large\frac{5}{4}$ and 1 respectively.
So absolute maximum=$\large\frac{5}{4}$
Absolute minimum =1
edited Sep 2, 2013