Optimal. Leaf size=26 \[ \frac {2}{x}+\frac {2 \sqrt {1-x^2}}{x}+2 \sin ^{-1}(x) \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.14, antiderivative size = 26, normalized size of antiderivative = 1.00, number of steps
used = 5, number of rules used = 4, integrand size = 42, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.095, Rules used = {6820, 6874,
283, 222} \begin {gather*} 2 \text {ArcSin}(x)+\frac {2 \sqrt {1-x^2}}{x}+\frac {2}{x} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 222
Rule 283
Rule 6820
Rule 6874
Rubi steps
\begin {align*} \int \frac {\left (-\sqrt {1-x}-\sqrt {1+x}\right ) \left (\sqrt {1-x}+\sqrt {1+x}\right )}{x^2} \, dx &=-\int \frac {\left (\sqrt {1-x}+\sqrt {1+x}\right )^2}{x^2} \, dx\\ &=-\int \left (\frac {2}{x^2}+\frac {2 \sqrt {1-x^2}}{x^2}\right ) \, dx\\ &=\frac {2}{x}-2 \int \frac {\sqrt {1-x^2}}{x^2} \, dx\\ &=\frac {2}{x}+\frac {2 \sqrt {1-x^2}}{x}+2 \int \frac {1}{\sqrt {1-x^2}} \, dx\\ &=\frac {2}{x}+\frac {2 \sqrt {1-x^2}}{x}+2 \sin ^{-1}(x)\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.01, size = 39, normalized size = 1.50 \begin {gather*} \frac {2 \left (1+\sqrt {1-x^2}+2 x \tan ^{-1}\left (\frac {\sqrt {1+x}}{\sqrt {1-x}}\right )\right )}{x} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [B] Leaf count of result is larger than twice the leaf count of optimal. \(49\) vs.
\(2(24)=48\).
time = 0.26, size = 50, normalized size = 1.92
method | result | size |
default | \(\frac {2}{x}-\frac {2 \left (-\arcsin \left (x \right ) x -\sqrt {-x^{2}+1}\right ) \sqrt {1-x}\, \sqrt {1+x}}{x \sqrt {-x^{2}+1}}\) | \(50\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A]
time = 0.48, size = 24, normalized size = 0.92 \begin {gather*} \frac {2 \, \sqrt {-x^{2} + 1}}{x} + \frac {2}{x} + 2 \, \arcsin \left (x\right ) \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 0.39, size = 44, normalized size = 1.69 \begin {gather*} -\frac {2 \, {\left (2 \, x \arctan \left (\frac {\sqrt {x + 1} \sqrt {-x + 1} - 1}{x}\right ) - \sqrt {x + 1} \sqrt {-x + 1} - 1\right )}}{x} \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 {2}{x^{2}}\, dx - \int \frac {2 \sqrt {1 - x} \sqrt {x + 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. 149 vs.
\(2 (24) = 48\).
time = 4.20, size = 149, normalized size = 5.73 \begin {gather*} 2 \, \pi + \frac {8 \, {\left (\frac {\sqrt {2} - \sqrt {-x + 1}}{\sqrt {x + 1}} - \frac {\sqrt {x + 1}}{\sqrt {2} - \sqrt {-x + 1}}\right )}}{{\left (\frac {\sqrt {2} - \sqrt {-x + 1}}{\sqrt {x + 1}} - \frac {\sqrt {x + 1}}{\sqrt {2} - \sqrt {-x + 1}}\right )}^{2} - 4} + \frac {2}{x} + 4 \, \arctan \left (\frac {\sqrt {x + 1} {\left (\frac {{\left (\sqrt {2} - \sqrt {-x + 1}\right )}^{2}}{x + 1} - 1\right )}}{2 \, {\left (\sqrt {2} - \sqrt {-x + 1}\right )}}\right ) \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 3.79, size = 118, normalized size = 4.54 \begin {gather*} \frac {\frac {5\,{\left (\sqrt {1-x}-1\right )}^2}{2\,{\left (\sqrt {x+1}-1\right )}^2}-\frac {1}{2}}{\frac {\sqrt {1-x}-1}{\sqrt {x+1}-1}-\frac {{\left (\sqrt {1-x}-1\right )}^3}{{\left (\sqrt {x+1}-1\right )}^3}}-8\,\mathrm {atan}\left (\frac {\sqrt {1-x}-1}{\sqrt {x+1}-1}\right )+\frac {\sqrt {1-x}-1}{2\,\left (\sqrt {x+1}-1\right )}+\frac {2}{x} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________