Euler substitution inconsistency in evaluating $\int_{-1}^1 \frac{\mathrm dx}{\sqrt{1-x}+2+\sqrt{1+x}}$ 
$$I = \int_{-1}^1 \frac{\mathrm dx}{\sqrt{1-x}+2+\sqrt{1+x}} = 4\sqrt2-2-\pi$$

Euler's substitutions immediately come to mind. But as is, the integrand is free of $\sqrt{ax^2+bx+c}$ (with $a\neq0$). So, I considered rewriting the integrand as
$$\frac{1}{\sqrt{1-x}+2+\sqrt{1+x}} = \dfrac{-\sqrt{1-x}+2-\sqrt{1+x}}{-(1-x)-2\sqrt{1-x^2}+4-(1+x)} = \frac{\sqrt{1-x}-2+\sqrt{1+x}}{2\sqrt{1-x^2}-2}$$
That is, if the denominator is $a+b+c$, I multiplied by $-a+b-c$. Now I can set up the second Euler substitution:
$$\sqrt{1-x^2} = xt-1 \implies 1-x^2 = x^2t^2-2xt+1 \implies x=\frac{2t}{t^2+1}$$
Then $\mathrm dx = \frac{2(1-t^2)}{(1+t^2)^2}\,\mathrm dt$. The integration range remains unchanged.
In terms of $t$, the square roots are
$$\begin{cases}\sqrt{1-x^2} = xt-1 = \frac{2t^2}{1+t^2}-1 = \frac{t^2-1}{1+t^2} & \color{red}{(1)}\\[1ex] \sqrt{1\pm x} = \sqrt{1\pm\frac{2t}{1+t^2}} = \frac{|t\pm1|}{\sqrt{1+t^2}}\end{cases}$$
Since $|t|<1$, we have $|t+1|=t+1$ and $|t-1|=1-t$. In the integral,
$$\begin{align}
I &= \frac12 \int_{-1}^1 \frac{\sqrt{1-x}-2+\sqrt{1+x}}{\sqrt{1-x^2}-1} \,\mathrm dx \\[1ex]
&= \int_{-1}^1 \frac{1-t^2}{1+t^2} - \frac{1-t^2}{(1+t^2)^{3/2}}\,\mathrm dt
\end{align}$$
But this leads to a different value of $-2-2\sqrt2+\pi+2\sinh^{-1}(1)$.
It seems the problem lies within the substitution:
$$\sqrt{1-x^2} = \sqrt{1-\frac{4t^2}{(t^2+1)^2}} = \sqrt{\frac{(t^2-1)^2}{(t^2+1)^2}} = \frac{|t^2-1|}{t^2+1} = \frac{1-t^2}{t^2+1} \quad \color{red}{(2)}$$
since $|t|<1$. But shouldn't $\color{red}{(1)}$ and $\color{red}{(2)}$ be in agreement?

Using instead $\sqrt{1-x^2} = xt\color{red}{+}1$ is indeed the correct move, as this ensures $xt+1\ge0$ for $(x,t)\in[-1,1]^2$. Then
$$\begin{cases}x = -\frac{2t}{1+t^2} \implies \mathrm dx = -\frac{2(1-t^2)}{(1+t^2)^2}\\\\ \sqrt{1-x^2} = \frac{1-t^2}{1+t^2} \\\\ \sqrt{1\pm x} = \frac{1\mp t}{\sqrt{1+t^2}}\end{cases}$$
The integral then reduces drastically to
$$\int_{-1}^1 \left(\frac1{t^2(1+t^2)} - \frac1{t^2(1+t^2)^{3/2}} - \frac1{1+t^2} + \frac1{(1+t^2)^{3/2}}\right) \,\mathrm dt$$
and subsequent evaluation yields the correct value, $4\sqrt2-2-\pi$.
