Please consider the following case:
$$I = \int^1_{-1}x^2dx$$ $$u(x) = x^2 \rightarrow du = 2x\,dx$$ $$u(-1) = 1, u(1) = 1$$
So
$$I = \int^1_1\frac{u}{2\sqrt u} du = 0$$
Obviously the problem here is to only consider the positive root of u. I don't know how to consider both roots. This example is trivial but I have another example where such substitution would be really helpful:
$$I = \int^1_{-1}\frac{x^2(1 - x^2)^\frac{3}{2}}{3} - \frac{x^2(1 - x^2)^\frac{5}{2}}{5} - \frac{x^4(1 - x^2)^\frac{3}{2}}{3} dx$$
I don't want you to solve it for me using another method, I know how to use an integral solver online. My question is how to properly do the change of variable.
While it's certainly true that $du = 2x\,dx$ over the whole region of integration, it's not true that $x = \sqrt{u}$ over the region. This is only true for $x > 0$, so you can't apply it to the whole integral. Instead, you need to split it apart and use the correct transformation $x = -\sqrt{u}$ for the region $x < 0$.
In general, if your change of variables $u(x)$ has a multivalued inverse, you'll need to split the integral into the regions where each possible inverse function $x(u)$ applies.