<s>[INST] Integration by parts $ \int \sqrt{x-x^2} dx $ I have to integrate $$ \int \sqrt{x-x^2} dx $$ 
The answer on my textbook is $ \frac 14 \left( \arcsin(\sqrt x)-(1-2x)\sqrt{x-x^2} \right) $ but I want to solve this by myself so can you please give me a clue ? :) Thank you.
 [/INST] For the real values of $\sqrt{x-x^2},$ we need $x-x^2\ge 0\implies 0\le x\le 1$
If we put $x=\sin^2t$ where $0\le t\le \frac\pi2, 1-x=\cos^2t\ge 0\implies \sqrt{1-x}=+\cos t$  and $dx=2\sin t\cos tdt$
So, $$\int\sqrt{x-x^2}dx=\int\sqrt{x(1-x)}dx$$
$$=\int\sin t\cos t2\sin t\cos tdt$$
$$=\frac12\int (\sin2t)^2dt \text{,    as }\sin2y=2\sin y\cos y$$
$$=\frac14\int (1-\cos 4t)dt  \text{,    as } \cos2y=1-2\sin^2y$$
$$=\frac14\left(t-\frac{\sin4t}4\right)+c$$
Now, $x=\sin^2t\implies \cos2t=1-2\sin^2t=1-2x$
$\implies \sin2t=+\sqrt{1-(1-2x)^2}=2\sqrt{x-x^2}$ as $\sin2t\ge 0$ as $0\le 2t\le \pi$
So, $\sin4t=2\sin2t\cos2t=2\cdot 2\sqrt{x-x^2}(1-2x)$
So, $$\int\sqrt{x-x^2}dx=\frac14\left(\arcsin \sqrt x-4(1-2x)\sqrt{x-x^2}\right)+c$$
</s>