<s>[INST] Ambiguity in Integration done by substitution. I was solving this integral $$I= \int x\sqrt{1-x^2} \mathrm dx$$ My solution is:
Let $x=\sin y$, then $|\cos y|=\sqrt{1-x^2}$ I now use method of substitution for the cases $\cos y\geq 0$ and $\cos y<0$. The correct answer is $-\frac{(1-x^2)^{3/2}}{3} +C$. I am able to obtain this answer for $\cos y\geq 0$ but in the case where $\cos y <0$, we get it to be $\frac{(1-x^2)^{3/2}}{3} +C$. Where have I gone wrong?
 [/INST] Suppose    $~~I=\int x(\sqrt{1-x^2}) dx $
Let $(1-x^2)=u ~~\Longrightarrow -2xdx=du$
$\Longrightarrow dx=\frac{-1}{2x}du $
Now we have,
$$I=\int x(\sqrt{1-x^2}) dx = \int \frac{-1}{2x}x \sqrt{u}du = \frac{-1}{2} \int\sqrt{u} du $$
$$= \frac{-1}{2} \left(\frac{u^{\frac{3}{2}}}{\frac{3}{2}} \right) +c= \frac{-u^\frac{3}{2}}{3} +c = \frac{-(1-x^2)^\frac{3}{2}}{3}+c $$
where c is integration constant.
</s>