Suppose I want to calculate
$$\int_{0}^{2\pi} f(x) \, dx$$
for some continuous $f: \mathbb{R} \to \mathbb{R}$. Then if I make the change of variable $u = \sin x$, I get:
$$\int_{u(0)}^{u(2\pi)} f(u(x)) \cdot \, u'(x) \, dx = \int_{\sin 0}^{\sin 2\pi} f(\sin x) \, \cos x \, dx = \int_{0}^{0} f(\sin x) \, \cos x \, dx = 0.$$
Obviously, something's going wrong here -- it's not true that $\int_{0}^{2\pi} f(x) \, dx = 0$ for all $f$. But I can't seem to figure out where the flaw is! As far as I'm aware, $u = \sin x$ is a perfectly legal change of variable. Can anyone shed some light on what's going on? Any suggestions would be greatly appreciated.