Question
Evaluate the following integral: $\int\frac{1}{2\sin (x)+3\cos (x)+1} \small{dx}$
Now, I've tried a couple of different substitutions and integrating partially but unfortunately, to no luck, I was wondering about your thoughts on it. I'd also be very thankful if someone were to have a complete answer
Thanks in advance. :)
Attempt
$$\int\frac{dx}{2\sin x+3\cos x+1}= \int\frac{dx}{2\left(\frac{2\tan\frac{x}{2}}{1+\tan^2\frac{x}{2}}\right)+3\left(\frac{1-\tan\frac{x}{2}}{1+\tan^2\frac{x}{2}}\right)+1} \\= \int\frac{dx}{\frac{4\tan\frac{x}{2}}{1+\tan^2\frac{x}{2}}+\frac{3-3\tan\frac{x}{2}}{1+\tan^2\frac{x}{2}}+1}$$
All in all I end up with $$\frac{1}{2}\int\frac{dt}{(t+\frac{1}{2})^2-(\frac{\sqrt3}{2})^2}$$ which is incorrect.
Set $x=2\arctan(1+s)$, i.e. $s=\tan(x/2)-1$, and $dx=\frac{2dt}{1+(1+s)^2}$. Then your integral becomes \begin{align} \int \frac{dx}{2\sin x+3\cos x +1}&= \int \frac{ds}{3-s^2}=\frac{1}{2\sqrt{3}}\left[\int \frac{ds}{\sqrt{3}+s}+\int \frac{ds}{\sqrt{3}-s}\right] \\ & \\ & =\frac{\ln(\sqrt{3}+s)-\ln(\sqrt{3}-s)}{2\sqrt{3}} \\ & \\ & =\frac1{2\sqrt{3}}\ln\frac{\sqrt{3}+s}{\sqrt{3}-s} =\frac1{2\sqrt{3}}\ln\frac{\sqrt{3}+\tan(x/2)-1}{\sqrt{3}-\tan(x/2)+1}, \end{align}