Let's say I want to integrate the following $$\int \frac{x}{\sqrt{1-x^2}}dx$$
I make the substitution $u^2 = 1-x^2$
$$\begin{align} \int \frac{x}{\sqrt{1-x^2}}dx &= -\int \frac{u}{\sqrt{u^2}}du \\ &= -\int \frac{u}{|u|}du \\ &= \begin{cases}-\int du \ \ \ \ \ \ \ \ \ \ \ \text{ if } \ u> 0\\ \\ \int u du \ \ \ \ \ \text{ if } \ u< 0\end{cases}\\ &= \begin{cases}-u + C \ \ \ \ \ \ \ \ \text{ if } \ u> 0\\ \\ u + C \ \ \ \ \ \text{ if } \ u< 0\end{cases} \\ &= \begin{cases}-\sqrt{1-x^2} + C \ \ \ \text{ if } \ u> 0 \ \ (1)\\ \\ \sqrt{1-x^2} + C\ \ \ \ \ \text{ if } \ u< 0 \ \ (2)\end{cases} \end{align}$$
But only $(1)$ is valid, and $(2)$ is incorrect. Have I introduced an extraneous integral by making the surjective substitution $u^2 = 1- x^2$? Similar to how $x=2 \not\iff x^2 = 4$
As a last side question, do $u$-Substitutions only work if the function being substituted is injective or bijective?
As $u^2=1-x^2$ where $u$ is real, $\implies1-x^2\ge0\iff x^2\le1\iff-1\le x\le1$
if $u\ge0, u=+\sqrt{1-x^2}$
Else $u=-\sqrt{1-x^2}$
Start with $u=+\sqrt{1-x^2}$ to avoid sign confusion