<s>[INST] 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... ?
 [/INST] 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.
</s>