Optimal. Leaf size=33 \[ \frac {x^2}{2}-\frac {1}{2} \sqrt {-1+x} x \sqrt {1+x}+\frac {1}{2} \cosh ^{-1}(x) \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.10, antiderivative size = 33, normalized size of antiderivative = 1.00, number of steps
used = 9, number of rules used = 4, integrand size = 35, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.114, Rules used = {2129, 6874, 38,
54} \begin {gather*} \frac {x^2}{2}-\frac {1}{2} \sqrt {x-1} \sqrt {x+1} x+\frac {1}{2} \cosh ^{-1}(x) \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 38
Rule 54
Rule 2129
Rule 6874
Rubi steps
\begin {align*} \int \frac {-\sqrt {-1+x}+\sqrt {1+x}}{\sqrt {-1+x}+\sqrt {1+x}} \, dx &=-\left (\frac {1}{2} \int \sqrt {-1+x} \left (-\sqrt {-1+x}+\sqrt {1+x}\right ) \, dx\right )+\frac {1}{2} \int \sqrt {1+x} \left (-\sqrt {-1+x}+\sqrt {1+x}\right ) \, dx\\ &=\frac {1}{2} \int \left (1+x-\sqrt {-1+x} \sqrt {1+x}\right ) \, dx-\frac {1}{2} \int \left (1-x+\sqrt {-1+x} \sqrt {1+x}\right ) \, dx\\ &=\frac {x^2}{2}-2 \left (\frac {1}{2} \int \sqrt {-1+x} \sqrt {1+x} \, dx\right )\\ &=\frac {x^2}{2}-2 \left (\frac {1}{4} \sqrt {-1+x} x \sqrt {1+x}-\frac {1}{4} \int \frac {1}{\sqrt {-1+x} \sqrt {1+x}} \, dx\right )\\ &=\frac {x^2}{2}-2 \left (\frac {1}{4} \sqrt {-1+x} x \sqrt {1+x}-\frac {1}{4} \cosh ^{-1}(x)\right )\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.09, size = 42, normalized size = 1.27 \begin {gather*} \frac {1}{2} \left (-1+x^2-\sqrt {-1+x} x \sqrt {1+x}+2 \tanh ^{-1}\left (\frac {1}{\sqrt {\frac {-1+x}{1+x}}}\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. \(61\) vs.
\(2(23)=46\).
time = 0.23, size = 62, normalized size = 1.88
method | result | size |
default | \(-\frac {\sqrt {-1+x}\, \left (1+x \right )^{\frac {3}{2}}}{2}+\frac {\sqrt {-1+x}\, \sqrt {1+x}}{2}+\frac {\sqrt {\left (1+x \right ) \left (-1+x \right )}\, \ln \left (x +\sqrt {x^{2}-1}\right )}{2 \sqrt {1+x}\, \sqrt {-1+x}}+\frac {x^{2}}{2}\) | \(62\) |
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.35, size = 37, normalized size = 1.12 \begin {gather*} -\frac {1}{2} \, \sqrt {x + 1} \sqrt {x - 1} x + \frac {1}{2} \, x^{2} - \frac {1}{2} \, \log \left (\sqrt {x + 1} \sqrt {x - 1} - x\right ) \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [A]
time = 16.55, size = 224, normalized size = 6.79 \begin {gather*} - \frac {\left (x - 1\right )^{\frac {5}{2}}}{4 \sqrt {x + 1}} - \frac {3 \left (x - 1\right )^{\frac {3}{2}}}{4 \sqrt {x + 1}} - \frac {\sqrt {x - 1}}{2 \sqrt {x + 1}} + \frac {\left (x - 1\right )^{2}}{4} + 2 \left (\begin {cases} \frac {\left (x + 1\right )^{2}}{8} + \frac {\operatorname {acosh}{\left (\frac {\sqrt {2} \sqrt {x + 1}}{2} \right )}}{4} - \frac {\left (x + 1\right )^{\frac {5}{2}}}{8 \sqrt {x - 1}} + \frac {3 \left (x + 1\right )^{\frac {3}{2}}}{8 \sqrt {x - 1}} - \frac {\sqrt {x + 1}}{4 \sqrt {x - 1}} & \text {for}\: \left |{x + 1}\right | > 2 \\\frac {\left (x + 1\right )^{2}}{8} - \frac {i \operatorname {asin}{\left (\frac {\sqrt {2} \sqrt {x + 1}}{2} \right )}}{4} + \frac {i \left (x + 1\right )^{\frac {5}{2}}}{8 \sqrt {1 - x}} - \frac {3 i \left (x + 1\right )^{\frac {3}{2}}}{8 \sqrt {1 - x}} + \frac {i \sqrt {x + 1}}{4 \sqrt {1 - x}} & \text {otherwise} \end {cases}\right ) + \frac {\operatorname {asinh}{\left (\frac {\sqrt {2} \sqrt {x - 1}}{2} \right )}}{2} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A]
time = 3.72, size = 41, normalized size = 1.24 \begin {gather*} \frac {1}{2} \, {\left (x + 1\right )}^{2} - \frac {1}{2} \, \sqrt {x + 1} \sqrt {x - 1} x - x - \log \left (\sqrt {x + 1} - \sqrt {x - 1}\right ) - 1 \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 10.85, size = 200, normalized size = 6.06 \begin {gather*} \mathrm {acosh}\left (x\right )-2\,\mathrm {atanh}\left (\frac {\sqrt {x-1}-\mathrm {i}}{\sqrt {x+1}-1}\right )+\frac {\frac {14\,{\left (\sqrt {x-1}-\mathrm {i}\right )}^3}{{\left (\sqrt {x+1}-1\right )}^3}+\frac {14\,{\left (\sqrt {x-1}-\mathrm {i}\right )}^5}{{\left (\sqrt {x+1}-1\right )}^5}+\frac {2\,{\left (\sqrt {x-1}-\mathrm {i}\right )}^7}{{\left (\sqrt {x+1}-1\right )}^7}+\frac {2\,\left (\sqrt {x-1}-\mathrm {i}\right )}{\sqrt {x+1}-1}}{1+\frac {6\,{\left (\sqrt {x-1}-\mathrm {i}\right )}^4}{{\left (\sqrt {x+1}-1\right )}^4}-\frac {4\,{\left (\sqrt {x-1}-\mathrm {i}\right )}^6}{{\left (\sqrt {x+1}-1\right )}^6}+\frac {{\left (\sqrt {x-1}-\mathrm {i}\right )}^8}{{\left (\sqrt {x+1}-1\right )}^8}-\frac {4\,{\left (\sqrt {x-1}-\mathrm {i}\right )}^2}{{\left (\sqrt {x+1}-1\right )}^2}}+\frac {x^2}{2} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________