Show that $\int_{0}^{2\pi} \cos^2(x) dx = \int_{0}^{2\pi} \sin^2(x) dx$ I'm trying to follow the argument in the image below, which aims to show that: $\int_0^{2\pi} \cos^2(x) dx = \int_0^{2\pi} \sin^2(x) dx$.
I believe this on an intuitive level, and I understand that it uses the periodicity of the sine and cosine functions to make the point. But, I'm stuck because the argument seems to only show that $\int_{x=0}^{x=2\pi} \cos^2(x)dx = \int_{u=0}^{u=2\pi} \sin^2(u) du$, and the variable $u$ is not the same as $x$.
Would you be able to clarify this argument?

 A: What is $\int_0^1x\,dx$? It is $\left.\frac{1}{2}x^2\right|_{x=0}^{x=1}$, which is $\frac{1}{2}(1^2)-\frac{1}{2}(0^2)$, which is $\frac{1}{2}$.
What is $\int_0^1u\,du$? It is $\left.\frac{1}{2}u^2\right|_{u=0}^{u=1}$, which is $\frac{1}{2}(1^2)-\frac{1}{2}(0^2)$, which is $\frac{1}{2}$.
Does this help you see that $\int_0^1x\,dx=\int_0^1u\,du$? And that this generalizes to $\int_a^bf(x)\,dx=\int_a^bf(u)\,du$? In particular, $\int_0^{2\pi}\sin^2(x)\,dx=\int_0^{2\pi}\sin^2(u)\,du$
In a definite integral, the variable used is irrelevant. If you actually evaluate the definite integral, you will be replacing that variable with numbers at some point, and no trace of the variable will remain.
A: As a more general fact (after you can convince yourself that dummy variables like $u$ or $x$ disappear after you do the integration), you can show that for any integers $n<m$,
$$
\int\limits_{n\frac{\pi}{2}}^{m\frac{\pi}{2}} \sin^2x\; dx = \int\limits_{n\frac{\pi}{2}}^{m\frac{\pi}{2}} \cos^2x\; dx = \frac{1}{2}\cdot(\text{the length of the interval})
$$
You can convince yourself of the first equality by looking at the graphs and seeing that any of the "quarter-areas" under $|\sin x|$ and $|\cos x|$ are equal; and the second equality follows by adding the two integrals together and using $\sin^2 x + \cos^2 x = 1$.
A: There are two ways to check the validity of the claim without changing the variable $x$:
1) Consider their difference:
$$\int_0^{2\pi} \cos^2(x) dx - \int_0^{2\pi} \sin^2(x) dx = \int_0^{2\pi} \cos 2xdx=-\frac12\sin 2x|_0^{2\pi}=0.$$
2) Use the half angle formula:
$$\begin{align}\int_0^{2\pi} \cos^2(x) dx &= \int_0^{2\pi} \frac{1+\cos 2x}{2} dx=\\
&=\int_0^{2\pi} \left(\frac{1-\cos 2x}{2}+\cos 2x\right) dx=\\
&=\int_0^{2\pi} \frac{1-\cos 2x}{2}dx+\underbrace{\int_0^{2\pi} \cos 2xdx}_{=0}=\\
&=\int_0^{2\pi} \sin^2(x) dx. \end{align}$$
