<s>[INST] Find $\int\limits_{0}^{2\pi} \frac{1}{5-3\cos(x)} \,\,dx$ I have to find $$\int_0^{2\pi} \frac{1}{5-3\cos(x)} \,\,dx$$
I tried to do it by substitution $t = \tan(\frac{x}{2})$
Then we have that $$\cos(x) = \frac{1-t^2}{1+t^2} \quad dx = \frac{2\,dt}{1+t^2}$$ but then also limits of integration are changing so we have
$$\int\limits_{t(0)}^{t(2\pi)} \frac{1}{5 - \frac{1-t^2}{1+t^2}} \cdot \frac{2dt}{1+t^2} = \int\limits_0^0 \frac{1}{5 - \frac{1-t^2}{1+t^2}} \cdot \frac{2\,dt}{1+t^2} = 0$$
I figured out that it is not correct because $\tan(\frac{\pi}{2})$ is not defined and $t(\pi) = \tan(\frac{\pi}{2})$ and $\pi \in [0, 2\pi]$. How can I "repair" that and do it right?
 [/INST] We have
$$\dfrac1{5-3\cos(x)} = \dfrac15 \cdot \dfrac1{1-\dfrac{3\cos(x)}5} = \dfrac15 \sum_{k=0}^{\infty} \left(\dfrac35\right)^k \cos^k(x)$$
Hence, the integral becomes
$$I = \underbrace{\sum_{k=0}^{\infty} \dfrac15 \cdot \left(\dfrac35\right)^k \int_0^{2\pi} \cos^k(x)dx = \sum_{k=0}^{\infty} \dfrac15 \cdot \left(\dfrac35\right)^{2k} \int_0^{2\pi} \cos^{2k}(x)dx}_{\text{Integral of odd powers of $\cos$ over $[0,2\pi]$ vanish}}$$
From here, we have that
$$\int_0^{2\pi} \cos^{2k}(t) = 4\int_0^{\pi/2} \cos^{2k}(t) = \dfrac{\pi}{2^{2k-1}} \dbinom{2k}k$$
Further, we have
$$\sum_{k=0}^{\infty} \dbinom{2k}k x^k = \dfrac1{\sqrt{1-4x}}$$
Hence, we obtain
$$I = \dfrac{2\pi}5 \sum_{k=0}^{\infty} \dbinom{2k}k \left(\dfrac3{10}\right)^{2k} = \dfrac{2\pi}5 \cdot \dfrac1{\sqrt{1-4 \cdot 9/100}} = \dfrac{2\pi}5 \cdot \dfrac54 = \dfrac{\pi}2$$
</s>