Why doesn't every integral from 0 to $2\pi$ equal zero?

the $\sin$ function is not injective on $[0 ; 2\pi]$ so you may not be able to do such a substitution. Since you cannot readily give an inverse, you may have some difficulty expressing everything in terms of $u$.

In your case, the $\cos(x)$ term that appears from the change of variable cannot be expressed only in terms of $u = \sin(x)$, so the thing you are integrating "from $0$ to $0$" is not even a function of $u$ :

$\cos(x)$ is either $+\sqrt{1-u^2}$ or $-\sqrt{1-u^2}$ where the sign depends on $x$ (and not on $u$), and so $\sin(x)dx$ is not of the form $f(\sin(x))\cos(x)dx$ for any function $f$.

To resolve this you can split the integral in three parts (splitting the interval at $\pi/2$ and $3\pi/2$) and do $3$ separate substitutions and you will obtain something true but mostly useless.

Thanks to the user @m_t_ for pointing out that in case this doesn't happen, the substitution rule is applicable.


let's do it carefully. $$ A = \int_0^{2\pi} f(x)\,dx $$ Use the substitution $u = \sin x$.

We need to compute $x$ in terms of $u$. Well, $x = \arcsin u$, but that only holds for $-\pi/2 \le x \le \pi/2$. Outside that interval, you will have other formulas for $x$ in terms of $u$.

What about computing $dx$? Either $dx = \frac{du}{\sqrt{1-u^2}}$ or $dx = \frac{-\, du}{\sqrt{1-u^2}}$, depending on whether we are in an interval where $\sin x$ is increasing or decreasing.

So your result is not as simple as you thought.


Write the integral in terms of $u=\sin(x)$. To avoid the places where $\sin(x)$ is not $1{-}1$, we need to break up the integral: $$ \begin{align} \int_0^{2\pi}f(x)\,\mathrm{d}x &=\int_0^1\frac{f(\arcsin(u))}{\sqrt{1-u^2}}\,\mathrm{d}u\\ &-\int_1^{-1}\frac{f(\pi-\arcsin(u))}{\sqrt{1-u^2}}\,\mathrm{d}u\\ &+\int_{-1}^0\frac{f(2\pi+\arcsin(u))}{\sqrt{1-u^2}}\,\mathrm{d}u\\ \end{align} $$ The minus sign in the integral from $1$ to $-1$ is because we need the negative of the square root to get the proper $\cos(x)$.

If we don't pay close attention to the mapping between $x$ and $u$, we can be lead into the fallacy that you suggest.