## Is it valid to make trig substitutions on ANY indefinite integral?

Suppose we have the integral

$\int \sqrt{1-x^2}\,dx$

We can make the substitution $x = \sin \theta$, which is undoubtedly valid because the range of the substitution $-1 \leq \sin \theta \leq 1$ is the same as the domain of the integrand $-1 \leq x \leq 1$.

But what about an integrand whose domain is all real numbers? For example:

$\int x(1-x^2)\,dx$

Obviously we can integrate this without a substitution to get $(1/2) x^2 - (1/4) x^4$ but suppose we wanted to use $x = \sin \theta$. We would end up with $(1/2) x^2 - (1/4) x^4 + 1/4$, which is still correct.

But is the substitution valid? Since the range of the substitution is still $-1 \leq \sin \theta \leq 1$, which doesn't cover the domain of the integrand $x\in\mathbb{R}$.