Why are we allowed to make trig substitutions when solving integrals? I was taught that integrals involving
$$\sqrt {a^2-x^2} \qquad \sqrt {a^2+x^2} \qquad \sqrt {x^2-a^2}$$
where $a$ is a constant can be solved by substituting various trig functions for $x$, allowing us to eventually get rid of the radical. What I was wondering is, why are we allowed to do this? On a second note, doesn't the fact that $\sin \theta$ has a range of $[-1, 1]$ mean that letting $x = a \sin \theta$ restricts $x$ to $[-a, a]$, whereas that may not necessarily be the case for the original function we're integrating?
 A: In a hand wavy sense, it works because of the pythagorean rules for trig functions. So in the words of David Mermin "Shut up and calculate".
More to what you asked, any x outside the $\pm a$ range is complex, so having a trig substitution function that is "bounded" is totally appropriate. If you're doing complex integration, have bounds greater than $\pm a$, then you can extend the values for inverse trig functions, obviously they will involve complex numbers. Much how we extend square roots to negative inputs.
A: OK, after reading Theophile's enlightening comment (and some more experience with integration), I get it. For every $\theta$, there is a corresponding $x$, and for all $x$ there is at least one corresponding $\theta$. So there's one mind-blowingly simple point that has to be understood in order to make the trig substitution method possible/plausible:
(1) $x$ is a function of $\theta$.
(2) In other words: $x$ is $f(\theta)$.
If you define $f(\theta)$ in such a way that this is true, then you are free to substitute $f(\theta)$ for $x$.
