Math, how do we know if a substitution is true? For instance, in calculus we often do u-substitutions.  Quite often, we do trignometric substitutions to solve integrals.  For instance, if we have the following relation
$y=\sqrt{1-x^2}$
And we substitute $x = \sin u$, for $x \in [-1, 1]$; how do we know that our substitution is correct? If I graph $\sin u$ and $x$, it is clear these functions are very different.
How is there any relation at all? Why are we allowed to do substitutions like this?

In general, you're allowed to do substitutions whenever you're able to undo them. Precisely speaking, the substitution $$y = g(x)$$
has to be such that $g$ is a bijective function. What this means is that:


*

*Two values $x_1\neq x_2$ cannot be mapped to the same value, i.e. $f(x_1) \neq f(x_2)$.

*Every $y$ has to be the image under $f$ of a certain $x$.


Now for (definite) integrals, the same has to hold, but you need to have the additional hypothesis that $f$ is differentiable. I'll note that this is more of a sketch than anything, because we'd need to discuss the relative domains and codomains where they apply. I've skipped it to give a more concise idea.
Lets look at why your substitution is correct then (and in this case we will be obligated to consider the domain). Suppose your integral is $$\int_{-1}^1\sqrt{1-y^2} \,dy$$
Now, you say that $$y = \sin x\,, x\in\left[\frac{-\pi}{2},\frac{\pi}{2}\right)$$
I've chosen the domain where $x$ lies so that we do in fact get every $y$ in $[-1,1)$ (integration tip: it doesn't matter if we integrate in $[a,b]$ or $(a,b)$), and $\sin x$ does not repeat values here (you can verify these affirmations). Additionally, $\sin $ is differentiable, so here, the substitution is valid. 
Actually, proving that we can do this does take some effort, so it's not as if we're dealing with some very evident fact. There are theorems to prove in the process.
