Evaluate the following integrals:
$\int \frac{1}{\sin x+\sqrt{3} \cos x} d x$
Given $I=\int \frac{1}{\sin x+\sqrt{3} \cos x} d x$
We know that $\sin \mathrm{X}=\frac{2 \tan \frac{\mathrm{x}}{2}}{1+\tan \frac{2}{2}}$ and $\cos \mathrm{X}=\frac{1-\tan ^{2} \frac{\mathrm{X}}{2}}{1+\tan ^{2} \frac{2}{2}}$
$\Rightarrow \int \frac{1}{\sin x+\sqrt{3} \cos x} d x=\int \frac{1}{\frac{2 \tan \frac{x}{2}}{1+\tan ^{2} \frac{x}{2}}+\sqrt{3}\left(\frac{1-\tan 2 \frac{x}{2}}{1+\tan \frac{2}{2}}\right)} d x$
$=\int \frac{1+\tan ^{2} \frac{x}{2}}{2 \tan \frac{x}{2}+\sqrt{3}-\sqrt{3} \tan ^{2} \frac{x}{2}} d x$
Replacing $1+\tan ^{2} x / 2$ in numerator by $\sec ^{2} x / 2$ and putting $\tan x / 2=t$ and $\sec ^{2} x / 2 d x=2 d t$,
$\Rightarrow \int \frac{1+\tan ^{2} \frac{x}{2}}{2 \tan \frac{x}{2}+\sqrt{3}-\sqrt{3} \tan ^{2} \frac{x}{2}} d x=\int \frac{\sec ^{2} \frac{x}{2}}{-\sqrt{3} \tan ^{2} \frac{x}{2}+2 \tan \frac{x}{2}+\sqrt{3}} d x$
$=-\int \frac{2 d t}{\sqrt{3} t^{2}-2 t-\sqrt{3}}$
$=-\frac{2}{\sqrt{3}} \int \frac{1}{\left(t-\frac{1}{\sqrt{3}}\right)^{2}-\left(\frac{2}{\sqrt{3}}\right)^{2}} d t$
$=\frac{2}{\sqrt{3}} \int \frac{1}{\left(\frac{2}{\sqrt{3}}\right)^{2}-\left(t-\frac{1}{\sqrt{3}}\right)^{2}} d t$
We know that $\int \frac{1}{\mathrm{a}^{2}-\mathrm{x}^{2}} \mathrm{dx}=\frac{1}{2 \mathrm{a}} \log \left|\frac{\mathrm{a}+\mathrm{x}}{\mathrm{a}-\mathrm{x}}\right|+\mathrm{c}$
$\Rightarrow \frac{2}{\sqrt{3}} \int \frac{1}{\left(\frac{2}{\sqrt{3}}\right)^{2}-\left(t-\frac{1}{\sqrt{3}}\right)^{2}} d t=\frac{2}{\sqrt{3}}\left(\frac{1}{2\left(\frac{2}{\sqrt{3}}\right)}\right) \log \left|\frac{\frac{2}{\sqrt{3}}+t-\frac{1}{\sqrt{3}}}{\frac{2}{\sqrt{3}}-t+\frac{1}{\sqrt{3}}}\right|+c$
$=\frac{1}{2} \log \left|\frac{\frac{2}{\sqrt{3}}+\tan \frac{x}{2}-\frac{1}{\sqrt{3}}}{\frac{2}{\sqrt{3}}-\tan \frac{x}{2}+\frac{1}{\sqrt{3}}}\right|+c$
$\therefore I=\int \frac{1}{\sin x+\sqrt{3} \cos x} d x=\frac{1}{2} \log \left|\frac{\frac{2}{\sqrt{3}}+\tan \frac{x}{2}-\frac{1}{\sqrt{3}}}{\frac{2}{\sqrt{3}}-\tan \frac{x}{2}+\frac{1}{\sqrt{3}}}\right|+c$