Definite integral (Weierstrass) Definite integral of $$\int_0^{2\pi} \frac{1}{2+\cos x}$$ without using improper integral, I want to solve this without having to use $-\infty$ and $\infty$ on the integrals limits. Is that possible?
The only way I can think of solving that is by using Weierstrass. $u = \tan \frac{x}{2}$, don't you have to modify the lower and upper limits with that substitution? The only way I can think of to progress in this is to change the limits to $-\pi$ and $\pi$, but when you'll get $-\infty$ and $\infty$ upper and lower limits.
 A: Split the integral as $\int_0^{2\pi}=\int_0^{\pi}+\int_{\pi}^{2\pi}$. Do the substitution $u=x-\pi$ in the second one, and put the expressions under common denominator, and simplify. You should end up with
$$
4\int_0^{\pi}\frac{1}{4-\cos^2x}\,dx
$$
The integrand is now symmetric in $x=\pi/2$, so the integral equals
$$
8\int_0^{\pi/2}\frac{1}{4-\cos^2x}\,dx.
$$
Now, doing $t=\tan(x/2)$ gives you (or at least me) the integral
$$
16\int_0^1\frac{(t^2+1)}{3t^4+10t^2+3}\,dt,
$$
which you can do with the methods of partial fraction. The result is already mentioned in other comments/answers.
A: Another way of evaluating this integral is to use contour integration.  
Let $z=e^{i\theta}$ so that $d\theta =dz/(iz)$, $\cos \theta =\frac12 (z+z^{-1})$ where $0\le \theta \le 2\pi$, and let $C$ be the unit circle $|z|=1$.  
Then, 
$$\begin{align}
I&=\int_0^{2\pi}\frac{1}{2+\cos \theta}d\theta\\\\
&=\oint_C \frac{1}{2+\frac12(z+z^{-1})}\frac{1}{iz}dz\\\\
&=\frac{2}{i}\oint_C \frac{1}{z^2+4z+1}dz\\\\
&=\frac{2}{i}2\pi i \text{Res}\left(\frac{1}{z^2+4z+1},z=-2+\sqrt
{3}\right)\\\\
&=2\pi\sqrt{3}/3
\end{align}$$
A: Make the substutition
$x \mapsto 2\theta$
$$\int_0^\pi \frac{2\text{d}\theta}{\sin^2{\theta}+3\cos^2{\theta}}$$
The polar integral for (half) the area of an ellipse is almost of this form, but some adjustments are required before we can proceed.
Factor out the 2 and insert a factor of 3 into the numerator of the integral, and a factor of 2 into the denominator.
$$\frac{4}{3}\int_0^\pi \frac{1^2 \times \sqrt{3}^2 \, \text{d}\theta}{2(\sin^2{\theta}+3\cos^2{\theta})}$$
The polar form of an ellipse centered on the center of the ellipse with vertical semi-major axis $a$ and lateral semi-minor axis $b$ is
$$r(\theta) = \frac{ab}{\sqrt{b^2\sin^2{\theta} + a^2\cos^{\theta}}}$$
The area of the ellipse with major and minor axes $a,b$ is $πab$.
In this case, $a=\sqrt{3}, b=1$
However, in this case, the integral is a half-revolution, which is half the area of the ellipse, giving us
$$\frac{4}{3} \times \frac{\pi \times \sqrt{3} \times 1}{2} = \frac{2\pi}{\sqrt{3}}$$
