<s>[INST] Integrate $\int x \sqrt{2 - \sqrt{1-x^2}}dx $ it seems that integration by parts with some relation to substitution...

$$
\int x \sqrt{2-\sqrt{1-x^2}}
= \frac{2}{5} \sqrt{2-\sqrt{1-x^2}} \cdot \sqrt{1-x^2}+\frac{8}{15}\sqrt{2-\sqrt{1-x^2}}+c
$$

How can I get that?
 [/INST] Let $x=\sqrt{1-y^2}$, then then integral becomes
$$-\int dy \, y \, \sqrt{2-y}$$
Integrate by parts:
$$\frac{2}{3}y (2-y)^{3/2} + \frac{2}{3} \int dy \, (2-y)^{3/2}$$
which is
$$\frac{2}{3}y (2-y)^{3/2} - \frac{4}{15} (2-y)^{5/2} + C$$
Therfore
$$\int dx \, x \, \sqrt{2-\sqrt{1-x^2}} = \frac{2}{3} \sqrt{1-x^2} \left ( 2-\sqrt{1-x^2}\right)^{3/2} - \frac{4}{15}\left ( 2-\sqrt{1-x^2}\right)^{5/2}+C $$
</s>