Optimal. Leaf size=65 \[ -\frac {1}{x}-x+\sqrt {1+x^2}+\frac {\sqrt {1+x^2}}{x}+\frac {1}{2} x \sqrt {1+x^2}-\frac {1}{2} \sinh ^{-1}(x)-\log \left (1+\sqrt {1+x^2}\right ) \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.11, antiderivative size = 65, normalized size of antiderivative = 1.00, number of steps
used = 14, number of rules used = 7, integrand size = 20, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.350, Rules used = {6874, 283,
221, 1605, 196, 45, 201} \begin {gather*} \frac {1}{2} \sqrt {x^2+1} x+\sqrt {x^2+1}+\frac {\sqrt {x^2+1}}{x}-\log \left (\sqrt {x^2+1}+1\right )-x-\frac {1}{x}-\frac {1}{2} \sinh ^{-1}(x) \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 45
Rule 196
Rule 201
Rule 221
Rule 283
Rule 1605
Rule 6874
Rubi steps
\begin {align*} \int \frac {-1+x+x^2}{1+\sqrt {1+x^2}} \, dx &=\int \left (-\frac {1}{1+\sqrt {1+x^2}}+\frac {x}{1+\sqrt {1+x^2}}+\frac {x^2}{1+\sqrt {1+x^2}}\right ) \, dx\\ &=-\int \frac {1}{1+\sqrt {1+x^2}} \, dx+\int \frac {x}{1+\sqrt {1+x^2}} \, dx+\int \frac {x^2}{1+\sqrt {1+x^2}} \, dx\\ &=\frac {1}{2} \text {Subst}\left (\int \frac {1}{1+\sqrt {x}} \, dx,x,1+x^2\right )+\int \left (-1+\sqrt {1+x^2}\right ) \, dx-\int \left (-\frac {1}{x^2}+\frac {\sqrt {1+x^2}}{x^2}\right ) \, dx\\ &=-\frac {1}{x}-x+\int \sqrt {1+x^2} \, dx-\int \frac {\sqrt {1+x^2}}{x^2} \, dx+\text {Subst}\left (\int \frac {x}{1+x} \, dx,x,\sqrt {1+x^2}\right )\\ &=-\frac {1}{x}-x+\frac {\sqrt {1+x^2}}{x}+\frac {1}{2} x \sqrt {1+x^2}+\frac {1}{2} \int \frac {1}{\sqrt {1+x^2}} \, dx-\int \frac {1}{\sqrt {1+x^2}} \, dx+\text {Subst}\left (\int \left (1+\frac {1}{-1-x}\right ) \, dx,x,\sqrt {1+x^2}\right )\\ &=-\frac {1}{x}-x+\sqrt {1+x^2}+\frac {\sqrt {1+x^2}}{x}+\frac {1}{2} x \sqrt {1+x^2}-\frac {1}{2} \sinh ^{-1}(x)-\log \left (1+\sqrt {1+x^2}\right )\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.18, size = 49, normalized size = 0.75 \begin {gather*} -\frac {1}{x}-x+\left (1+\frac {1}{x}+\frac {x}{2}\right ) \sqrt {1+x^2}-\frac {1}{2} \sinh ^{-1}(x)-\log \left (1+\sqrt {1+x^2}\right ) \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.11, size = 56, normalized size = 0.86
method | result | size |
default | \(-x -\frac {1}{x}-\frac {\arcsinh \left (x \right )}{2}-\frac {x \sqrt {x^{2}+1}}{2}+\sqrt {x^{2}+1}-\arctanh \left (\frac {1}{\sqrt {x^{2}+1}}\right )-\ln \left (x \right )+\frac {\left (x^{2}+1\right )^{\frac {3}{2}}}{x}\) | \(56\) |
meijerg | \(-\frac {x \hypergeom \left (\left [\frac {1}{2}, \frac {1}{2}, 1\right ], \left [\frac {3}{2}, 2\right ], -x^{2}\right )}{2}+\frac {x^{3} \hypergeom \left (\left [\frac {1}{2}, 1, \frac {3}{2}\right ], \left [2, \frac {5}{2}\right ], -x^{2}\right )}{6}+\frac {-4 \sqrt {\pi }+4 \sqrt {\pi }\, \sqrt {x^{2}+1}-4 \sqrt {\pi }\, \ln \left (\frac {1}{2}+\frac {\sqrt {x^{2}+1}}{2}\right )}{4 \sqrt {\pi }}\) | \(76\) |
trager | \(-\frac {\left (-1+x \right )^{2}}{x}+\frac {\left (x^{2}+2 x +2\right ) \sqrt {x^{2}+1}}{2 x}+\frac {\ln \left (\frac {\sqrt {x^{2}+1}\, x^{2}-x^{3}+2 x \sqrt {x^{2}+1}-2 x^{2}+2 \sqrt {x^{2}+1}-2 x -2}{x^{4}}\right )}{2}\) | \(84\) |
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.34, size = 84, normalized size = 1.29 \begin {gather*} -\frac {2 \, x^{2} + 2 \, x \log \left (x\right ) + 2 \, x \log \left (-x + \sqrt {x^{2} + 1} + 1\right ) - x \log \left (-x + \sqrt {x^{2} + 1}\right ) - 2 \, x \log \left (-x + \sqrt {x^{2} + 1} - 1\right ) - {\left (x^{2} + 2 \, x + 2\right )} \sqrt {x^{2} + 1} - 2 \, x + 2}{2 \, x} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [A]
time = 2.89, size = 63, normalized size = 0.97 \begin {gather*} \frac {x \sqrt {x^{2} + 1}}{2} - x + \frac {x}{\sqrt {x^{2} + 1}} + \sqrt {x^{2} + 1} - \log {\left (\sqrt {x^{2} + 1} + 1 \right )} - \frac {\operatorname {asinh}{\left (x \right )}}{2} - \frac {1}{x} + \frac {1}{x \sqrt {x^{2} + 1}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A]
time = 3.27, size = 89, normalized size = 1.37 \begin {gather*} \frac {1}{2} \, \sqrt {x^{2} + 1} {\left (x + 2\right )} - x - \frac {2}{{\left (x - \sqrt {x^{2} + 1}\right )}^{2} - 1} - \frac {1}{x} + \frac {1}{2} \, \log \left (-x + \sqrt {x^{2} + 1}\right ) - \log \left ({\left | x \right |}\right ) - \log \left ({\left | -x + \sqrt {x^{2} + 1} + 1 \right |}\right ) + \log \left ({\left | -x + \sqrt {x^{2} + 1} - 1 \right |}\right ) \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 0.04, size = 55, normalized size = 0.85 \begin {gather*} \left (\frac {x}{2}+1\right )\,\sqrt {x^2+1}-\frac {\mathrm {asinh}\left (x\right )}{2}-\ln \left (x\right )-x+\frac {\sqrt {x^2+1}}{x}-\frac {1}{x}+\mathrm {atan}\left (\sqrt {x^2+1}\,1{}\mathrm {i}\right )\,1{}\mathrm {i} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________