Evaluate $\int\frac{1}{x-\sqrt{1-x^2}}dx$ The integral $I$ in question is defined as follows
$$
I \equiv \int\frac{1}{x-\sqrt{1-x^2}}dx
$$
To solve this, I tried the trig substitution $x = \sin\theta$, with $dx = \cos\theta d\theta$, and rewrote the integral as follows
$$
\int\frac{\cos\theta}{\sin\theta-\sqrt{1-\sin^2\theta}}d\theta
$$
I used to identity $1 - \sin^2\theta = \cos^2\theta$ and simplified the denominator as follows
$$
\int\frac{\cos\theta}{\sin\theta-\cos\theta}d\theta
$$
I then rewrote $\cos\theta$ as $\frac{\sin\theta + \cos\theta}{2} - \frac{\sin\theta - \cos\theta}{2}$ and rewrote the integrand as follows
$$
\int\frac{1}{2}\frac{\sin\theta+\cos\theta}{\sin\theta - \cos\theta} - \frac{1}{2}d\theta
$$
I then split the integral as follows
$$
\frac{1}{2}\int\frac{\sin\theta+\cos\theta}{\sin\theta-\cos\theta}d\theta - \frac{1}{2}\int1d\theta
$$
For the first integral, I substituted $\phi = \sin\theta-\cos\theta$, with $d\theta = \frac{1}{\sin\theta+\cos\theta}d\phi$
We can then rewrite our integral as
$$
\frac{1}{2}\int\frac{1}{\phi}d\phi
$$
This is trivial and after undoing the substitutions we have a result of
$$
\frac{\ln({x - \cos(\arcsin(x))})}{2} 
$$
The second integral is also trivial and just evaluates to $\frac{x}{2}$
Combining everything together gives us a final simplified answer of
$$
I = \frac{\ln({x - \sqrt{1-x^2}})-x}{2} + C
$$
However, both IntegralCalculator and WolframAlpha give very different answers, so if someone could tell me where I made a mistake or another approach entirely that would be greatly appreciated.

I approached this integral by trigonometric substitution and partial fraction.
Assume the followings:
$x=\sin\theta\ \ldots(1)\\
\text{Hence, }dx=\cos\theta\ d\theta\ \ldots(2)\\
\text{Also, }\cos\theta=\sqrt{1-x^2}\ \ldots(3)\\$
Then,
$\operatorname{\Large\int}\dfrac{1}{x-\sqrt{1-x^2}}dx=\operatorname{\Large\int}\dfrac{\cos\theta}{\sin\theta-\sqrt{1-\sin^2\theta}}d\theta=\operatorname{\Large\int}\dfrac{\cos\theta}{\sin\theta-\cos\theta}d\theta$
$=\operatorname{\Large\int}\dfrac{1}{\tan\theta-1}d\theta=\operatorname{\Large\int}\dfrac{1}{\sec^2\theta\ (\tan\theta-1)}d\tan\theta=\operatorname{\Large\int}\dfrac{1}{(\tan^2\theta+1)(\tan\theta-1)}d\tan\theta$
$\stackrel{\text{partial fraction}}{=}\dfrac{1}{2}\operatorname{\Large\int}(\dfrac{1}{\tan\theta-1}-\dfrac{1+\tan\theta}{1+\tan^2\theta})\ d\tan\theta$
$=\dfrac{1}{2}(\operatorname{\Large\int}\dfrac{1}{\tan\theta-1}d\tan\theta-\operatorname{\Large\int}\dfrac{\sec^2\theta\ (1+\tan\theta)}{1+\tan^2\theta}\ d\theta)$
$=\dfrac{1}{2}(\operatorname{\Large\int}\dfrac{1}{\tan\theta-1}d\tan\theta-\operatorname{\Large\int}(1+\tan\theta)\ d\theta)$
$=\dfrac{1}{2}[\ln|\tan\theta-1|-(\theta-\ln|\cos\theta|)]+C$
$=\dfrac{1}{2}(\ln|\sin\theta-\cos\theta|-\theta)+C$
$=\underline{\underline{\dfrac{1}{2}(\ln|x-\sqrt{1-x^2}|-\arcsin x)+C}}$
