So, my problem is $$\int_{0}^{2\pi}\frac{1}{5-cosx}$$
If you were to substitute $t=\tan{\frac{x}{2}}$ it would equal to:
$\int_{0}^{0}\frac{1}{5-4\cdot\frac{1-t^2}{1+t^2}}\cdot\frac{2dt}{1+t^2} = \int_{0}^{0}\frac{2dt}{9t^2+1}= \frac{2}{3}\int_{0}^{0}\frac{3dt}{(3t)^2+1}=\frac{2}{3}\cdot(\arctan{3t})|_0^{0} = 0$
Sorry if I made calculation errors, integral-calculator estimates this integral to be $\frac{2\pi}{3}$ and I'm not sure what I've done wrong here.
That's just an example really, I've read some other questions here on stackexchange but I'm still having issues with substituting things that change boundaries to 0, because it doesn't really make any sense to me. I understand why the boundaries get changed and everything, but when the both suddenly amount to zero and the integral is definitely not zero I don't really know what to do..