What went wrong in this u-substitution in integrating functions in terms of sine? So let's say there's this thing I want to integrate in terms of sine:
$$\int \frac{1}{1+\sin{x}}\,dx$$
Since the integrand is apparently invariant when we map $x$ to $\pi-x$, we could try setting $x = \pi-u$, and consequently $u=\pi-x$, and see what happens:
$$\frac{du}{dx}=-1$$
$$I=\int \frac{1}{1+\sin{x}}\,dx=\int \frac{1}{1+\sin{\pi-u}}\,dx \cdot\frac{-du}{dx}$$
$$=\int\frac{-1}{1+\sin{u}}\,du=-\int\frac{1}{1+\sin{u}}\,du=-I$$
Since $I=-I$, we conclude that $I=0$, so the integral is $0$.
Well, clearly this is garbage.  I don't do much calculus, so clearly there's a concept I'm terribly misinterpreting here.  Where's the error?  Should I go to sleep?  Did I eat something bad?

You're treating $I$ as if it were a number. Are you doing a definite integral, say, from $a$ to $b$? Then you have
$$\int_a^b \frac{dx}{1+\sin x} = -\int_{\pi-a}^{\pi-b} \frac{du}{1+\sin u}.$$
This doesn't look like $I=-I$ to me.
