3.9.78 \(\int \frac {1}{x-\sqrt {1-x^2}} \, dx\) [878]

Optimal. Leaf size=37 \[ -\frac {1}{2} \sin ^{-1}(x)-\frac {1}{2} \tanh ^{-1}\left (\frac {x}{\sqrt {1-x^2}}\right )+\frac {1}{4} \log \left (1-2 x^2\right ) \]

[Out]

-1/2*arcsin(x)-1/2*arctanh(x/(-x^2+1)^(1/2))+1/4*ln(-2*x^2+1)

________________________________________________________________________________________

Rubi [A]
time = 0.03, antiderivative size = 37, normalized size of antiderivative = 1.00, number of steps used = 7, number of rules used = 6, integrand size = 17, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.353, Rules used = {6874, 266, 399, 222, 385, 213} \begin {gather*} -\frac {\text {ArcSin}(x)}{2}+\frac {1}{4} \log \left (1-2 x^2\right )-\frac {1}{2} \tanh ^{-1}\left (\frac {x}{\sqrt {1-x^2}}\right ) \end {gather*}

Antiderivative was successfully verified.

[In]

Int[(x - Sqrt[1 - x^2])^(-1),x]

[Out]

-1/2*ArcSin[x] - ArcTanh[x/Sqrt[1 - x^2]]/2 + Log[1 - 2*x^2]/4

Rule 213

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(-(Rt[-a, 2]*Rt[b, 2])^(-1))*ArcTanh[Rt[b, 2]*(x/Rt[-a, 2])]
, x] /; FreeQ[{a, b}, x] && NegQ[a/b] && (LtQ[a, 0] || GtQ[b, 0])

Rule 222

Int[1/Sqrt[(a_) + (b_.)*(x_)^2], x_Symbol] :> Simp[ArcSin[Rt[-b, 2]*(x/Sqrt[a])]/Rt[-b, 2], x] /; FreeQ[{a, b}
, x] && GtQ[a, 0] && NegQ[b]

Rule 266

Int[(x_)^(m_.)/((a_) + (b_.)*(x_)^(n_)), x_Symbol] :> Simp[Log[RemoveContent[a + b*x^n, x]]/(b*n), x] /; FreeQ
[{a, b, m, n}, x] && EqQ[m, n - 1]

Rule 385

Int[((a_) + (b_.)*(x_)^(n_))^(p_)/((c_) + (d_.)*(x_)^(n_)), x_Symbol] :> Subst[Int[1/(c - (b*c - a*d)*x^n), x]
, x, x/(a + b*x^n)^(1/n)] /; FreeQ[{a, b, c, d}, x] && NeQ[b*c - a*d, 0] && EqQ[n*p + 1, 0] && IntegerQ[n]

Rule 399

Int[((a_) + (b_.)*(x_)^(n_))^(p_)/((c_) + (d_.)*(x_)^(n_)), x_Symbol] :> Dist[b/d, Int[(a + b*x^n)^(p - 1), x]
, x] - Dist[(b*c - a*d)/d, Int[(a + b*x^n)^(p - 1)/(c + d*x^n), x], x] /; FreeQ[{a, b, c, d, p}, x] && NeQ[b*c
 - a*d, 0] && EqQ[n*(p - 1) + 1, 0] && IntegerQ[n]

Rule 6874

Int[u_, x_Symbol] :> With[{v = ExpandIntegrand[u, x]}, Int[v, x] /; SumQ[v]]

Rubi steps

\begin {align*} \int \frac {1}{x-\sqrt {1-x^2}} \, dx &=\int \left (\frac {x}{-1+2 x^2}+\frac {\sqrt {1-x^2}}{-1+2 x^2}\right ) \, dx\\ &=\int \frac {x}{-1+2 x^2} \, dx+\int \frac {\sqrt {1-x^2}}{-1+2 x^2} \, dx\\ &=\frac {1}{4} \log \left (1-2 x^2\right )-\frac {1}{2} \int \frac {1}{\sqrt {1-x^2}} \, dx+\frac {1}{2} \int \frac {1}{\sqrt {1-x^2} \left (-1+2 x^2\right )} \, dx\\ &=-\frac {1}{2} \sin ^{-1}(x)+\frac {1}{4} \log \left (1-2 x^2\right )+\frac {1}{2} \text {Subst}\left (\int \frac {1}{-1+x^2} \, dx,x,\frac {x}{\sqrt {1-x^2}}\right )\\ &=-\frac {1}{2} \sin ^{-1}(x)-\frac {1}{2} \tanh ^{-1}\left (\frac {x}{\sqrt {1-x^2}}\right )+\frac {1}{4} \log \left (1-2 x^2\right )\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]
time = 0.04, size = 39, normalized size = 1.05 \begin {gather*} \tan ^{-1}\left (\frac {\sqrt {1-x^2}}{1+x}\right )+\frac {1}{2} \log \left (-x+\sqrt {1-x^2}\right ) \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[(x - Sqrt[1 - x^2])^(-1),x]

