How to integrate $\frac{1}{3+\sin x+\cos x}$ I can easily do it with $\tan {\frac{x}{2}}$ substitution, but my problem requires $x\in(0,2\pi)$.
$\int \frac{1}{3+\sin x+\cos x}dx, x\in(0,2\pi)$
How do i solve it now ?

Take $\sin x=2t/(1+t^2), \cos x=(1-t^2)/(1+t^2), tan(x/2)=t \implies 2 \sec^2(x/2) dx=dt$. Then
$$I=\int \frac{dx}{3+\sin x+ \cos x}=\frac{1}{4}\int \frac{dt}{t^2+t+2}=\frac{1}{4}\int \frac{dt}{(t+1/2)^2+7/4}==\frac{1}{2\sqrt{7}} \tan^{-1} \frac{2t+1}{\sqrt{7}}+C.$$
where $t=\tan(x/2)$.
