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?
 A: I suspect you forgot to include the sign when you substituted $\cos y$ back to get a function in terms of $x$ at the end. Here is the complete derivation.
I'm assuming that you did the substitution and integration correctly: if $x=\sin y$, then $dx = \cos y\,dy$, so we get
$$\int x\sqrt{1-x^2}\,dx = \int\sin y|\cos y|\cos y\,dy.$$
If we are in a situation where $\cos(y)\lt 0$ (e.g., if we are picking $\frac{\pi}{2}\leq x\leq \frac{3\pi}{2}$), then this would become
$$\int -\sin y\cos^2y\,dy.$$
This can be done by substitution (again), letting $u=\cos y$, $du = -\sin y\,dy$, so we get
$$\int \sin y\cos^2y\,dy = \int u^2\,du = \frac{1}{3}u^3+C.$$
Now we need to substitute back, and we get $\frac{1}{3}\cos^3y+C$.
Now, if $x=\sin y$, then $1-x^2 = \cos^2y$. That means that $|\cos y| = \sqrt{\cos^2y} = (1-x^2)^{1/2}$. Since we are assuming that $\cos y\lt 0$, this gives
$ - \cos y = (1-x^2)^{1/2}$; equivalently,
$$\cos y = -(1-x^2)^{1/2}.$$
Note the minus sign!
So substituting back we have
$$\begin{align*}
\int x\sqrt{1-x^2}\,dx &= \frac{1}{3}\cos^3y + C \\
&= \frac{1}{3}\left(-(1-x^2)^{1/2}\right)^3 + C \\
&= \frac{(-1)^3}{3}(1-x^2)^{3/2} + C\\
&= -\frac{1}{3}(1-x^2)^{3/2} + C,
\end{align*}$$
giving the same answer as you got when you assumed $\cos(y)\geq 0$.
A: 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.
A: The issue here is comparable to one that comes up a lot. The formal way of saying it would be that the substitution made needs to be bijective, however to visualise what this means observe the following:
$$\int_{-1}^1f(x)dx$$
if we make the substitution $u=x^2$ we get the following:
$$\int_1^1\qquad\text{(contents of the integral are not the point here)}$$
But what does this actually mean? You can think of it as some substitutions cannot be done, as when they are the antiderivative calculated would have to assume a new domain for it to satisfy the relationship.
Hope that makes sense
