Question:
Prove that $f(x)=\sin x+\sqrt{3} \cos x$ has maximum value at $x=\frac{\pi}{6}$.
Solution:
We have,
$f(x)=\sin x+\sqrt{3} \cos x$
$\Rightarrow f^{\prime}(x)=\cos x+\sqrt{3}(-\sin x)$
$\Rightarrow f^{\prime}(x)=\cos x-\sqrt{3} \sin x$
For $f(x)$ to have maximum or minimum value, we must have $f^{\prime}(x)=0$
$\Rightarrow \cos x-\sqrt{3} \sin x=0$
$\Rightarrow \cos x=\sqrt{3} \sin x$
$\Rightarrow \cot x=\sqrt{3}$
$\Rightarrow x=\frac{\pi}{6}$
Also, $f^{\prime \prime}(x)=-\sin x-\sqrt{3} \cos x$
$\Rightarrow f^{\prime \prime}\left(\frac{\pi}{6}\right)=-\sin \frac{\pi}{6}-\sqrt{3} \cos \frac{\pi}{6}=-\frac{1}{2}-\sqrt{3}\left(\frac{\sqrt{3}}{2}\right)=-\frac{1}{2}-\frac{3}{2}=-2<0$
So, $x=\frac{\pi}{6}$ is point of maxima.