Evaluating $ \int {\frac{1}{2+\sqrt{1-x}+\sqrt{1+x}}}\mathrm dx $ I would like to evaluate: $$ \int {\frac{1}{2+\sqrt{1-x}+\sqrt{1+x}}}\mathrm dx $$
$$ \frac{1}{2+\sqrt{1-x}+\sqrt{1+x}}=\frac{\sqrt{1-x}+\sqrt{1+x}-2}{2(\sqrt{1-x^2}-1)} $$
The substitution $ x \rightarrow \sin(x) $ or $ \cos(x) $ can only simplify the denominator, and $ x \rightarrow \sqrt{1+x}$ or $ \sqrt{1-x} $ is also useless...
Can you help me find a useful substitution?
$$ x=\cos(2t) $$
$$  \int {\frac{1}{2+\sqrt{1-x}+\sqrt{1+x}}}\mathrm dx=-\int {\frac{\sqrt{2}\sin(t)\cos(t)}{\sqrt{2}+\sin(t)+\cos(t)}}\mathrm dt $$
$$ u=\tan(t/2) $$
$$ -4\sqrt{2}\int \frac{u(1-u^2)}{(1+u^2)^2((\sqrt{2}-1)u^2+2u+1+\sqrt{2})}\mathrm du $$
But now it looks even more complicated... ?
 A: Would it help you greatly if you transform the integrand to
$$\frac{2-(x+2) \sqrt{1-x}+(x-2) \sqrt{1+x}+2 \sqrt{1-x^2}}{2 x^2}?$$
A: The method posted by Sasha and J.M. (are they both the same thing?) should do it, but just for fun, let's try another.
$$
\begin{align}
u & = \sqrt{1-x} \\
u^2 & = 1-x \\
2u\;du & -dx \\
2-u^2 & = 1+x
\end{align}
$$
$$
\int \frac{dx}{2 + \sqrt{1-x} + \sqrt{1+x}} = \int \frac{-2u\;du}{2+u + \sqrt{2-u^2}}.
$$
Now write
$$
u = \sqrt{2}\sin\theta,\quad du = \sqrt{2}\cos\theta\;d\theta,
$$
and we get
$$
\int\frac{-2\sqrt{2}\sin\theta\cos\theta\;d\theta}{2 + \sqrt{2}\sin\theta+\sqrt{2}\cos\theta} = \int\frac{-2\sin\theta\cos\theta\;d\theta}{\sqrt{2}+\sin\theta+\cos\theta}.
$$
Finally, a tangent half-angle substitution reduces this to an integral of a rational function, and then one can use partial fractions if necessary.
A: Integral=
$$\int\frac{dx}{2+\sqrt{1-x}+\sqrt{1+x}}$$
$$=\int\frac{\sqrt{1-x}-\sqrt{1+x}}{(2+\sqrt{1-x}+\sqrt{1+x})(\sqrt{1-x}-\sqrt{1+x})}dx$$
Substitution:
$z=2+\sqrt{1-x}+\sqrt{1+x} $
$$dz=\frac{\sqrt{1-x}-\sqrt{1+x}}{2\sqrt{1-x^2}}dx $$
$\sqrt{1-x^2}=(1/2)(z^2-4z+2)$
$\sqrt{1-x}-\sqrt{1+x}=\sqrt{4z-z^2}$
Integral=
$$=\int\frac{z^2-4z+2}{z\sqrt{4z-z^2}}dz$$
$$=\int\frac{z-4}{\sqrt{4z-z^2}}dz+\int\frac{2dz}{z\sqrt{4z-z^2}}$$
$$=\int\frac{-(1/2)(-2z+4)}{\sqrt{4z-z^2}}dz-\int\frac{2dz}{\sqrt{4z-z^2}}+\int\frac{2dz}{z\sqrt{4z-z^2}}$$
For the third integral you may use the substitution $z=1/t$
We have,Integral
$$=-\sqrt{4z-z^2}-4\sin^{-1}\frac{\sqrt{z}}{2}-\sqrt{\frac{4-z}{z}}+C$$
Where $z=2+\sqrt{1-x}+\sqrt{1+x}$
A: Let $w_+ = \sqrt{1+x}$ and $w_- = \sqrt{1-x}$. Then 
$$ 
\begin{eqnarray}
  \frac{1}{2+w_+ + w_-} &=& \frac{(2 - w_+ + w_- )(2 + w_+ - w_- )(2 - w_+ - w_- )}{(2 + w_+ + w_- )(2 - w_+ + w_- )(2 + w_+ - w_- )(2 - w_+ - w_- )} \\ &=& \frac{4 w_- w_+ - 2 x w_- - 4 w_- +2  x w_+ - 4 w_+ + 4}{4 x^2}
