Optimal. Leaf size=53 \[ \frac {1}{12} \left (6 x^2+2 x^3+\left (4-3 x-2 x^2\right ) \sqrt {1+x^2}-3 \sinh ^{-1}(x)-6 \log \left (1+\sqrt {1+x^2}\right )\right ) \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.14, 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 = {6874, 2142,
907, 201, 221, 267} \begin {gather*} \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) \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 201
Rule 221
Rule 267
Rule 907
Rule 2142
Rule 6874
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} \text {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} \text {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 = 53, normalized size = 1.00 \begin {gather*} \frac {1}{12} \left (6 x^2+2 x^3+\left (4-3 x-2 x^2\right ) \sqrt {1+x^2}-3 \sinh ^{-1}(x)-6 \log \left (1+\sqrt {1+x^2}\right )\right ) \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.07, size = 58, normalized size = 1.09
method | result | size |
default | \(\frac {x^{2}}{2}-\frac {\ln \left (x \right )}{2}+\frac {x^{3}}{6}-\frac {x \sqrt {x^{2}+1}}{4}-\frac {\arcsinh \left (x \right )}{4}-\frac {\left (x^{2}+1\right )^{\frac {3}{2}}}{6}+\frac {\sqrt {x^{2}+1}}{2}-\frac {\arctanh \left (\frac {1}{\sqrt {x^{2}+1}}\right )}{2}\) | \(58\) |
trager | \(\frac {\left (x^{2}+4 x +4\right ) \left (-1+x \right )}{6}+\frac {\left (-\frac {1}{3} x^{2}-\frac {1}{2} x +\frac {2}{3}\right ) \sqrt {x^{2}+1}}{2}+\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 )}{4}\) | \(86\) |
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.36, size = 78, normalized size = 1.47 \begin {gather*} \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 \left (x\right ) - \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 ) \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 {x^{2} + x - 1}{x + \sqrt {x^{2} + 1} + 1}\, dx \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A]
time = 4.21, size = 80, normalized size = 1.51 \begin {gather*} \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 ) \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 0.04, size = 52, normalized size = 0.98 \begin {gather*} \frac {x^2}{2}-\frac {\ln \left (x\right )}{2}-\sqrt {x^2+1}\,\left (\frac {x^2}{6}+\frac {x}{4}-\frac {1}{3}\right )-\frac {\mathrm {asinh}\left (x\right )}{4}+\frac {x^3}{6}+\frac {\mathrm {atan}\left (\sqrt {x^2+1}\,1{}\mathrm {i}\right )\,1{}\mathrm {i}}{2} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________