What is the indefinite integral $\int \sqrt{1-2\sqrt{x-x^2}} \ \mathrm dx$? What is
$$\int \sqrt{1-2\sqrt{x-x^2}} \ \mathrm dx$$
I have tried substituting everything and it doesn't seem to be working. Substituting trigonometry doesn't seem to work either. 
 A: The primitive is quite hard to write down, but we can notice, by symmetry, that:
$$\int_{0}^{1}\sqrt{1-2\sqrt{x-x^2}}\,dx = 2\int_{0}^{1/2}\sqrt{1-2\sqrt{x-x^2}}\,dx = 2\int_{0}^{1/2}\sqrt{1-2\sqrt{\frac{1}{4}-x^2}}\,dx$$
hence:
$$\int_{0}^{1}\sqrt{1-2\sqrt{x-x^2}}\,dx=\int_{0}^{1}\sqrt{1-\sqrt{1-x^2}}\,dx=\int_{0}^{\pi/2}\cos\theta\sqrt{1-\cos\theta}\,d\theta$$
so:
$$\int_{0}^{1}\sqrt{1-2\sqrt{x-x^2}}\,dx = \sqrt{2}\int_{0}^{\pi/2}\cos\theta \sin\frac{\theta}{2}\,d\theta = \color{red}{\frac{2}{3}(2-\sqrt{2})}.$$
By following the same steps for the indefinite integral, we have:

$$\int_{0}^{x} \sqrt{1-2\sqrt{z-z^2}}\,dz = \frac{2}{3}+\frac{2(2x-1)\left(1-\sqrt{x-x^2}\right)}{3\sqrt{1-2\sqrt{x-x^2}}}$$

for any $x\in\left[0,\frac{1}{2}\right]$. In order to compute the integral for $x\in\left[\frac{1}{2},1\right]$ it is sufficient to notice that the integrand function is symmetric around $z=\frac{1}{2}$.
A: Since, once more, Jack D'Aurizio is much faster than myself, let us see what can be done with Taylor built at $x=0$ $$\sqrt{1-2\sqrt{x-x^2}}=1-\sqrt{x}-\frac{x}{2}-\frac{x^2}{8}-\frac{x^3}{16}-\frac{5 x^4}{128}-\frac{7
   x^5}{256}+O\left(x^{11/2}\right)$$ So, integrating $$\int_{0}^{a}\sqrt{1-2\sqrt{x-x^2}}\,dx =a-\frac{2
   a^{3/2}}{3}-\frac{a^2}{4}-\frac{a^3}{24}-\frac{a^4}{64}-\frac{a^5}{128}-\frac{7
   a^6}{1536}+O\left(a^{13/2}\right)$$ For $a=\frac 12$, this gives $\frac{14123}{32768}-\frac{1}{3 \sqrt{2}}\approx 0.195297$ which compares quite well to Jack D'Aurizio's value $(\approx 0.195262)$.
A: One could also remember that nice little formula for nested square roots:
$$\sqrt{a\pm b\sqrt{c}}=\sqrt{u}\pm\sqrt{v}$$
with 
$$u=\frac{a+\sqrt{a^2-b^2c}}{2}\quad v=\frac{a-\sqrt{a^2-b^2c}}{2}$$
In our case $a=1$, $b=2$, $c=x-x^2$ and the sign is minus.
So
$$a^2-b^2c=1-4x+4x^2=4\left(x-\frac12\right)^2$$
hence, if we take $x\geq 1/2$,
$$u=\dfrac{1+2x-1}{2}=x\qquad v=\dfrac{1-2x+1}{2}=1-x$$
and the opposite if $0\leq x\leq 1/2$, so
$$\sqrt{1-2\sqrt{x-x^2}}=\left\{\begin{array}{rcl}\sqrt{1-x}-\sqrt{x}&\textrm{if}& 0\leq x\leq 1/2\\
\sqrt{x}-\sqrt{1-x}&\textrm{if}&1/2\leq x\leq 1\end{array}\right.$$
Now, the integral is easy:
$$\int \sqrt{x}dx=\frac23x^{3/2}+C$$
$$\int\sqrt{1-x}dx=-\frac23(1-x)^{3/2}+C$$
As a check,
$$\int_0^{1/2}\sqrt{1-x}-\sqrt{x}dx=\frac23\left[-(1-x)^{3/2}-x^{3/2}\right]_0^{1/2}=\frac23\left(1-2\frac{1}{2\sqrt{2}}\right)=\frac{1}{3}(2-\sqrt{2})$$
