<s>[INST] Integration of $\int\frac{x-1}{\sqrt{1+\sqrt{1-x^2}}}dx$ Integral of $\int\frac{x-1}{\sqrt{1+\sqrt{1-x^2}}}dx$
This is the answer, but I'm not sure how to get to it...
http://www.wolframalpha.com/input/?i=Integral+of+(x-1)%2F((sqrt(1%2Bsqrt(1-x%5E2))))dx
 [/INST] $$I=\int\frac{x-1}{\sqrt{1+\sqrt{1-x^2}}}dx$$
Start from substitution $t^2=1-x^2,\quad x=\sqrt{1-t^2},\quad dx=-\frac{t}{\sqrt{1-t^2}}dt$ 
$$
I=\int\frac{t(1-\sqrt{1-t^2})}{\sqrt{1+t}\sqrt{1-t^2}}dt=\int\frac{t}{\sqrt{1+t}\sqrt{1-t^2}}dt-\int\frac{t}{\sqrt{1+t}}dt=I_1-I_2+const
$$
$I_2$ is trivial and equal to $\frac{2}{3}(t-2)\sqrt{t+1}$, $I_1 $ requires further transformation
$$
I_1=\int\frac{t}{\sqrt{1+t}\sqrt{1-t^2}}dt=\int\frac{t}{(1+t)\sqrt{1-t}}dt\\
I_1=\int\frac{1}{\sqrt{1-t}}dt-\int\frac{1}{(1+t)\sqrt{1-t}}dt
$$
First integral is trivial, second is also can be considered as a table one (alternatively use substitution $z^2=1-t$).
$$
I_1=(-2\sqrt{1-t})-\left(-\sqrt{2}\tanh^{-1}\left(\frac{1-t}{2}\right)\right)
$$
Hence,
$$
I=-2\sqrt{1-t}+\left(\sqrt{2}\tanh^{-1}\left(\frac{1-t}{2}\right)\right)-\frac{2}{3}(t-2)\sqrt{1+t}+const
$$
Or in initial variables 
$$
I=-2\sqrt{1-\sqrt{1-x^2}}+\left(\sqrt{2}\tanh^{-1}\left(\frac{1-\sqrt{1-x^2}}{2}\right)\right)-\frac{2}{3}(\sqrt{1-x^2}-2)\sqrt{1+\sqrt{1-x^2}}+const
$$
</s>