# 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.

• You can check the answer by differentiating it.
– ACB
Dec 2, 2022 at 6:26
• wolframalpha.com/… The derivative is different, so the answer must be wrong Dec 2, 2022 at 6:36
• $\sqrt{1 - \sin^2(x)} = |cos(x)|$
– user1077509
Dec 2, 2022 at 6:44
• Your second integral should be $\frac{\theta}{2}=\frac{\arcsin(x)}{2}$ and not $x/2$. So, $$I = \frac{\ln({x - \sqrt{1-x^2}})-\color{red}{\arcsin (x)}}{2} + C.$$ Dec 2, 2022 at 6:46
• Oh, that was silly of me. Thank you for pointing that out. Dec 2, 2022 at 7:00

You made mistake in the second integral. It should be $$I_2 = \frac{\theta}{2} + C_2 = \frac{\arcsin(x)}{2} + C_2$$

You could also proceed in the following way.

By letting $$\;t=x-\sqrt{1-x^2}\;,\;$$ we get that

$$x=\dfrac12\left(t\pm\sqrt{2-t^2}\right)\;,\quad\mathrm dx=\dfrac12\left(\!\!1\mp\dfrac t{\sqrt{2-t^2}}\!\!\right)\mathrm dt\;\;.$$

$$\displaystyle\int\frac1{x-\sqrt{1-x^2}}\,\mathrm dx=\frac12\!\int\frac1t\left(\!\!1\mp\frac t{\sqrt{2-t^2}}\!\!\right)\mathrm dt=$$

$$\displaystyle\quad=\frac12\!\int\frac1t\,\mathrm dt\;\mp\;\frac12\!\int\frac{\mathrm dt}{\sqrt{2-t^2}}\;\;.$$

Moreover ,

$$\mp\dfrac{\mathrm dt}{\sqrt{2-t^2}}=-\dfrac{\mathrm dt}{2x-t}=-\dfrac{t’(x)\,\mathrm dx}{x+\sqrt{1-x^2}}=$$

$$\quad=-\dfrac{1+\frac x{\sqrt{1-x^2}}}{\sqrt{1-x^2}\left(\!1+\frac x{\sqrt{1-x^2}}\!\right)}\,\mathrm dx=-\dfrac{\mathrm dx}{\sqrt{1-x^2}}\;\;.$$

Hence ,

$$\displaystyle\int\frac1{x-\sqrt{1-x^2}}\,\mathrm dx=\frac12\!\int\frac1t\,\mathrm dt\;\mp\;\frac12\!\int\frac{\mathrm dt}{\sqrt{2-t^2}}=$$

$$\displaystyle\quad=\frac12\ln|t|-\frac12\!\int\!\dfrac{\mathrm dx}{\sqrt{1-x^2}}=$$

$$\quad=\dfrac12\ln\bigg|x-\sqrt{1-x^2}\bigg|-\dfrac12\arcsin x+C\;\;.$$

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}}$$

\begin{align*} & \int \frac{dx}{x-\sqrt{1-x^2}} \\ &= -2 \int \frac{1}{\frac{1-y}{1+y} - \sqrt{1-\frac{(1-y)^2}{(1+y)^2}}} \frac{dy}{(1+y)^2} \tag1 \\ &= 2 \int \frac{dy}{\left(y + 2\sqrt y - 1\right)(y+1)} \\ &= 2 \int \frac{2z\,dz}{\left(z^2 + 2z - 1\right) \left(z^2+1\right)} \tag2 \\ &= \int \left(\frac{z+1}{z^2+2z-1} - \frac z{z^2+1} + \frac1{z^2+1}\right) \, dz \tag3 \\ &= \frac12 \ln\left(z^2+2z-1\right) - \frac12 \ln\left(z^2+1\right) + \arctan(z) + C \\ &= \frac12 \ln\left(\frac{y+2\sqrt y-1}{y+1}\right) + \arctan\left(\sqrt y\right) + C \\ &= \frac12 \ln\left(\sqrt{1-x^2}-x\right) + \arctan\left(\sqrt{\frac{1-x}{1+x}}\right) + C \end{align*}

• $$(1)$$ : substitute $$x=\dfrac{1-y}{1+y}$$, assuming $$1+y>0$$
• $$(2)$$ : substitute $$z=\sqrt y$$
• $$(3)$$ : partial fractions

Applying Euler's second substitution, $$\sqrt{1 - x^2} = x t - 1 ,$$ rationalizes the integral, giving: \begin{align} 2\int \frac{t^2 - 1}{(t^2 + 1) (t^2 - 2 t - 1)} \,dt & = \int \left(\frac{-t + 1}{t^2 + 1} + \frac{t - 1}{t^2 - 2 t - 1}\right) \,dt \\ &= \arctan t + \frac{1}{2} \log \frac{t^2 - 2 t - 1}{t^2 + 1} + C . \end{align}