TITLE: An issue with the substitution $u=\sin x$
QUESTION [5 upvotes]: I'm embarrassed to ask this question, but what's the error in the following evaluation?
$$\int_{0}^{\pi} \sin (\sin x) \ dx = \int_{0}^{0} \frac{\sin u}{\sqrt{1-u^{2}}} \ du = 0$$  
Is it that $x = \arcsin u$ only for $-\frac{\pi}{2} \le x \le \frac{\pi}{2}$?

REPLY [4 votes]: Your problem is not that $\sin x$ is not one-to-one on $0\le x\le \pi$, but that you took $\cos x$ as $\sqrt{1-\sin^2x}$ on $0\le x\le \pi$, and this is wrong because on $\pi/2\le x\le \pi$, $$\cos x=-\sqrt{1-\sin^2x}.$$