Integration by substitution gone wrong I've noticed that using integration by substitution blindly could lead to some strange results.  For example: with $u = x^2$, we might naively follow the usual procedure to find
$$
\int_{-1}^1 x^4\,dx = \int_{-1}^{1} x^3 \,x\,dx = \int_{u(-1)}^{u(1)} u^{3/2}\,du = \int_1^1 u^{3/2}\,du
 =0 
$$
The incorrect step here is writing $x = u^{1/2}$, since we would have $x = -u^{-1/2}$ over $[-1,0)$.  If we split the original integral into one over $[-1,0]$ and another over $[0,1]$, we of course get the correct answer.  However, it seems impossible to make this particular substitution in this particular problem.  Certainly, there is no function $f$ such that $\int_{u(-1)}^{u(1)}f(u)\,du$ produces the correct result.  Interestingly, this does produce the correct result if the integrand is an odd power of $x$.
In a more advanced course, one might account for this by saying that substitution will only work correctly if the substitution map is injective (one to one) over the domain of interest.  However, having been a student and teacher of integral calculus, I've never seen this addressed (in the context of intro calculus) by a teacher or textbook.  That leads me to the following questions:


*

*Why doesn't this come up more often?  Is there a conspiracy to avoid problems where this situation arises, or is this a problem that only comes up in "pathological cases"?

*Why, from a pedagogical standpoint, is this not addressed?

*Is it a coincidence that in my toy example, we get the correct answer when the integrand is $x^n$ with $n$ odd?

EDIT: So apparently, some teachers/texts do choose to address the issue, which I guess is not all that surprising.  Still, I would be interested in hearing an argument that "skipping it is not such a big deal".
Then again, perhaps that's a better question for the math-ed SE.
 A: You should take a look at Michael Spivak's Calculus, where the substitution theorem has exactly this requirement (injective substitution), and a discussion of the problem you ask about. (That discussion may take place in one or more of the many excellent problems in the integration chapter; I can't remember and don't have my copy with me.)
A: Well they are adressed. See for an example http://faculty.swosu.edu/michael.dougherty/book/chapter07.pdf. 
The easiest way to avoid this problem is to choose a bijective-substitution. Eg one that is one-to-one and has an inverse.  
A: In most cases a substitution rule is introduced for integrals of the specific form $$\int _{{a}}^{{b}}f(\varphi (t))\cdot \varphi '(t)\,{\mathrm  {d}}t$$
where $f:I \to \Bbb R$ is continuous and $\varphi: [a,b] \to I$ is continuously differentiable. 
Then it holds $$\int _{{a}}^{{b}}f(\varphi (t))\cdot \varphi '(t)\,{\mathrm  {d}}t=\int _{{\varphi (a)}}^{{\varphi (b)}}f(x)\,{\mathrm  {d}}x$$
If your integrand is $t^n$ for $n$ even you wont find $f$ and $\varphi$ s.t.
$$f(\varphi (t))\cdot \varphi '(t) = t^n$$
But if $n$ is odd you can choose $\varphi(t) = t^2$ and $f(t) = \frac{1}{2}t^\frac{n-1}{2}$ and the substitution works… so there is no need to consider integrals of your form because you cannot use subsitution rule for them because they don't satisfy the given assumptions.
A: 
with $u = x^2$, we might naively follow the usual procedure to find $$ \int_{-1}^1 x^4\,dx =\int_{-1}^{1} x^3 \,x\,dx = \int_{u(-1)}^{u(1)} u^{3/2}\,du = \int_1^1
u^{3/2}\,du  =0  $$


*

*Here's a strong version of the integration-by-substitution theorem, which does not generally require injectivity, and which the above example does not counteract:

*

*If $g'$ is integrable on $[a,b]$ and $f$ is integrable, and has an antiderivative, on $g[a,b],$ then $$\int_a^bf\big(\color{violet}{g(x)}\big)\,\color{cyan}{g'(x)}\,\mathrm{d}x=\int_{g(a)}^{g(b)}f(u)\,\mathrm{d}u.$$
Making your steps explicit to exhibit that the mistake occurs before performing any integration/substitution: $$0.4=\int_{-1}^1 x^4\,\mathrm dx\color{red}=\int^1_{-1}\left(\frac12\color{violet}{(x^2)}^{\frac32}\right)\color{cyan}{(2x)}\,\mathrm dx= \int_{g(-1)}^{g(1)} \frac12u^{3/2}\,\mathrm du=0.$$ $\color{red}{\textbf{The red (second) equality is false}}$ because \begin{align}x<0&\implies x^3\ne(x^2)^{\frac32}=-x^3\\a,b\in\mathbb Z\;\text{ and }\;x<0&\implies x^{ab}=(x^a)^b.\end{align}
$\quad$ $\quad$ $\quad$ 
The short of it is that because the integrand $x^4$ can be expressed throughout $[-1,1]$ as $f(\color{violet}{x^2})\,\color{cyan}{(2x)}$ only piecewise, it needs to be preprocessed as such for the above theorem, which is not inherently asking for injectivity, to even be applicable.


*We might well have made the same mistake while invoking the Fundamental Theorem of Calculus, then fallaciously concluded that the FTC is broken, when in fact the red equalities below are similarly false: $$\text{on }[-1,1],\;\;\frac{\mathrm d}{\mathrm dx}\left[\frac15(x^2)^{\frac52}\right]=x(x^2)^{\frac32}\color{red}=x^4,\\\therefore\;\;0.4=\int_{-1}^1x^4\,\mathrm dx\color{red}=\left[\frac15(x^2)^{\frac52}\right]_{x={-1}}^{x={1}}=0.$$
