Are there any special rules when making a substitution in an integral? Please consider the integral:
$$\int_{-a}^{a}x^2dx=\frac{2a^3}{3}$$
I would like to know why I can't make the substitution:
$$u=x^2$$
When I make the substitution, the limits of the integral will be the same, and the integral itself will be zero, which is the wrong answer. So why does this simple change of variables not work as I have expected?
Please note that I do not want help solving the integral, I know how to solve it several ways. My question is why does this specific attempt at a solution not work?
 A: This is a great question, and I find that variants are often poorly understood. Let's carry out the substitution completely. Since $a$ clearly doesn't matter, I'll suppose that $a = 1$ for simplicity.
$$ \int_{-1}^1 x^2 dx = \frac{1}{2} \int_{-1}^1 x \cdot 2x dx.$$
In this form, we substitute $u = x^2$, so that $du = 2x dx$. Then in the integral, we have
$$ \frac{1}{2} \int_{-1}^1 \underbrace{x}_{\pm\sqrt u} \cdot \underbrace{2x dx}_{du}.$$
To complete the substitution, we need to substitute $x = \pm \sqrt u$. I write $\pm$ to indicate that sometimes we have $x = \sqrt u$ and sometimes we have $x = - \sqrt u$. In particular, when $x$ is negative, we choose the negative square root, $x = - \sqrt u$. This ambiguity is very important. 
Namely, for $x$ in $[-1, 0]$, we have that $x = -\sqrt u$ and for $x$ in $[0, 1]$ we have that $x = \sqrt u$. Then to perform the substitution, we split the integral into these two intervals and handle each separately.
$$\begin{align}
\frac{1}{2} \int_{-1}^1 x \cdot 2x dx &= \frac{1}{2} \int_{-1}^0 x \cdot 2x dx + \frac{1}{2} \int_{0}^1 x \cdot 2x dx \\
&= \frac{1}{2} \int_1^0 (- \sqrt u) du + \frac{1}{2} \int_0^1 \sqrt u du \\
&= \frac{1}{2} \int_0^1 \sqrt u du + \frac{1}{2} \int_0^1 \sqrt u du \\
&= \int_0^1 \sqrt u du = \frac{2}{3} u^{3/2} \bigg|_0^1 = \frac{2}{3}. 
\end{align}$$
The exact nature of the substitution is very important. This causes some introductory texts to state that substitutions must be injective. But a careful analysis shows otherwise. $\spadesuit$
A: I like Alfred's point but I would say it slightly differently.  The $dx$ at the end is not just the “other end” of the integral delimited on the left by $\int$.  It's also not just the indicator of which variable is being integrated.  It's part of the integral itself.  In other words, we don't integrate functions $f(x)$ so much as forms $f(x)\,dx$.  
When we make a substitution, we have to substitute fully the entire form from one involving $x$ to one involving $u$.  When integrating $x^2\,dx$, if we substitute $u = x^2$, we must substitute for $dx$ in terms of $u$ and $du$.  Since $\frac{du}{dx} = 2x$, we write $du = 2x\,dx$.  Thus $dx = \frac{1}{2x}\,du = \frac{1}{2\sqrt{u}}\,du$.  So
$$
 \int x^2 \,dx = \int u \frac{1}{2\sqrt{u}}\,du = \frac{1}{2}\int \sqrt{u}\,du
$$
That's different from $\int u\,du$.  
I think you were just switching the differential from $dx$ to $du$ without substituting.  You can avoid this mistake if you remember that $dx$ and $du$ are part of the integral.
A: It´s supposed, when using substitution to evaluate a definite integral, that you reverse substitution before apply limits. As you choose to substitute $u = x^2$ and so $du = 2x dx$, you have to "adjust" the integral before perform that substitution:
$$\int_{-a}^a x^2 dx = \frac{1}{2} \int_{-a}^a \underbrace{x}_{u^{1/2}} \cdot \underbrace{2x dx}_{du} $$
As it´s planned to reverse the substitution, it´s better avoid to adjust the limits of the integral and evaluate it as an indefinite integral: 
$$\begin{align}
 \frac{1}{2}\int u^{1/2} du=\frac{1}{2}.\frac{2}{3} u^{3/2} + C=\frac{1}{3} u^{3/2} + C   
\end{align}$$
Reversing substitution, i.e. $u = x^2$, and applying limits:
$$\begin{align}
 =\frac{1}{3} {(x^2)}^{3/2}\bigg|_{-a}^a  =\frac{1}{3} x^3 \bigg|_{-a}^a =\frac{1}{3} a^3 -\frac{1}{3} {(-a)}^3 =\frac{2}{3} a^3 
\end{align}$$