[Out]

ArcTan[Sqrt[1 - x^2]/(1 + x)] + Log[-x + Sqrt[1 - x^2]]/2

________________________________________________________________________________________

Maple [B] Leaf count of result is larger than twice the leaf count of optimal. \(196\) vs. \(2(29)=58\).
time = 0.15, size = 197, normalized size = 5.32

method result size
trager \(-\ln \left (-\frac {\sqrt {-x^{2}+1}+x}{2 x^{2}-1}\right ) \RootOf \left (2 \textit {\_Z}^{2}+2 \textit {\_Z} +1\right )-\ln \left (-\frac {\sqrt {-x^{2}+1}+x}{2 x^{2}-1}\right )+\frac {\ln \left (-\frac {2 \RootOf \left (2 \textit {\_Z}^{2}+2 \textit {\_Z} +1\right )^{2} x^{2}-x \sqrt {-x^{2}+1}+\RootOf \left (2 \textit {\_Z}^{2}+2 \textit {\_Z} +1\right )}{2 x^{2}-1}\right )}{2}+\ln \left (-\frac {2 \RootOf \left (2 \textit {\_Z}^{2}+2 \textit {\_Z} +1\right )^{2} x^{2}-x \sqrt {-x^{2}+1}+\RootOf \left (2 \textit {\_Z}^{2}+2 \textit {\_Z} +1\right )}{2 x^{2}-1}\right ) \RootOf \left (2 \textit {\_Z}^{2}+2 \textit {\_Z} +1\right )\) \(185\)
default \(\frac {\ln \left (2 x^{2}-1\right )}{4}+\frac {\sqrt {2}\, \left (\frac {\sqrt {-4 \left (x -\frac {\sqrt {2}}{2}\right )^{2}-4 \left (x -\frac {\sqrt {2}}{2}\right ) \sqrt {2}+2}}{4}-\frac {\sqrt {2}\, \arcsin \left (x \right )}{4}-\frac {\sqrt {2}\, \arctanh \left (\frac {\left (1-\left (x -\frac {\sqrt {2}}{2}\right ) \sqrt {2}\right ) \sqrt {2}}{\sqrt {-4 \left (x -\frac {\sqrt {2}}{2}\right )^{2}-4 \left (x -\frac {\sqrt {2}}{2}\right ) \sqrt {2}+2}}\right )}{4}\right )}{2}-\frac {\sqrt {2}\, \left (\frac {\sqrt {-4 \left (x +\frac {\sqrt {2}}{2}\right )^{2}+4 \left (x +\frac {\sqrt {2}}{2}\right ) \sqrt {2}+2}}{4}+\frac {\sqrt {2}\, \arcsin \left (x \right )}{4}-\frac {\sqrt {2}\, \arctanh \left (\frac {\left (\left (x +\frac {\sqrt {2}}{2}\right ) \sqrt {2}+1\right ) \sqrt {2}}{\sqrt {-4 \left (x +\frac {\sqrt {2}}{2}\right )^{2}+4 \left (x +\frac {\sqrt {2}}{2}\right ) \sqrt {2}+2}}\right )}{4}\right )}{2}\) \(197\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(1/(x-(-x^2+1)^(1/2)),x,method=_RETURNVERBOSE)

[Out]

1/4*ln(2*x^2-1)+1/2*2^(1/2)*(1/4*(-4*(x-1/2*2^(1/2))^2-4*(x-1/2*2^(1/2))*2^(1/2)+2)^(1/2)-1/4*2^(1/2)*arcsin(x
)-1/4*2^(1/2)*arctanh((1-(x-1/2*2^(1/2))*2^(1/2))*2^(1/2)/(-4*(x-1/2*2^(1/2))^2-4*(x-1/2*2^(1/2))*2^(1/2)+2)^(
1/2)))-1/2*2^(1/2)*(1/4*(-4*(x+1/2*2^(1/2))^2+4*(x+1/2*2^(1/2))*2^(1/2)+2)^(1/2)+1/4*2^(1/2)*arcsin(x)-1/4*2^(
1/2)*arctanh(((x+1/2*2^(1/2))*2^(1/2)+1)*2^(1/2)/(-4*(x+1/2*2^(1/2))^2+4*(x+1/2*2^(1/2))*2^(1/2)+2)^(1/2)))

________________________________________________________________________________________

Maxima [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Failed to integrate} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(1/(x-(-x^2+1)^(1/2)),x, algorithm="maxima")

[Out]

integrate(1/(x - sqrt(-x^2 + 1)), x)

________________________________________________________________________________________

Fricas [B] Leaf count of result is larger than twice the leaf count of optimal. 84 vs. \(2 (29) = 58\).
time = 0.39, size = 84, normalized size = 2.27 \begin {gather*} \arctan \left (\frac {\sqrt {-x^{2} + 1} - 1}{x}\right ) + \frac {1}{4} \, \log \left (2 \, x^{2} - 1\right ) + \frac {1}{4} \, \log \left (-\frac {x^{2} + \sqrt {-x^{2} + 1} {\left (x + 1\right )} - x - 1}{x^{2}}\right ) - \frac {1}{4} \, \log \left (-\frac {x^{2} - \sqrt {-x^{2} + 1} {\left (x - 1\right )} + x - 1}{x^{2}}\right ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(1/(x-(-x^2+1)^(1/2)),x, algorithm="fricas")

[Out]

arctan((sqrt(-x^2 + 1) - 1)/x) + 1/4*log(2*x^2 - 1) + 1/4*log(-(x^2 + sqrt(-x^2 + 1)*(x + 1) - x - 1)/x^2) - 1
/4*log(-(x^2 - sqrt(-x^2 + 1)*(x - 1) + x - 1)/x^2)

________________________________________________________________________________________

Sympy [A]
time = 0.08, size = 17, normalized size = 0.46 \begin {gather*} \frac {\log {\left (x - \sqrt {1 - x^{2}} \right )}}{2} - \frac {\operatorname {asin}{\left (x \right )}}{2} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(1/(x-(-x**2+1)**(1/2)),x)

[Out]

log(x - sqrt(1 - x**2))/2 - asin(x)/2

________________________________________________________________________________________

Giac [B] Leaf count of result is larger than twice the leaf count of optimal. 140 vs. \(2 (29) = 58\).
time = 3.42, size = 140, normalized size = 3.78 \begin {gather*} -\frac {1}{4} \, \pi \mathrm {sgn}\left (x\right ) - \frac {1}{2} \, \arctan \left (-\frac {x {\left (\frac {{\left (\sqrt {-x^{2} + 1} - 1\right )}^{2}}{x^{2}} - 1\right )}}{2 \, {\left (\sqrt {-x^{2} + 1} - 1\right )}}\right ) + \frac {1}{4} \, \log \left ({\left | x + \frac {1}{2} \, \sqrt {2} \right |}\right ) + \frac {1}{4} \, \log \left ({\left | x - \frac {1}{2} \, \sqrt {2} \right |}\right ) - \frac {1}{4} \, \log \left ({\left | -\frac {x}{\sqrt {-x^{2} + 1} - 1} + \frac {\sqrt {-x^{2} + 1} - 1}{x} + 2 \right |}\right ) + \frac {1}{4} \, \log \left ({\left | -\frac {x}{\sqrt {-x^{2} + 1} - 1} + \frac {\sqrt {-x^{2} + 1} - 1}{x} - 2 \right |}\right ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(1/(x-(-x^2+1)^(1/2)),x, algorithm="giac")

[Out]

-1/4*pi*sgn(x) - 1/2*arctan(-1/2*x*((sqrt(-x^2 + 1) - 1)^2/x^2 - 1)/(sqrt(-x^2 + 1) - 1)) + 1/4*log(abs(x + 1/
2*sqrt(2))) + 1/4*log(abs(x - 1/2*sqrt(2))) - 1/4*log(abs(-x/(sqrt(-x^2 + 1) - 1) + (sqrt(-x^2 + 1) - 1)/x + 2
)) + 1/4*log(abs(-x/(sqrt(-x^2 + 1) - 1) + (sqrt(-x^2 + 1) - 1)/x - 2))

________________________________________________________________________________________

Mupad [B]
time = 0.14, size = 105, normalized size = 2.84 \begin {gather*} \frac {\ln \left (x-\frac {\sqrt {2}}{2}\right )}{4}+\frac {\ln \left (x+\frac {\sqrt {2}}{2}\right )}{4}-\frac {\ln \left (\frac {\sqrt {2}\,\left (\frac {\sqrt {2}\,x}{2}-1\right )\,1{}\mathrm {i}-\sqrt {1-x^2}\,1{}\mathrm {i}}{x-\frac {\sqrt {2}}{2}}\right )}{4}+\frac {\ln \left (\frac {\sqrt {2}\,\left (\frac {\sqrt {2}\,x}{2}+1\right )\,1{}\mathrm {i}+\sqrt {1-x^2}\,1{}\mathrm {i}}{x+\frac {\sqrt {2}}{2}}\right )}{4}-\frac {\mathrm {asin}\left (x\right )}{2} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(1/(x - (1 - x^2)^(1/2)),x)

[Out]

log(x - 2^(1/2)/2)/4 + log(x + 2^(1/2)/2)/4 - log((2^(1/2)*((2^(1/2)*x)/2 - 1)*1i - (1 - x^2)^(1/2)*1i)/(x - 2
^(1/2)/2))/4 + log((2^(1/2)*((2^(1/2)*x)/2 + 1)*1i + (1 - x^2)^(1/2)*1i)/(x + 2^(1/2)/2))/4 - asin(x)/2

________________________________________________________________________________________