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?

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.