Evaluate $\int^{2\pi}_{0}\frac{\mathrm{d}x}{(\cos x+\sin x+\sqrt{3})^2}=2\sqrt{3}\pi.$ The problem is to evaluate the following definite integral:
$$\int^{2\pi}_{0}\frac{\mathrm{d}x}{(\cos x+\sin x+\sqrt{3})^2}=2\sqrt{3}\pi.$$
I have failed in almost every way I tried, with the exception of substitution by $\tan(\frac{x}{2})$ which leads to the integration of a rational function with annoying coefficients.
Is there any "good" way to address the problem, given that the result doesn't seem that complicated? I've also tried this website, but the result it gave was far from satisfactory. Please help.
 A: Let$$R(x,y)=\frac1{\left(x+y+\sqrt3\right)^2};$$then you want to compute $\int_0^{2\pi}R(\cos\theta,\sin\theta)\,\mathrm d\theta$. Define\begin{align}f(z)&=\frac1zR\left(\frac{z+1/z}2,\frac{z-1/z}{2i}\right)\\&=\frac{2iz}{\left(z^2+(1+i)\sqrt3z+i\right)^2}\\&=\frac{2iz}{\bigl((z-\alpha)(z-\beta)\bigr)^2},\end{align}with$$\alpha=\left(\frac12-\frac{\sqrt3}2\right)(1+i)\quad\text{and}\quad\beta=-\left(\frac12+\frac{\sqrt3}2\right)(1+i).$$Then\begin{align}\int_0^{2\pi}R(\cos\theta,\sin\theta)\,\mathrm d\theta&=\frac1i\int_{|z|=1}f(z)\,\mathrm dz\\&=2\pi\operatorname{res}_{z=\alpha}\bigl(f(z)\bigr)\\&=2\pi\sqrt3.\end{align}
A: Note
$$ I(a)=\int_0^\pi \frac{dt}{(\cos t+a)^2} =
-\frac d{da}\int_0^\pi \frac{dt}{\cos t+a}
=-\frac d{da} \frac\pi{\sqrt{a^2-1}}=\frac{\pi a}{(a^2-1)^{3/2}}
$$
and apply it to
\begin{align} \int^{2\pi}_{0}\frac{\mathrm{d}x}{(\cos x+\sin x+\sqrt{3})^2}
&= \int^{2\pi}_{0}\frac{\mathrm{d}x}{(\sqrt2\cos (x-\frac\pi4)+\sqrt{3})^2}\\
&= \int^{\pi}_{0}\frac{\mathrm{d}t}{(\cos t+\sqrt{\frac32})^2}
 =I\left(\sqrt{\frac32}\right)=2\sqrt3\pi
\end{align}
A: I would use the following identities:
$$\sin 2\theta\equiv\frac{2\tan \theta}{1+\tan^2 \theta}$$
$$\cos 2\theta\equiv\frac{1-\tan^2 \theta}{1+\tan^2 \theta}$$
And in your question then use the substitution $t=\tan \frac{x}{2}$, as you did.
Persevere and it should work.
