Why can't I use trig substitution for this integral? $
\int \frac x {\sqrt {1-x^2}}dx
$
I was attempting to solve this integral, and it would appear the solution to it is $-\sqrt{1 -x^2}+C$. When I attempted to solve it, however, I attempted to let $x = \sin\theta$, making $dx=\cos{\theta}d{\theta}$
$
\int \frac {\sin\theta} {\cos^2\theta}\cos\theta{d\theta} = \int \tan \theta d\theta = \ln|\sec\theta| + C = \ln{\frac 1 {\sqrt {1 - x^2}}}+C = -{\frac 1 2}\ln|1-x^2|+C
$
I don't quite understand why this is incorrect. Now, I do understand that what I had to do to get the correct solution is to let $u=\sqrt {1-x^2}$, and everything else works out. But can someone explain where I went wrong with my attempt?

Method 1
Let $x=\sin \theta$, where $-\frac{\pi}{2} \leqslant \theta \leqslant \frac{\pi}{2}, $ then
\begin{aligned}
I &=\int \frac{\cos \theta d \theta}{\sqrt{1-\sin ^{2} \theta}} \\
&=\int \frac{\sin \theta \cos \theta d \theta}{\sqrt{\cos ^{2} \theta}} 
\end{aligned}
$\text {Since } \cos \theta \geqslant 0 \text { for }-\frac{\pi}{2} \leqslant \theta \leqslant \frac{\pi}{2}$,$
\textrm{  therefore }\sqrt{\cos ^{2} \theta}=|\cos \theta|=\cos \theta.$
\begin{aligned}
I &=\int \frac{\sin \theta \cos \theta d \theta}{\cos \theta} \\
&=\int \sin \theta d \theta \\
&=-\cos \theta+C_1\\
&=-\sqrt{1-\sin ^{2} \theta}+C_1. \\
&=-\sqrt{1-x^{2}}+C_1.
\end{aligned}
Method 2
Let $y=x^{2}$, fhen $d y=2 x d x.$
$$
\begin{aligned}
I &=\frac{1}{2} \int \frac{1}{\sqrt{1-y}} d y \\
&=-\sqrt{1-y}+C_2\\&=-\sqrt{1-x^{2}}+C_2
\end{aligned}
$$
Method 3
Let $y=\sqrt{1-x^{2}}$, fin $y^{2}=1-x^{2}$ and $y d y=-x d x.$
$$
\begin{aligned}
I &=-\int \frac{y d y}{y} \\
&=-\int 1 d y \\
&=-y+C_{3} \\
&=-\sqrt{1-x^{2}}+C_{3}
\end{aligned}
$$
Wish it helps.
