There are a number of posts about definite integrals with non-injective u-substitutions:
- Is it always safe to assume that a integral is zero if it has equal bounds?
- How do the limits change with the substitution $u=\sin θ$
- Substitution Makes the Integral Bounds Equal
- Why does this $u$-substitution zero out my integral?
The conclusion is basically the same in each case. For some reason, I don't remember ever being warned about this situation, and I thought it must be because each time this came up, we just skipped over the part where you evaluate $u(a)$ and $u(b)$ and went straight to substituting $u(x)$ in the now integrated function. Is this what people generally do?
i.e. if a u-substitution enables us to find an anti-derivative $F(u(x))$, can we safely assume that regardless of whether or not $u(a) = u(b)$, $F(b) - F(a)$ will be the solution?
It is mostly a practical concern - in general I'm not going to remember on what intervals some function is injective, which appears to be the solution in the above questions. In none of those examples do I see the above points failing.
edit: I try add an example different from those in the above questions:
$$\int_0^{2\pi} \cos x \sin^2 x dx$$
re-arrangements using trig identities aside, the simplest approach seems to involve letting $u(x) = \sin x$, so that $F(x) = \frac{1}{3} \sin^3 x$ and $F(b) - F(a) = 0$, which in this case happens to coincide with what would have (erroneously) happened had we written
$$\int_{u(0)}^{u(2\pi)} u^2 du$$
The substitution rule/change of variables theorem says the following:
If you state the theorem like this, there is no need at all for any injectivity assumptions on $u$; this equality follows immediately from the fundamental theorem of calculus and chain rule (if $F$ is a primitive of $f$, then the LHS and RHS are equal to $F(u(\beta))-F(u(\alpha))$). The problem is that people often don't carefully specify the two functions $f$ and $u$; what ends up happening is they misapply the theorem and then impose extra conditions like injectivity (which of course doesn't hurt, but it doesn't really address the issue).
In your example, let $f(t)=t^2$ and $u(x)=\sin x$ (we can define these functions on all of $\Bbb{R}$, so there's no domain issues here at all, and all the compositions make sense etc). Then, \begin{align} \int_0^{2\pi}\sin^2x\cdot \cos x\,dx &=\int_0^{2\pi}f(u(x))\cdot u'(x)\,dx\\ &=\int_{u(0)}^{u(2\pi)}f(t)\,dt\\ &=\int_0^0t^2\,dt\\ &= 0. \end{align} This really is by a direct application of the theorem; I'm not sure why you say it is erroneous.
Of course, a corollary of the theorem I wrote above is the following:
The "advantage" of this formula is that on the LHS there is only $g$, i.e without any variable changes, and we move all the stuff involving changes of variables to the other side of the equation (so all instances of $v$ appear only on the RHS). Compare this to my first formula, where we didn't make any assumptions of injectivity, and thus as a result we have $u$ appearing on both the LHS and the RHS of the equation. The added hypothesis of injectivity is the price we pay if we want to isolate everything to one side.
Sometimes in computations, this second form of the theorem (which is really a special case of the one above) is more useful, which is why people may sometimes insist that injectivity is a must.