TITLE: Does the change of variable function have to be injective?
QUESTION [10 upvotes]: Please note that I'm only interested in the one-variable case here.
The change of variables formula for integration is:
$$\int^{\phi(b)}_{\phi(a)}f(x)\ \text{d}x=
\int^b_a f(\phi(x))\phi'(x)\ \text{d}x
$$
Where $\phi$ and $f$ are sufficiently nice (I suppose $f$ has to be integrable and I think $\phi$ needs to be continuously differentiable).
However, my Analysis teacher once mentioned to me that $\phi$ has to be injective as well. But I can't find any statements of the theorem (in one variable) that include this condition. It makes sense to me that it wouldn't be necessary: thinking about Riemann sums, if $\phi$ is non-monotonic, then the subdivision will "backtrack" at some point, but since we're multiplying by the derivative, those rectangles will be negative, so it's plausible that they would cancel out in such a way that we don't "double count" that area.

REPLY [7 votes]: $\phi$ does not have to be monotonic, but $f$ should be continuous (at least then the proof is more easy).
More precisely the assumptions are the following:
$\phi : [a,b] \rightarrow \mathbb{R}$ is continuously differentiable and $f : [c,d] \rightarrow \mathbb{R}$ is continuous with $\phi([a,b]) \subset [c,d]$. 
Note that this last condition is automatic if(!) $\phi$ is monotonic and $f : [\phi(a), \phi(b)] \rightarrow \mathbb{R}$.
Now define $F : [c,d] \rightarrow \Bbb{R}, x \mapsto \int_c^x f(t) dt$. By the fundamental theorem of calculus (and because $f$ is continuous), we see that $F$ is differentiable with derivative $F' = f$.
Now $$\frac{d}{dx}F(\phi(x)) = F'(\phi(x)) \cdot \phi'(x) = f(\phi(x)) \cdot \phi'(x).$$
By the fundamental theorem of calculus again, we conclude
$$\int_a^b f(\phi(x)) \cdot \phi'(x) dx = F(\phi(b)) - F(\phi(a)) = \int_{\phi(a)}^{\phi(b)} f(x) dx.$$
Hence we do not need the monotonicity of $\phi$.
Note that we get in particular that
$$\int_a^b f(\phi(x)) \phi'(x) dx = 0$$
if $\phi(a) = \phi(b)$.