Optimal. Leaf size=28 \[ \sqrt {1-x^2}-\tanh ^{-1}\left (\sqrt {1-x^2}\right )+\log (x) \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.22, antiderivative size = 28, normalized size of antiderivative = 1.00, number of steps
used = 15, number of rules used = 7, integrand size = 39, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.180, Rules used = {2128, 6820,
14, 272, 52, 65, 212} \begin {gather*} \sqrt {1-x^2}-\tanh ^{-1}\left (\sqrt {1-x^2}\right )+\log (x) \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 14
Rule 52
Rule 65
Rule 212
Rule 272
Rule 2128
Rule 6820
Rubi steps
\begin {align*} \int \frac {\sqrt {1-x}+\sqrt {1+x}}{-\sqrt {1-x}+\sqrt {1+x}} \, dx &=\frac {1}{2} \int \frac {\sqrt {1-x} \left (\sqrt {1-x}+\sqrt {1+x}\right )}{x} \, dx+\frac {1}{2} \int \frac {\sqrt {1+x} \left (\sqrt {1-x}+\sqrt {1+x}\right )}{x} \, dx\\ &=\frac {1}{2} \int \frac {1-x+\sqrt {1-x^2}}{x} \, dx+\frac {1}{2} \int \frac {1+x+\sqrt {1-x^2}}{x} \, dx\\ &=\frac {1}{2} \int \left (-1+\frac {1}{x}+\frac {\sqrt {1-x^2}}{x}\right ) \, dx+\frac {1}{2} \int \left (1+\frac {1}{x}+\frac {\sqrt {1-x^2}}{x}\right ) \, dx\\ &=\log (x)+2 \left (\frac {1}{2} \int \frac {\sqrt {1-x^2}}{x} \, dx\right )\\ &=\log (x)+2 \left (\frac {1}{4} \text {Subst}\left (\int \frac {\sqrt {1-x}}{x} \, dx,x,x^2\right )\right )\\ &=\log (x)+2 \left (\frac {\sqrt {1-x^2}}{2}+\frac {1}{4} \text {Subst}\left (\int \frac {1}{\sqrt {1-x} x} \, dx,x,x^2\right )\right )\\ &=\log (x)+2 \left (\frac {\sqrt {1-x^2}}{2}-\frac {1}{2} \text {Subst}\left (\int \frac {1}{1-x^2} \, dx,x,\sqrt {1-x^2}\right )\right )\\ &=2 \left (\frac {\sqrt {1-x^2}}{2}-\frac {1}{2} \tanh ^{-1}\left (\sqrt {1-x^2}\right )\right )+\log (x)\\ \end {align*}
________________________________________________________________________________________
Mathematica [B] Leaf count is larger than twice the leaf count of optimal. \(81\) vs. \(2(28)=56\).
time = 0.18, size = 81, normalized size = 2.89 \begin {gather*} \frac {2 \left (-1+\sqrt {1-x}\right )^2 \left (-1+\sqrt {1+x}\right )^2}{\left (-2+\sqrt {1-x}+\sqrt {1+x}\right )^2}-4 \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.22, size = 48, normalized size = 1.71
method | result | size |
default | \(\ln \left (x \right )+\frac {\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}}\) | \(48\) |
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 [A]
time = 0.39, size = 36, normalized size = 1.29 \begin {gather*} \sqrt {x + 1} \sqrt {-x + 1} + \log \left (x\right ) + \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 {\sqrt {1 - x}}{\sqrt {1 - x} - \sqrt {x + 1}}\, dx - \int \frac {\sqrt {x + 1}}{\sqrt {1 - x} - \sqrt {x + 1}}\, 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.49, size = 93, normalized size = 3.32 \begin {gather*} \ln \left (\frac {{\left (\sqrt {1-x}-1\right )}^2}{{\left (\sqrt {x+1}-1\right )}^2}-1\right )-\ln \left (\frac {\sqrt {1-x}-1}{\sqrt {x+1}-1}\right )+\ln \left (x\right )-\frac {8\,\left (x-2\,\sqrt {x+1}+2\right )\,\left (x+2\,\sqrt {1-x}-2\right )}{{\left (2\,\sqrt {x+1}+2\,\sqrt {1-x}-4\right )}^2} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________