\end{eqnarray}
$$
This can now be integrate term-wise.
A: $$\newcommand{\ct}[0]{\color{grey}{\text{constant}}}
\newcommand{\b}[1]{\left(#1\right)}
\begin{align}
\int {\frac{1}{2+\sqrt{1-x}+\sqrt{1+x}}}dx&=\int\frac{-2\sin(2t)}{2+\sqrt2\sin t+\sqrt2\cos t}dt\tag{1}\\
&=-2\int\frac{\sin(2t)}{2+2\sin\b{t+\frac{\pi}4}}dt\\
&=-2\int\frac{\sin(2t)}{2+2\cos\b{\frac{\pi}4-t}}dt\\
&=-\frac12\int\sin(2t)\sec^2\b{\frac{\pi}8-\frac t2}dt\\
&=\int\sin(2\b{\pi/4-2u})\sec^2(u)du\tag{2}\\
&=\int\cos(4u)\sec^2(u)du\\
&=\cos(4u)\tan(u)+4\int\sin(4u)\tan(u)du\tag{3}\\
\int\sin(4u)\tan(u)du&=\int(2\cos(2u)-\cos(4u)-1)du\tag{4}\\
&=\sin(2u)-\frac14\sin(4u)-u+\ct\\
&=\sin\b{\frac{\pi}4-t}-\frac14\cos(2t)+\frac t2+\ct\\
&=\frac1{\sqrt2}\b{\sin(t)-\cos(t)}-\frac14\cos(2t)+\frac t2+\ct\\
&=\frac12\b{\sqrt{1-x}-\sqrt{1+x}}-\frac14x+\frac 14\arccos(x)+\ct\\
\cos(4u)\tan(u)&=\sin(2t)\tan\b{\pi/8-t/2}\\&=\sin(2t)\sqrt{\frac{1-\cos(\pi/4-t)}{1+\cos(\pi/4-t)}}\\&=\sin(2t)\sqrt{\frac{1-\sin(t+\pi/4)}{1+\sin(t+\pi/4)}}\\&=\sqrt{1-x^2}\sqrt{\frac{\sqrt2-\sqrt{1-x}-\sqrt{1+x}}{\sqrt2+\sqrt{1-x}+\sqrt{1+x}}}
\end{align}$$
So:
$$\large\int \frac{1}{2+\sqrt{1-x}+\sqrt{1+x}}dx=\sqrt{1-x^2}\sqrt{\frac{\sqrt2-\sqrt{1-x}-\sqrt{1+x}}{\sqrt2+\sqrt{1-x}+\sqrt{1+x}}}+2\sqrt{1-x}-2\sqrt{1+x}-x+\arccos(x)+\color{grey}{\rm constant}$$

$(1)$ let $x=\cos(2t)\mid dx=-2\sin(2t)$
$(2)$ let $u=\pi/8-t/2\iff t=\pi/4-2u\mid dt=-2du$
$(3)$ use integration by parts
$(4)$ use $$\begin{align}\sin(4u)\tan(u)&=2\sin(2u)\cos(2u)\tan(u)\\&=4\sin^2(u)\cos(2u)\\&=2\cos(2u)(1-\cos(2u))\\&=2\cos(2u)-2\cos^2(2u)\\&=2\cos(2u)-\cos(4u)-1\end{align}$$
A: Just to give a complete answer using the method of the square. Using the easily proved equation
$$\left ( \sqrt{1+x} + \sqrt{1-x} \right )^2 = 2\left ( 1+ \sqrt{1-x^2} \right )$$
one can get 
\begin{align*} 
\int_{-1}^{1} \frac{\mathrm{d}x}{\sqrt{1+x} + \sqrt{1-x} + 2} &= \int_{-1}^{1} \frac{\mathrm{d}x}{\sqrt{2\left (1+\sqrt{1-x^2} \right )}+2} \\ 
&\!\!\!\!\!\overset{x = \sin u}{=\! =\! =\! =\! =\!} \int_{-\pi/2}^{\pi/2} \frac{\cos u}{\sqrt{2\left ( 1+\cos u \right )}+2}\, \mathrm{d}u\\ 
&=\int_{-\pi/2}^{\pi/2} \frac{\cos u}{\sqrt{4 \cos^2 \frac{u}{2}}+2} \, \mathrm{d}u \\ 
&= \int_{-\pi/2}^{\pi/2} \frac{\cos u}{2 \cos \frac{u}{2} + 2} \, \mathrm{d} u \\ 
&= \frac{1}{2} \int_{-\pi/2}^{\pi/2} \frac{\cos u}{1+ \cos \frac{u}{2}} \, \mathrm{d}u \\ &= \frac{1}{4} \int_{-\pi/2}^{\pi/2} \frac{\cos u}{\cos^2 \frac{u}{4}} \, \mathrm{d}u \\ &= {\require{cancel}\cancelto{0}{\frac{1}{4} \left [ 4 \tan \frac{u}{4} \cos u \right ]_{-\pi/2}^{\pi/2}}} + \int_{-\pi/2}^{\pi/2} \tan \frac{u}{4} \sin u \, \mathrm{d}u \end{align*}
The last integral can be dealt as follows:
\begin{align*} 
\int_{-\pi/2}^{\pi/2} \tan \frac{u}{4} \sin u \, \mathrm{d}u \;  &\overset{y=u/4}{=\! =\! =\! =\!} \;  4 \int_{-\pi/8}^{\pi/8} \tan y \sin 4y \, \mathrm{d}y\\ 
&=4 \int_{-\pi/8}^{\pi/8} \tan y \left ( 4 \sin y \cos^3 y - 4 \sin^3 y \cos y \right )\, \mathrm{d}y \\ 
&=4 \int_{-\pi/8}^{\pi/8} \left ( 4 \sin^2 y \cos^2 y - 4 \sin^4 y \right )\, \mathrm{d}y \\ 
&= 16 \int_{-\pi/8}^{\pi/8} \left ( \sin y \cos y \right )^2 \, \mathrm{d} y - 16 \int_{-\pi/8}^{\pi/8} \sin^4 y \, \mathrm{d}y \\ 
&= \left (\frac{\pi}{2} - 1 \right ) + \left (-1 + 4 \sqrt{2} - \frac{3\pi}{2} \right ) \\ 
&= 4\sqrt{2} - \pi - 2 
\end{align*}
Basically as in @RE60K's answer. The results arise in view of the identities:
$$\sin^4 x = \frac{1}{8} \left ( 3 + \cos 4x - 4 \cos 2x \right )$$
and
\begin{align*} 
\int_{-\pi/8}^{\pi/8} \sin^2 x \cos^2 x \, \mathrm{d}x &= \int_{-\pi/8}^{\pi/8} \left ( \sin x \cos x \right )^2 \, \mathrm{d} x\\ 
&=\int_{-\pi/8}^{\pi/8} \left ( \frac{\sin 2x}{2} \right )^2 \, \mathrm{d}x\\ 
&= \frac{1}{4} \int_{-\pi/8}^{\pi/8} \sin^2 2x \, \mathrm{d}x\\ 
&=\frac{1}{8}\int_{-\pi/8}^{\pi/8} \left ( 1- \cos 4x \right ) \, \mathrm{d}x \\ 
&= \frac{1}{8} \left ( \frac{\pi}{4} - \frac{1}{2} \right ) \\
&= \frac{\pi}{32} - \frac{1}{16}
\end{align*}
I know I'm 9 years late but I wanted to present the method of squares.
