Optimal. Leaf size=53 \[ \frac {1}{12} \left (2 x^3+6 x^2+\left (-2 x^2-3 x+4\right ) \sqrt {x^2+1}-6 \log \left (\sqrt {x^2+1}+1\right )-3 \sinh ^{-1}(x)\right ) \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.21, antiderivative size = 101, normalized size of antiderivative = 1.91, number of steps used = 12, number of rules used = 6, integrand size = 21, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.286, Rules used = {6742, 2117, 893, 195, 215, 261} \[ \frac {x^3}{6}+\frac {x^2}{2}-\frac {1}{4} \sqrt {x^2+1} x-\frac {1}{6} \left (x^2+1\right )^{3/2}+\frac {1}{2 \left (\sqrt {x^2+1}+x\right )}+\frac {1}{2} \log \left (\sqrt {x^2+1}+x\right )-\log \left (\sqrt {x^2+1}+x+1\right )+\frac {x}{2}-\frac {1}{4} \sinh ^{-1}(x) \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 195
Rule 215
Rule 261
Rule 893
Rule 2117
Rule 6742
Rubi steps
\begin {align*} \int \frac {-1+x+x^2}{1+x+\sqrt {1+x^2}} \, dx &=\int \left (-\frac {1}{1+x+\sqrt {1+x^2}}+\frac {x}{1+x+\sqrt {1+x^2}}+\frac {x^2}{1+x+\sqrt {1+x^2}}\right ) \, dx\\ &=-\int \frac {1}{1+x+\sqrt {1+x^2}} \, dx+\int \frac {x}{1+x+\sqrt {1+x^2}} \, dx+\int \frac {x^2}{1+x+\sqrt {1+x^2}} \, dx\\ &=-\left (\frac {1}{2} \operatorname {Subst}\left (\int \frac {2-2 x+x^2}{(1-x)^2 x} \, dx,x,1+x+\sqrt {1+x^2}\right )\right )+\int \left (\frac {1}{2}+\frac {x}{2}-\frac {\sqrt {1+x^2}}{2}\right ) \, dx+\int \left (\frac {x}{2}+\frac {x^2}{2}-\frac {1}{2} x \sqrt {1+x^2}\right ) \, dx\\ &=\frac {x}{2}+\frac {x^2}{2}+\frac {x^3}{6}-\frac {1}{2} \int \sqrt {1+x^2} \, dx-\frac {1}{2} \int x \sqrt {1+x^2} \, dx-\frac {1}{2} \operatorname {Subst}\left (\int \left (\frac {1}{1-x}+\frac {1}{(-1+x)^2}+\frac {2}{x}\right ) \, dx,x,1+x+\sqrt {1+x^2}\right )\\ &=\frac {x}{2}+\frac {x^2}{2}+\frac {x^3}{6}-\frac {1}{4} x \sqrt {1+x^2}-\frac {1}{6} \left (1+x^2\right )^{3/2}+\frac {1}{2 \left (x+\sqrt {1+x^2}\right )}+\frac {1}{2} \log \left (x+\sqrt {1+x^2}\right )-\log \left (1+x+\sqrt {1+x^2}\right )-\frac {1}{4} \int \frac {1}{\sqrt {1+x^2}} \, dx\\ &=\frac {x}{2}+\frac {x^2}{2}+\frac {x^3}{6}-\frac {1}{4} x \sqrt {1+x^2}-\frac {1}{6} \left (1+x^2\right )^{3/2}+\frac {1}{2 \left (x+\sqrt {1+x^2}\right )}-\frac {1}{4} \sinh ^{-1}(x)+\frac {1}{2} \log \left (x+\sqrt {1+x^2}\right )-\log \left (1+x+\sqrt {1+x^2}\right )\\ \end {align*}
________________________________________________________________________________________
Mathematica [A] time = 0.15, size = 88, normalized size = 1.66 \[ \frac {1}{12} \left (2 x^3+6 x^2-2 \left (x^2+1\right )^{3/2}+6 \left (\frac {1}{\sqrt {x^2+1}+x}+\log \left (\sqrt {x^2+1}+x\right )-2 \log \left (\sqrt {x^2+1}+x+1\right )\right )-3 \left (\sqrt {x^2+1} x+\sinh ^{-1}(x)\right )+6 x\right ) \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
fricas [A] time = 0.41, size = 78, normalized size = 1.47 \[ \frac {1}{6} \, x^{3} + \frac {1}{2} \, x^{2} - \frac {1}{12} \, {\left (2 \, x^{2} + 3 \, x - 4\right )} \sqrt {x^{2} + 1} - \frac {1}{2} \, \log \relax (x) - \frac {1}{2} \, \log \left (-x + \sqrt {x^{2} + 1} + 1\right ) + \frac {1}{4} \, \log \left (-x + \sqrt {x^{2} + 1}\right ) + \frac {1}{2} \, \log \left (-x + \sqrt {x^{2} + 1} - 1\right ) \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [A] time = 0.44, size = 80, normalized size = 1.51 \[ \frac {1}{6} \, x^{3} + \frac {1}{2} \, x^{2} - \frac {1}{12} \, {\left ({\left (2 \, x + 3\right )} x - 4\right )} \sqrt {x^{2} + 1} + \frac {1}{4} \, \log \left (-x + \sqrt {x^{2} + 1}\right ) - \frac {1}{2} \, \log \left ({\left | x \right |}\right ) - \frac {1}{2} \, \log \left ({\left | -x + \sqrt {x^{2} + 1} + 1 \right |}\right ) + \frac {1}{2} \, \log \left ({\left | -x + \sqrt {x^{2} + 1} - 1 \right |}\right ) \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [A] time = 0.01, size = 58, normalized size = 1.09 \[ \frac {x^{3}}{6}+\frac {x^{2}}{2}-\frac {\sqrt {x^{2}+1}\, x}{4}-\frac {\arcsinh \relax (x )}{4}-\frac {\arctanh \left (\frac {1}{\sqrt {x^{2}+1}}\right )}{2}-\frac {\ln \relax (x )}{2}+\frac {\sqrt {x^{2}+1}}{2}-\frac {\left (x^{2}+1\right )^{\frac {3}{2}}}{6} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maxima [F] time = 0.00, size = 0, normalized size = 0.00 \[ \frac {1}{4} \, x^{2} - \frac {3}{56} \, \sqrt {7} \arctan \left (\frac {1}{7} \, \sqrt {7} {\left (4 \, x + 3\right )}\right ) + \frac {1}{4} \, x + \int \frac {x^{4} + x^{3} - x^{2}}{4 \, x^{5} + 12 \, x^{4} + 19 \, x^{3} + 19 \, x^{2} + {\left (4 \, x^{4} + 12 \, x^{3} + 17 \, x^{2} + 12 \, x + 4\right )} \sqrt {x^{2} + 1} + 12 \, x + 4}\,{d x} - \frac {7}{16} \, \log \left (2 \, x^{2} + 3 \, x + 2\right ) \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [B] time = 0.04, size = 52, normalized size = 0.98 \[ \frac {x^2}{2}-\frac {\ln \relax (x)}{2}-\sqrt {x^2+1}\,\left (\frac {x^2}{6}+\frac {x}{4}-\frac {1}{3}\right )-\frac {\mathrm {asinh}\relax (x)}{4}+\frac {x^3}{6}+\frac {\mathrm {atan}\left (\sqrt {x^2+1}\,1{}\mathrm {i}\right )\,1{}\mathrm {i}}{2} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
sympy [F] time = 0.00, size = 0, normalized size = 0.00 \[ \int \frac {x^{2} + x - 1}{x + \sqrt {x^{2} + 1} + 1}\, dx \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________