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?


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}$$
