Optimal. Leaf size=65 \[ \frac {x}{2}+\frac {\sqrt {1-x^2}}{2}-\frac {\tanh ^{-1}\left (\sqrt {2} x\right )}{2 \sqrt {2}}-\frac {\tanh ^{-1}\left (\sqrt {2} \sqrt {1-x^2}\right )}{2 \sqrt {2}} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.04, antiderivative size = 65, normalized size of antiderivative = 1.00, number of steps
used = 7, number of rules used = 7, integrand size = 19, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.368, Rules used = {2132, 327, 212,
455, 52, 65, 213} \begin {gather*} \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}} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 52
Rule 65
Rule 212
Rule 213
Rule 327
Rule 455
Rule 2132
Rubi steps
\begin {align*} \int \frac {x}{x-\sqrt {1-x^2}} \, dx &=-\int \frac {x^2}{1-2 x^2} \, dx-\int \frac {x \sqrt {1-x^2}}{1-2 x^2} \, dx\\ &=\frac {x}{2}-\frac {1}{2} \int \frac {1}{1-2 x^2} \, dx-\frac {1}{2} \text {Subst}\left (\int \frac {\sqrt {1-x}}{1-2 x} \, dx,x,x^2\right )\\ &=\frac {x}{2}+\frac {\sqrt {1-x^2}}{2}-\frac {\tanh ^{-1}\left (\sqrt {2} x\right )}{2 \sqrt {2}}-\frac {1}{4} \text {Subst}\left (\int \frac {1}{(1-2 x) \sqrt {1-x}} \, dx,x,x^2\right )\\ &=\frac {x}{2}+\frac {\sqrt {1-x^2}}{2}-\frac {\tanh ^{-1}\left (\sqrt {2} x\right )}{2 \sqrt {2}}+\frac {1}{2} \text {Subst}\left (\int \frac {1}{-1+2 x^2} \, dx,x,\sqrt {1-x^2}\right )\\ &=\frac {x}{2}+\frac {\sqrt {1-x^2}}{2}-\frac {\tanh ^{-1}\left (\sqrt {2} x\right )}{2 \sqrt {2}}-\frac {\tanh ^{-1}\left (\sqrt {2} \sqrt {1-x^2}\right )}{2 \sqrt {2}}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.12, size = 49, normalized size = 0.75 \begin {gather*} \frac {1}{2} \left (x+\sqrt {1-x^2}+\sqrt {2} \tanh ^{-1}\left (\frac {\sqrt {2} x}{-1-x+\sqrt {1-x^2}}\right )\right ) \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [B] Leaf count of result is larger than twice the leaf count of optimal. \(174\) vs.
\(2(45)=90\).
time = 0.14, size = 175, normalized size = 2.69
method | result | size |
trager | \(\frac {x}{2}+\frac {\sqrt {-x^{2}+1}}{2}-\frac {\RootOf \left (\textit {\_Z}^{2}-2\right ) \ln \left (-\frac {\RootOf \left (\textit {\_Z}^{2}-2\right )+2 \sqrt {-x^{2}+1}}{\RootOf \left (\textit {\_Z}^{2}-2\right ) x -1}\right )}{4}\) | \(57\) |
default | \(\frac {x}{2}-\frac {\arctanh \left (\sqrt {2}\, x \right ) \sqrt {2}}{4}+\frac {\sqrt {-4 \left (x +\frac {\sqrt {2}}{2}\right )^{2}+4 \left (x +\frac {\sqrt {2}}{2}\right ) \sqrt {2}+2}}{8}-\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 )}{8}+\frac {\sqrt {-4 \left (x -\frac {\sqrt {2}}{2}\right )^{2}-4 \left (x -\frac {\sqrt {2}}{2}\right ) \sqrt {2}+2}}{8}-\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 )}{8}\) | \(175\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
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]
[Out]
________________________________________________________________________________________
Fricas [B] Leaf count of result is larger than twice the leaf count of optimal. 97 vs.
\(2 (45) = 90\).
time = 0.33, size = 97, normalized size = 1.49 \begin {gather*} \frac {1}{8} \, \sqrt {2} \log \left (\frac {6 \, x^{2} - 2 \, \sqrt {2} {\left (2 \, x^{2} - 3\right )} + 2 \, \sqrt {-x^{2} + 1} {\left (3 \, \sqrt {2} - 4\right )} - 9}{2 \, x^{2} - 1}\right ) + \frac {1}{8} \, \sqrt {2} \log \left (\frac {2 \, x^{2} - 2 \, \sqrt {2} x + 1}{2 \, x^{2} - 1}\right ) + \frac {1}{2} \, x + \frac {1}{2} \, \sqrt {-x^{2} + 1} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \frac {x}{x - \sqrt {1 - x^{2}}}\, dx \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [B] Leaf count of result is larger than twice the leaf count of optimal. 105 vs.
\(2 (45) = 90\).
time = 5.39, size = 105, normalized size = 1.62 \begin {gather*} \frac {1}{8} \, \sqrt {2} \log \left (\frac {{\left | 4 \, x - 2 \, \sqrt {2} \right |}}{{\left | 4 \, x + 2 \, \sqrt {2} \right |}}\right ) - \frac {1}{8} \, \sqrt {2} \log \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} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 3.50, size = 127, normalized size = 1.95 \begin {gather*} \frac {x}{2}-\frac {\sqrt {2}\,\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 )}{8}-\frac {\sqrt {2}\,\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 )}{8}+\frac {\sqrt {2}\,\ln \left (x-\frac {\sqrt {2}}{2}\right )}{8}-\frac {\sqrt {2}\,\ln \left (x+\frac {\sqrt {2}}{2}\right )}{8}+\frac {\sqrt {1-x^2}}{2} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________