Optimal. Leaf size=46 \[ -\frac {1}{x}+\sqrt {1+x^2}+\frac {\sqrt {1+x^2}}{x}-\sinh ^{-1}(x)-\log \left (1+\sqrt {1+x^2}\right ) \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.06, antiderivative size = 46, normalized size of antiderivative = 1.00, number of steps
used = 10, number of rules used = 6, integrand size = 17, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.353, Rules used = {6874, 283,
221, 1605, 196, 45} \begin {gather*} \frac {\sqrt {x^2+1}}{x}+\sqrt {x^2+1}-\log \left (\sqrt {x^2+1}+1\right )-\frac {1}{x}-\sinh ^{-1}(x) \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 45
Rule 196
Rule 221
Rule 283
Rule 1605
Rule 6874
Rubi steps
\begin {align*} \int \frac {-1+x}{1+\sqrt {1+x^2}} \, dx &=\int \left (-\frac {1}{1+\sqrt {1+x^2}}+\frac {x}{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\\ &=\frac {1}{2} \text {Subst}\left (\int \frac {1}{1+\sqrt {x}} \, dx,x,1+x^2\right )-\int \left (-\frac {1}{x^2}+\frac {\sqrt {1+x^2}}{x^2}\right ) \, dx\\ &=-\frac {1}{x}-\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}+\frac {\sqrt {1+x^2}}{x}-\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}+\sqrt {1+x^2}+\frac {\sqrt {1+x^2}}{x}-\sinh ^{-1}(x)-\log \left (1+\sqrt {1+x^2}\right )\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.08, size = 41, normalized size = 0.89 \begin {gather*} -\frac {1}{x}+\frac {(1+x) \sqrt {1+x^2}}{x}-4 \tanh ^{-1}\left (1-2 x+2 \sqrt {1+x^2}\right ) \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.06, size = 53, normalized size = 1.15
method | result | size |
trager | \(\frac {-1+x}{x}+\frac {\left (1+x \right ) \sqrt {x^{2}+1}}{x}+2 \ln \left (-\frac {\sqrt {x^{2}+1}-1-x}{x}\right )\) | \(43\) |
default | \(-\frac {1}{x}+\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}-x \sqrt {x^{2}+1}-\arcsinh \left (x \right )\) | \(53\) |
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 {-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 }}\) | \(58\) |
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 = 64, normalized size = 1.39 \begin {gather*} \frac {x \log \left (2 \, x^{2} - \sqrt {x^{2} + 1} {\left (2 \, x + 1\right )} + x + 1\right ) - x \log \left (x\right ) - x \log \left (-x + \sqrt {x^{2} + 1} + 1\right ) + \sqrt {x^{2} + 1} {\left (x + 1\right )} + x - 1}{x} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [A]
time = 1.50, size = 48, normalized size = 1.04 \begin {gather*} \frac {x}{\sqrt {x^{2} + 1}} + \sqrt {x^{2} + 1} - \log {\left (\sqrt {x^{2} + 1} + 1 \right )} - \operatorname {asinh}{\left (x \right )} - \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 = 4.23, size = 79, normalized size = 1.72 \begin {gather*} \sqrt {x^{2} + 1} - \frac {2}{{\left (x - \sqrt {x^{2} + 1}\right )}^{2} - 1} - \frac {1}{x} + \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 = 46, normalized size = 1.00 \begin {gather*} \sqrt {x^2+1}-\ln \left (x\right )-\mathrm {asinh}\left (x\right )+\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]
________________________________________________________________________________________