The indefinite integral $\int x^2\sqrt{1-x}\,\mathrm dx$

We carry out the details. In a comment at the end, we show a somewhat simpler way.

Let $u=\sqrt{1-x}$. Then $\dfrac{du}{dx}=-\dfrac{1}{2\sqrt{1-x}}$.

Thus $du=-\dfrac{1}{2\sqrt{1-x}}\,dx$. You left out the $dx$, which may be part of the reason you are puzzled.

So $dx=-2\sqrt{1-x} \,du=-2u\,du$.

Also, since $u^2=1-x$, we have $x=1-u^2$, and therefore $x^2=(1-u^2)^2$.

Expressing everything in terms of $u$, we get $$\int (1-u^2)^2 (u)(-2u)\,du.$$ Note that by everything, we include $dx$.

Now expand the $(1-u^2)^2$, multiply through by $2u^2$, and integrate term by term.

Remark: I would prefer to do the same substitution in the form $u^2=1-x$. Then $2u\,du=-dx$, no unpleasant square roots, less algebra. Try it, you will like it.