How do you calculate $$\int^{5\pi/2}_{0} \frac{dx}{2+\cos x}$$
I tried all available substitutions including tangent half angle, but all these substitutions do not distinguish between $\pi/2$ and $5\pi/2$. I tried splitting up the integral into two parts, with one part from 0 to $2\pi$, but again this had problems as $0$ and $2\pi$ were basically "the same".
I eventually managed to find the correct answer by drawing a graph and using properties of sine/cosine, but is there any elegant elementary technique to solve this integral?
Also, I tried using complex numbers but that made the integral even more messy.
Thanks for all your help!
Substitute (Weierstrass):
$$t=\tan\frac x2\implies \cos x=\frac{1-t^2}{1+t^2}\;,\;\;dx=\frac2{1+t^2}dt\implies$$
by the period of $\;\cos x\;$ (and also of $\;\tan x\;$ , in fact), we get
$$\int_0^{5\pi/2}=\int_0^{\pi}\frac{dx}{2+\cos x}+\int_{\pi}^{2\pi}\frac{dx}{2+\cos x}+\int_{2\pi}^{5\pi/2}\frac{dx}{2+\cos x}=$$
$$=\int_0^\infty\frac{2dt}{(1+t^2)\left(2+\frac{1-t^2}{1+t^2}\right)}+\int_{-\infty}^0\frac{2dt}{(1+t^2)\left(2+\frac{1-t^2}{1+t^2}\right)}+\int_0^{1}\frac{2dt}{(1+t^2)\left(2+\frac{1-t^2}{1+t^2}\right)}=$$
$$=2\int_{-\infty}^\infty\frac{dt}{3+t^2}+2\int_0^1\frac{dt}{3+t^2}=\frac2{\sqrt3}\left(\int_{-\infty}^\infty\frac{\frac1{\sqrt3}dt}{1+\left(\frac t{\sqrt3}\right)^2}\right)+\frac2{\sqrt3}\left(\int_0^1\frac{\frac1{\sqrt3}dt}{1+\left(\frac t{\sqrt3}\right)^2}\right)=$$
$$=\left.\frac2{\sqrt 3}\arctan\frac t{\sqrt3}\right|_{-\infty}^\infty+\left.\frac2{\sqrt 3}\arctan\frac t{\sqrt3}\right|_0^1=\frac2{\sqrt3}\left(\pi+\frac\pi6\right)=\frac{7\pi}{3\sqrt3}$$