Find $\int_0^{2\pi} \frac{1}{3 + \cos x} dx$. I have to find the integral
$$\int_0^{2\pi} \dfrac{1}{3 + \cos x} dx$$
I tried using the Weierstrass subtitution, but replacing the bounds, I get:
$$t_1 = \tan \dfrac{0}{2} = \tan 0 = 0$$
$$t_2 = \tan \dfrac{2 \pi}{2} = \tan \pi = 0$$
Resulting in the integral:
$$\int_0^0 \dfrac{1}{3 + \dfrac{1 - t^2}{1 + t^2}} \cdot \dfrac{2}{1 + t^2} dt$$
which obviously equals $0$ since the bounds are the same. Is this correct? It feels wrong.

Using the identity
$$\frac{1}{a+b\cos t}=\frac{1}{\sqrt{a^2-b^2}}+\frac{2}{\sqrt{a^2-b^2}}\sum_{n=1}^{\infty}\left(\frac{\sqrt{a^2-b^2}-a}{b}\right)^n\cos{(nt)},\  a>b$$
we have 
$$\frac{1}{3+\cos x}=\frac{1}{\sqrt{8}}+\frac{1}{\sqrt{2}}\sum_{n=1}^{\infty}\left(\sqrt{8}-3\right)^n\cos{(nx)}$$
giving us 
$$\int_0^{2\pi}\frac{1}{3+\cos x}\ dx=\frac{1}{\sqrt{8}}\int_0^{2\pi}\ dx+\frac{1}{\sqrt{2}}\sum_{n=1}^{\infty}\left(\sqrt{8}-3\right)^n\underbrace{\int_0^{2\pi}\cos{(nx)}\ dx}_{0}=\frac{\pi}{\sqrt{2}}$$
