3.826 \(\int \frac{x}{x-\sqrt{1-x^2}} \, dx\)

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

[Out]

x/2 + Sqrt[1 - x^2]/2 - ArcTanh[Sqrt[2]*x]/(2*Sqrt[2]) - ArcTanh[Sqrt[2]*Sqrt[1
- x^2]]/(2*Sqrt[2])

_______________________________________________________________________________________

Rubi [A]  time = 0.124664, antiderivative size = 65, normalized size of antiderivative = 1., number of steps used = 7, number of rules used = 6, integrand size = 19, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.316 \[ \frac{\sqrt{1-x^2}}{2}-\frac{\tanh ^{-1}\left (\sqrt{2} \sqrt{1-x^2}\right )}{2 \sqrt{2}}+\frac{x}{2}-\frac{\tanh ^{-1}\left (\sqrt{2} x\right )}{2 \sqrt{2}} \]

Antiderivative was successfully verified.

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

[Out]

x/2 + Sqrt[1 - x^2]/2 - ArcTanh[Sqrt[2]*x]/(2*Sqrt[2]) - ArcTanh[Sqrt[2]*Sqrt[1
- x^2]]/(2*Sqrt[2])

_______________________________________________________________________________________

Rubi in Sympy [A]  time = 7.54676, size = 49, normalized size = 0.75 \[ \frac{x}{2} + \frac{\sqrt{- x^{2} + 1}}{2} - \frac{\sqrt{2} \operatorname{atanh}{\left (\sqrt{2} x \right )}}{4} - \frac{\sqrt{2} \operatorname{atanh}{\left (\sqrt{2} \sqrt{- x^{2} + 1} \right )}}{4} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]  rubi_integrate(x/(x-(-x**2+1)**(1/2)),x)

[Out]

x/2 + sqrt(-x**2 + 1)/2 - sqrt(2)*atanh(sqrt(2)*x)/4 - sqrt(2)*atanh(sqrt(2)*sqr
t(-x**2 + 1))/4

_______________________________________________________________________________________

Mathematica [A]  time = 0.0682169, size = 95, normalized size = 1.46 \[ \frac{1}{8} \left (4 \sqrt{1-x^2}-\sqrt{2} \log \left (\sqrt{2-2 x^2}-\sqrt{2} x+2\right )-\sqrt{2} \log \left (\sqrt{2-2 x^2}+\sqrt{2} x+2\right )+4 x+2 \sqrt{2} \log \left (\sqrt{2}-2 x\right )\right ) \]

Antiderivative was successfully verified.

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

[Out]

(4*x + 4*Sqrt[1 - x^2] + 2*Sqrt[2]*Log[Sqrt[2] - 2*x] - Sqrt[2]*Log[2 - Sqrt[2]*
x + Sqrt[2 - 2*x^2]] - Sqrt[2]*Log[2 + Sqrt[2]*x + Sqrt[2 - 2*x^2]])/8

_______________________________________________________________________________________

Maple [B]  time = 0.013, size = 175, normalized size = 2.7 \[{\frac{x}{2}}-{\frac{{\it Artanh} \left ( \sqrt{2}x \right ) \sqrt{2}}{4}}+{\frac{1}{8}\sqrt{-4\, \left ( x-1/2\,\sqrt{2} \right ) ^{2}-4\,\sqrt{2} \left ( x-1/2\,\sqrt{2} \right ) +2}}-{\frac{\sqrt{2}}{8}{\it Artanh} \left ({\sqrt{2} \left ( 1-\sqrt{2} \left ( x-{\frac{\sqrt{2}}{2}} \right ) \right ){\frac{1}{\sqrt{-4\, \left ( x-1/2\,\sqrt{2} \right ) ^{2}-4\,\sqrt{2} \left ( x-1/2\,\sqrt{2} \right ) +2}}}} \right ) }+{\frac{1}{8}\sqrt{-4\, \left ( x+1/2\,\sqrt{2} \right ) ^{2}+4\,\sqrt{2} \left ( x+1/2\,\sqrt{2} \right ) +2}}-{\frac{\sqrt{2}}{8}{\it Artanh} \left ({\sqrt{2} \left ( \sqrt{2} \left ( x+{\frac{\sqrt{2}}{2}} \right ) +1 \right ){\frac{1}{\sqrt{-4\, \left ( x+1/2\,\sqrt{2} \right ) ^{2}+4\,\sqrt{2} \left ( x+1/2\,\sqrt{2} \right ) +2}}}} \right ) } \]

Verification of antiderivative is not currently implemented for this CAS.

