Optimal. Leaf size=32 \[ -2 \sqrt {1-x^2}+2 \tanh ^{-1}\left (\sqrt {1-x^2}\right )-2 \log (x) \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.14, antiderivative size = 32, normalized size of antiderivative = 1.00, number of steps
used = 7, number of rules used = 6, integrand size = 42, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.143, Rules used = {6820, 6874,
272, 52, 65, 212} \begin {gather*} -2 \sqrt {1-x^2}+2 \tanh ^{-1}\left (\sqrt {1-x^2}\right )-2 \log (x) \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 52
Rule 65
Rule 212
Rule 272
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} \, dx &=-\int \frac {\left (\sqrt {1-x}+\sqrt {1+x}\right )^2}{x} \, dx\\ &=-\int \left (\frac {2}{x}+\frac {2 \sqrt {1-x^2}}{x}\right ) \, dx\\ &=-2 \log (x)-2 \int \frac {\sqrt {1-x^2}}{x} \, dx\\ &=-2 \log (x)-\text {Subst}\left (\int \frac {\sqrt {1-x}}{x} \, dx,x,x^2\right )\\ &=-2 \sqrt {1-x^2}-2 \log (x)-\text {Subst}\left (\int \frac {1}{\sqrt {1-x} x} \, dx,x,x^2\right )\\ &=-2 \sqrt {1-x^2}-2 \log (x)+2 \text {Subst}\left (\int \frac {1}{1-x^2} \, dx,x,\sqrt {1-x^2}\right )\\ &=-2 \sqrt {1-x^2}+2 \tanh ^{-1}\left (\sqrt {1-x^2}\right )-2 \log (x)\\ \end {align*}
________________________________________________________________________________________
Mathematica [B] Leaf count is larger than twice the leaf count of optimal. \(81\) vs. \(2(32)=64\).
time = 0.02, size = 81, normalized size = 2.53 \begin {gather*} -\frac {4 \left (-1+\sqrt {1-x}\right )^2 \left (-1+\sqrt {1+x}\right )^2}{\left (-2+\sqrt {1-x}+\sqrt {1+x}\right )^2}+8 \tanh ^{-1}\left (\frac {-2-x+2 \sqrt {1+x}}{-2+2 \sqrt {1-x}+x}\right ) \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.26, size = 51, normalized size = 1.59
method | result | size |
default | \(-2 \ln \left (x \right )-\frac {2 \sqrt {1-x}\, \sqrt {1+x}\, \left (\sqrt {-x^{2}+1}-\arctanh \left (\frac {1}{\sqrt {-x^{2}+1}}\right )\right )}{\sqrt {-x^{2}+1}}\) | \(51\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A]
time = 0.49, size = 41, normalized size = 1.28 \begin {gather*} -2 \, \sqrt {-x^{2} + 1} - 2 \, \log \left (x\right ) + 2 \, \log \left (\frac {2 \, \sqrt {-x^{2} + 1}}{{\left | x \right |}} + \frac {2}{{\left | x \right |}}\right ) \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 0.35, size = 41, normalized size = 1.28 \begin {gather*} -2 \, \sqrt {x + 1} \sqrt {-x + 1} - 2 \, \log \left (x\right ) - 2 \, \log \left (\frac {\sqrt {x + 1} \sqrt {-x + 1} - 1}{x}\right ) \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}\, dx - \int \frac {2 \sqrt {1 - x} \sqrt {x + 1}}{x}\, dx \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [F(-2)]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Exception raised: NotImplementedError} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 4.13, size = 122, normalized size = 3.81 \begin {gather*} 2\,\ln \left (\frac {\sqrt {1-x}-1}{\sqrt {x+1}-1}\right )-2\,\ln \left (\frac {{\left (\sqrt {1-x}-1\right )}^2}{{\left (\sqrt {x+1}-1\right )}^2}-1\right )-2\,\ln \left (x\right )-\frac {16\,{\left (\sqrt {1-x}-1\right )}^2}{{\left (\sqrt {x+1}-1\right )}^2\,\left (\frac {2\,{\left (\sqrt {1-x}-1\right )}^2}{{\left (\sqrt {x+1}-1\right )}^2}+\frac {{\left (\sqrt {1-x}-1\right )}^4}{{\left (\sqrt {x+1}-1\right )}^4}+1\right )} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________