Evaluate $\int^{2\pi}_{0}\frac{\mathrm{d}x}{(\cos x+\sin x+\sqrt{3})^2}=2\sqrt{3}\pi.$

calculusdefinite integralsintegrationtrigonometric-integrals

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.

Best Answer

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}