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