# Prove that $f(x)=\sin x+\sqrt{3} \cos x$ has maximum value at $x=\frac{\pi}{6}$.

Given: $f(x)=\sin x+\sqrt{3} \cos x$

To prove: the given function has maximum value at $x=\frac{\pi}{6}$

Explanation: given $f(x)=\sin x+\sqrt{3} \cos x$

While calculating the first derivative we get,

$\mathrm{f}^{\prime}(\mathrm{x})=\frac{\mathrm{d}(\sin \mathrm{x})}{\mathrm{dx}}+\frac{\mathrm{d}(\sqrt{3} \cos \mathrm{x})}{\mathrm{d} \mathrm{x}}$

Then putting the derivative, we get

$f'(x) = cos x- \sqrt 3sin x$

Critical point ca be calculated by equating the derivative with 0,

$f'(x) = 0$

$\Rightarrow cos x- \sqrt 3sin x =0 \Rightarrow \sqrt 3sin x = cos x$
$\\ \Rightarrow \frac{\sin x}{\cos x}=\frac{1}{\sqrt{3}} \\\Rightarrow \tan x=\frac{1}{\sqrt{3}} \\x=\frac{\pi}{6}$
This is possible only when
The second derivative if the c=function can be calculated by,
$\mathrm{f}^{\prime \prime}(\mathrm{x})=\frac{\mathrm{d}(\cos \mathrm{x})}{\mathrm{dx}}-\sqrt{3} \frac{\mathrm{d}(\sin \mathrm{x})}{\mathrm{dx}}$
Putting the value of derivative, we get
$\\ f^{\prime \prime}(x)=-\sin x-\sqrt{3} \cos x$
Then, we will substitute $\\x=\frac{\pi}{6}$ in the above equation, we get
$\\ f^{\prime \prime}(x)=-\sin x-\sqrt{3} \cos x \\f^{\prime}\left(\frac{\pi}{6}\right)=-\sin \frac{\pi}{6}-\sqrt{3} \cos \frac{\pi}{6}$

Putting the corresponding value, we get

$\\ \mathrm{f}^{\prime}\left(\frac{\pi}{6}\right)=-\frac{1}{2}-\sqrt{3} \times \frac{\sqrt{3}}{2} \\ \mathrm{f}^{\prime}\left(\frac{\pi}{6}\right)=-\frac{1}{2}-\frac{3}{2} \\ \mathrm{f}^{\prime}\left(\frac{\pi}{6}\right)=-2<0$

Hence f(x) has a maximum value at $x=\frac{\pi}{6}$.

Hence proved.