Why do we not consider the negative case for u-substitutions involving $u^2$? In general, why don't we consider the negative case when doing $u$ substitutions that involve a $u^2$ (i.e. when subbing back in for $x$ the square root only has the positive value $+\sqrt{x}$ rather than $-\sqrt{x}$ or whatever function is being square rooted)
A simple example from my textbook:
integrate $f(x)=\int \frac{1}{1+\sqrt{x}} dx $ by substitution of $x=(u-1)^2$
through some simple substitution the textbook answers reach:
$f(x)=2(1+\sqrt{x})-2(\ln(1+\sqrt{x}))+C$
why cannot the case $f(x)=2(1-\sqrt{x})-2(\ln(1-\sqrt{x}))+C$ work in this method?
Is it just that you first define $u=1+\sqrt{x}$ rather than the substitution they give in the question, and then reach the $x(u)$ function?
I thought that it might be because $x(u)$ and $u(x)$ functions must be inverse of each other, but you can still define that inverse as the negative and it should work. Any input is appreciated, am I just missing something extremely obvious?
 A: Let $u = 1 - \sqrt{x}$.  Then $x = (u - 1)^2$, so $dx = 2(u - 1) du$.
And $\sqrt{x} = \sqrt{(u - 1)^2} = |u - 1|$.  Note that $u \le 1$, so $u - 1 \le 0$, so $|u - 1| = -(u - 1) = 1 - u$.
$$\int \frac{1}{1 + \sqrt{x}} dx$$
$$\int \frac{1}{1 + ( 1 - u)} 2(u-1) du$$
$$\int \frac{2u - 2}{2 - u} du$$
$$\int \frac{2 - 2(2 - u)}{2 - u} du$$
$$\int (\frac{2}{2 - u} - 2) du$$
$$-2 \ln{|2 - u|} - 2u + C$$
$$-2 \ln{|2 - (1 - \sqrt{x})|} - 2(1 - \sqrt{x}) + C_1$$
$$-2 \ln{|1 + \sqrt{x}|} - 2 + 2\sqrt{x} + C_1$$
$$2\sqrt{x} - 2 \ln(1 + \sqrt{x}) + C_2$$
Which is the same as your textbook gets for the $u = 1 + \sqrt{x}$ substitution, except differing by a constant (which is irrelevant anyway for indefinite integrals).
How did you get your answer?  You forgot the absolute value operators, didn't you?
A: When making a substitution of the form $x=g(u)$, it must be the case that $g$ is a differentiable one-to-one function. Thus, when we substitute $x=(u-1)^2$, it is implicit that either $u$ is always greater than $1$, or $u$ is always less than $1$. If $u>1$, then $\sqrt{x}=u-1$, and we arrive at your textbook's solution. If $u<1$, then $\sqrt{x}=1-u$, and $dx=2(u-1) \, du$, so
\begin{align}
I&=\int\frac{2(u-1)}{2-u} \, du \\[5pt]
&=-2(u+\log|u-2|)+K \\[5pt]
&=-2(1-\sqrt{x}+\log|-\sqrt{x}-1|)+K \\[5pt]
&=-2\left(1-\sqrt{x}+\log\left(1+\sqrt{x}\right)\right)+K \, , \\[5pt]
\end{align}
which is the same as the textbook's solution (set $K=C+4$).