[In]  int(x/(x-(-x^2+1)^(1/2)),x)

[Out]

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

_______________________________________________________________________________________

Maxima [F]  time = 0., size = 0, normalized size = 0. \[ \int \frac{x}{x - \sqrt{-x^{2} + 1}}\,{d x} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]  integrate(x/(x - sqrt(-x^2 + 1)),x, algorithm="maxima")

[Out]

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

_______________________________________________________________________________________

Fricas [A]  time = 0.26939, size = 282, normalized size = 4.34 \[ \frac{{\left (\sqrt{-x^{2} + 1} - 1\right )} \log \left (-\frac{8 \, x^{4} - 4 \, x^{2} - \sqrt{2}{\left (6 \, x^{4} - 5 \, x^{2} + 2\right )} + 2 \,{\left (2 \, x^{2} - \sqrt{2}{\left (2 \, x^{2} - 1\right )}\right )} \sqrt{-x^{2} + 1}}{2 \, x^{4} - 5 \, x^{2} + 2 \,{\left (2 \, x^{2} - 1\right )} \sqrt{-x^{2} + 1} + 2}\right ) - 2 \, \sqrt{2}{\left (x^{2} + x\right )} + \sqrt{-x^{2} + 1}{\left (2 \, \sqrt{2} x + \log \left (\frac{\sqrt{2}{\left (2 \, x^{2} + 1\right )} - 4 \, x}{2 \, x^{2} - 1}\right )\right )} - \log \left (\frac{\sqrt{2}{\left (2 \, x^{2} + 1\right )} - 4 \, x}{2 \, x^{2} - 1}\right )}{4 \,{\left (\sqrt{2} \sqrt{-x^{2} + 1} - \sqrt{2}\right )}} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]  integrate(x/(x - sqrt(-x^2 + 1)),x, algorithm="fricas")

[Out]

1/4*((sqrt(-x^2 + 1) - 1)*log(-(8*x^4 - 4*x^2 - sqrt(2)*(6*x^4 - 5*x^2 + 2) + 2*
(2*x^2 - sqrt(2)*(2*x^2 - 1))*sqrt(-x^2 + 1))/(2*x^4 - 5*x^2 + 2*(2*x^2 - 1)*sqr
t(-x^2 + 1) + 2)) - 2*sqrt(2)*(x^2 + x) + sqrt(-x^2 + 1)*(2*sqrt(2)*x + log((sqr
t(2)*(2*x^2 + 1) - 4*x)/(2*x^2 - 1))) - log((sqrt(2)*(2*x^2 + 1) - 4*x)/(2*x^2 -
 1)))/(sqrt(2)*sqrt(-x^2 + 1) - sqrt(2))

_______________________________________________________________________________________

Sympy [F]  time = 0., size = 0, normalized size = 0. \[ \int \frac{x}{x - \sqrt{- x^{2} + 1}}\, dx \]

Verification of antiderivative is not currently implemented for this CAS.

[In]  integrate(x/(x-(-x**2+1)**(1/2)),x)

[Out]

Integral(x/(x - sqrt(-x**2 + 1)), x)

_______________________________________________________________________________________

GIAC/XCAS [A]  time = 0.292831, size = 142, normalized size = 2.18 \[ \frac{1}{8} \, \sqrt{2}{\rm ln}\left (\frac{{\left | 4 \, x - 2 \, \sqrt{2} \right |}}{{\left | 4 \, x + 2 \, \sqrt{2} \right |}}\right ) - \frac{1}{8} \, \sqrt{2}{\rm ln}\left (\frac{{\left | -4 \, \sqrt{2} + \frac{2 \,{\left (\sqrt{-x^{2} + 1} - 1\right )}^{2}}{x^{2}} - 6 \right |}}{{\left | 4 \, \sqrt{2} + \frac{2 \,{\left (\sqrt{-x^{2} + 1} - 1\right )}^{2}}{x^{2}} - 6 \right |}}\right ) + \frac{1}{2} \, x + \frac{1}{2} \, \sqrt{-x^{2} + 1} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]  integrate(x/(x - sqrt(-x^2 + 1)),x, algorithm="giac")

[Out]

1/8*sqrt(2)*ln(abs(4*x - 2*sqrt(2))/abs(4*x + 2*sqrt(2))) - 1/8*sqrt(2)*ln(abs(-
4*sqrt(2) + 2*(sqrt(-x^2 + 1) - 1)^2/x^2 - 6)/abs(4*sqrt(2) + 2*(sqrt(-x^2 + 1)
- 1)^2/x^2 - 6)) + 1/2*x + 1/2*sqrt(-x^2 + 1)