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?

The alternative substitution $x=\sin2t$ may be simpler
$$\begin{align}
& \hspace{5mm}\int_{-1}^1 \frac{1}{\sqrt{1-x}+2+\sqrt{1+x}} \ dx\\
& = \int_0^{\pi/4}\frac{2\cos2t}{1+\cos t}dt  =\int_0^{\pi/4}\left( \sec^2 \frac t2-8\sin^2\frac t2\right)dt = 4\sqrt2-2-\pi
\end{align}$$
