For an even and $2\pi$ periodic function, why does $\int_{0}^{2\pi}f(x)dx = 2\int_{0}^{\pi}f(x)dx $ How does one derive the fact that $$\int_{0}^{2\pi}f(x)dx = 2\int_{0}^{\pi}f(x)dx $$ whenever $f(x)$ is an even and $2\pi$ periodic function. I do know the result that for even functions, we have $$\int_{-a}^{a}f(x)dx = 2\int_{0}^{a}f(x)dx$$
But for the case where the end points are not symmetrical wrt the origin i do not know how to do.
 A: Hint:
We have,
$$\int_{0}^{2\pi}\frac{1}{a+b\cos x}dx$$
$$=\int_{0}^{\pi} \frac{1}{a+b \cos x} dx+\int_{\pi}^{2\pi} \frac{1}{a+b \cos (x-2\pi)} dx$$
Can you see why? What happens if you let $x-2\pi=u$ on the second part?

 \begin{align} \int_{0}^{2\pi} \frac{1}{a+b\cos x}dx \ =\int_{0}^{\pi} \frac{1}{a+b\cos x}dx+\int_{\pi}^{2\pi} \frac{1}{a+b\cos x}dx \ =\int_{0}^{\pi} \frac{1}{a+b\cos x}dx+\int_{\pi}^{2\pi} \frac{1}{a+b\cos (x-2\pi)}dx \ =\int_{0}^{\pi} \frac{1}{a+b\cos x}dx+\int_{-\pi}^{0} \frac{1}{a+b\cos x} dx \ =\int_{-\pi}^{\pi} \frac{1}{a+b\cos x}dx \ =2 \int_{0}^{\pi} \frac{1}{a+b\cos x}dx \end{align}

A: For an even function $f(x)$, the statement $$\int_{0}^{2\pi}f(x)dx = 2\int_{0}^{\pi}f(x)dx$$ is not generally true. Counterexample:
$$\int_{0}^{2\pi}x^2dx = \frac{8\pi^3}{3} \ne2\int_{0}^{\pi}x^2dx = \frac{2\pi^3}{3}.$$
However, if an even function is $2\pi$ periodic, $f(x)=f(x+2\pi)$, then
$$\int_{0}^{2\pi}f(x)dx = \int_{-\pi}^{\pi}f(x)dx = 2\int_{0}^{\pi}f(x)dx.$$
A verbal argument for the first equality in the prior line is that we're still integrating over one period of the function, so the integral is invariant. You can achieve the transformation via substitutions like in Ahmed's answer.
