Optimal. Leaf size=136 \[ \frac {8 x}{9}-\frac {x^2}{6}+\frac {8 \sqrt {1+x^2}}{9}-\frac {1}{6} x \sqrt {1+x^2}-\frac {41}{54} \sinh ^{-1}(x)+\frac {4}{27} \sqrt {2} \tan ^{-1}\left (\frac {1+3 x}{2 \sqrt {2}}\right )+\frac {4}{27} \sqrt {2} \tan ^{-1}\left (\frac {1+x}{\sqrt {2} \sqrt {1+x^2}}\right )+\frac {7}{27} \tanh ^{-1}\left (\frac {1-x}{2 \sqrt {1+x^2}}\right )-\frac {7}{54} \log \left (3+2 x+3 x^2\right ) \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 1.06, antiderivative size = 136, normalized size of antiderivative = 1.00, number of steps
used = 32, number of rules used = 14, integrand size = 44, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.318, Rules used = {6874, 201,
221, 648, 632, 210, 642, 1034, 12, 1095, 1051, 1045, 212, 267} \begin {gather*} \frac {4}{27} \sqrt {2} \text {ArcTan}\left (\frac {x+1}{\sqrt {2} \sqrt {x^2+1}}\right )+\frac {4}{27} \sqrt {2} \text {ArcTan}\left (\frac {3 x+1}{2 \sqrt {2}}\right )-\frac {x^2}{6}-\frac {1}{6} \sqrt {x^2+1} x+\frac {8 \sqrt {x^2+1}}{9}-\frac {7}{54} \log \left (3 x^2+2 x+3\right )+\frac {7}{27} \tanh ^{-1}\left (\frac {1-x}{2 \sqrt {x^2+1}}\right )+\frac {8 x}{9}-\frac {41}{54} \sinh ^{-1}(x) \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 12
Rule 201
Rule 210
Rule 212
Rule 221
Rule 267
Rule 632
Rule 642
Rule 648
Rule 1034
Rule 1045
Rule 1051
Rule 1095
Rule 6874
Rubi steps
\begin {align*} \int \frac {x^2 \left (2-\sqrt {1+x^2}\right )}{\sqrt {1+x^2} \left (1-x^3+\left (1+x^2\right )^{3/2}\right )} \, dx &=\int \left (-\frac {x^2}{1-x^3+\sqrt {1+x^2}+x^2 \sqrt {1+x^2}}-\frac {2 x^2}{\sqrt {1+x^2} \left (-1+x^3-\left (1+x^2\right )^{3/2}\right )}\right ) \, dx\\ &=-\left (2 \int \frac {x^2}{\sqrt {1+x^2} \left (-1+x^3-\left (1+x^2\right )^{3/2}\right )} \, dx\right )-\int \frac {x^2}{1-x^3+\sqrt {1+x^2}+x^2 \sqrt {1+x^2}} \, dx\\ &=-\left (2 \int \left (-\frac {1}{3}+\frac {2}{9 \sqrt {1+x^2}}-\frac {x}{3 \sqrt {1+x^2}}+\frac {2 x}{3 \left (3+2 x+3 x^2\right )}+\frac {3+5 x}{9 \sqrt {1+x^2} \left (3+2 x+3 x^2\right )}\right ) \, dx\right )-\int \left (-\frac {2}{9}+\frac {x}{3}+\frac {\sqrt {1+x^2}}{3}+\frac {-3-5 x}{9 \left (3+2 x+3 x^2\right )}-\frac {2 x \sqrt {1+x^2}}{3 \left (3+2 x+3 x^2\right )}\right ) \, dx\\ &=\frac {8 x}{9}-\frac {x^2}{6}-\frac {1}{9} \int \frac {-3-5 x}{3+2 x+3 x^2} \, dx-\frac {2}{9} \int \frac {3+5 x}{\sqrt {1+x^2} \left (3+2 x+3 x^2\right )} \, dx-\frac {1}{3} \int \sqrt {1+x^2} \, dx-\frac {4}{9} \int \frac {1}{\sqrt {1+x^2}} \, dx+\frac {2}{3} \int \frac {x}{\sqrt {1+x^2}} \, dx+\frac {2}{3} \int \frac {x \sqrt {1+x^2}}{3+2 x+3 x^2} \, dx-\frac {4}{3} \int \frac {x}{3+2 x+3 x^2} \, dx\\ &=\frac {8 x}{9}-\frac {x^2}{6}+\frac {8 \sqrt {1+x^2}}{9}-\frac {1}{6} x \sqrt {1+x^2}-\frac {4}{9} \sinh ^{-1}(x)+\frac {1}{18} \int \frac {4-4 x}{\sqrt {1+x^2} \left (3+2 x+3 x^2\right )} \, dx-\frac {1}{18} \int \frac {16+16 x}{\sqrt {1+x^2} \left (3+2 x+3 x^2\right )} \, dx+\frac {5}{54} \int \frac {2+6 x}{3+2 x+3 x^2} \, dx+\frac {4}{27} \int \frac {1}{3+2 x+3 x^2} \, dx-\frac {1}{6} \int \frac {1}{\sqrt {1+x^2}} \, dx-\frac {2}{9} \int \frac {2+6 x}{3+2 x+3 x^2} \, dx+\frac {2}{9} \int -\frac {2 x^2}{\sqrt {1+x^2} \left (3+2 x+3 x^2\right )} \, dx+\frac {4}{9} \int \frac {1}{3+2 x+3 x^2} \, dx\\ &=\frac {8 x}{9}-\frac {x^2}{6}+\frac {8 \sqrt {1+x^2}}{9}-\frac {1}{6} x \sqrt {1+x^2}-\frac {11}{18} \sinh ^{-1}(x)-\frac {7}{54} \log \left (3+2 x+3 x^2\right )-\frac {8}{27} \text {Subst}\left (\int \frac {1}{-32-x^2} \, dx,x,2+6 x\right )-\frac {4}{9} \int \frac {x^2}{\sqrt {1+x^2} \left (3+2 x+3 x^2\right )} \, dx-\frac {8}{9} \text {Subst}\left (\int \frac {1}{-32-x^2} \, dx,x,2+6 x\right )-\frac {128}{9} \text {Subst}\left (\int \frac {1}{-4096-2 x^2} \, dx,x,\frac {32+32 x}{\sqrt {1+x^2}}\right )-\frac {1024}{9} \text {Subst}\left (\int \frac {1}{32768-2 x^2} \, dx,x,\frac {-64+64 x}{\sqrt {1+x^2}}\right )\\ &=\frac {8 x}{9}-\frac {x^2}{6}+\frac {8 \sqrt {1+x^2}}{9}-\frac {1}{6} x \sqrt {1+x^2}-\frac {11}{18} \sinh ^{-1}(x)+\frac {4}{27} \sqrt {2} \tan ^{-1}\left (\frac {1+3 x}{2 \sqrt {2}}\right )+\frac {1}{9} \sqrt {2} \tan ^{-1}\left (\frac {1+x}{\sqrt {2} \sqrt {1+x^2}}\right )+\frac {4}{9} \tanh ^{-1}\left (\frac {1-x}{2 \sqrt {1+x^2}}\right )-\frac {7}{54} \log \left (3+2 x+3 x^2\right )-\frac {4}{27} \int \frac {1}{\sqrt {1+x^2}} \, dx-\frac {4}{27} \int \frac {-3-2 x}{\sqrt {1+x^2} \left (3+2 x+3 x^2\right )} \, dx\\ &=\frac {8 x}{9}-\frac {x^2}{6}+\frac {8 \sqrt {1+x^2}}{9}-\frac {1}{6} x \sqrt {1+x^2}-\frac {41}{54} \sinh ^{-1}(x)+\frac {4}{27} \sqrt {2} \tan ^{-1}\left (\frac {1+3 x}{2 \sqrt {2}}\right )+\frac {1}{9} \sqrt {2} \tan ^{-1}\left (\frac {1+x}{\sqrt {2} \sqrt {1+x^2}}\right )+\frac {4}{9} \tanh ^{-1}\left (\frac {1-x}{2 \sqrt {1+x^2}}\right )-\frac {7}{54} \log \left (3+2 x+3 x^2\right )-\frac {1}{27} \int \frac {-10-10 x}{\sqrt {1+x^2} \left (3+2 x+3 x^2\right )} \, dx+\frac {1}{27} \int \frac {2-2 x}{\sqrt {1+x^2} \left (3+2 x+3 x^2\right )} \, dx\\ &=\frac {8 x}{9}-\frac {x^2}{6}+\frac {8 \sqrt {1+x^2}}{9}-\frac {1}{6} x \sqrt {1+x^2}-\frac {41}{54} \sinh ^{-1}(x)+\frac {4}{27} \sqrt {2} \tan ^{-1}\left (\frac {1+3 x}{2 \sqrt {2}}\right )+\frac {1}{9} \sqrt {2} \tan ^{-1}\left (\frac {1+x}{\sqrt {2} \sqrt {1+x^2}}\right )+\frac {4}{9} \tanh ^{-1}\left (\frac {1-x}{2 \sqrt {1+x^2}}\right )-\frac {7}{54} \log \left (3+2 x+3 x^2\right )-\frac {64}{27} \text {Subst}\left (\int \frac {1}{-1024-2 x^2} \, dx,x,\frac {16+16 x}{\sqrt {1+x^2}}\right )-\frac {800}{27} \text {Subst}\left (\int \frac {1}{12800-2 x^2} \, dx,x,\frac {40-40 x}{\sqrt {1+x^2}}\right )\\ &=\frac {8 x}{9}-\frac {x^2}{6}+\frac {8 \sqrt {1+x^2}}{9}-\frac {1}{6} x \sqrt {1+x^2}-\frac {41}{54} \sinh ^{-1}(x)+\frac {4}{27} \sqrt {2} \tan ^{-1}\left (\frac {1+3 x}{2 \sqrt {2}}\right )+\frac {4}{27} \sqrt {2} \tan ^{-1}\left (\frac {1+x}{\sqrt {2} \sqrt {1+x^2}}\right )+\frac {7}{27} \tanh ^{-1}\left (\frac {1-x}{2 \sqrt {1+x^2}}\right )-\frac {7}{54} \log \left (3+2 x+3 x^2\right )\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.34, size = 104, normalized size = 0.76 \begin {gather*} \frac {1}{54} \left (48 x-9 x^2+48 \sqrt {1+x^2}-9 x \sqrt {1+x^2}+16 \sqrt {2} \tan ^{-1}\left (\frac {1+x-\sqrt {1+x^2}}{\sqrt {2}}\right )-55 \tanh ^{-1}\left (\frac {x}{\sqrt {1+x^2}}\right )-14 \log \left (-2-x-x^2+(1+x) \sqrt {1+x^2}\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. \(655\) vs.
\(2(99)=198\).
time = 0.03, size = 656, normalized size = 4.82 \[-\frac {x^{2}}{6}+\frac {8 x}{9}-\frac {7 \ln \left (3 x^{2}+2 x +3\right )}{54}+\frac {4 \sqrt {2}\, \arctan \left (\frac {\left (6 x +2\right ) \sqrt {2}}{8}\right )}{27}-\frac {41 \arcsinh \left (x \right )}{54}+\frac {\sqrt {2}\, \sqrt {\frac {2 \left (1+x \right )^{2}}{\left (1-x \right )^{2}}+2}\, \left (\sqrt {2}\, \arctan \left (\frac {\sqrt {2}\, \sqrt {\frac {2 \left (1+x \right )^{2}}{\left (1-x \right )^{2}}+2}\, \left (1+x \right )}{2 \left (\frac {\left (1+x \right )^{2}}{\left (1-x \right )^{2}}+1\right ) \left (1-x \right )}\right )-5 \arctanh \left (\sqrt {\frac {2 \left (1+x \right )^{2}}{\left (1-x \right )^{2}}+2}\right )\right )}{12 \sqrt {\frac {\frac {\left (1+x \right )^{2}}{\left (1-x \right )^{2}}+1}{\left (\frac {1+x}{1-x}+1\right )^{2}}}\, \left (\frac {1+x}{1-x}+1\right )}-\frac {3 \sqrt {2}\, \sqrt {\frac {2 \left (1+x \right )^{2}}{\left (1-x \right )^{2}}+2}\, \left (\sqrt {2}\, \arctan \left (\frac {\sqrt {2}\, \sqrt {\frac {2 \left (1+x \right )^{2}}{\left (1-x \right )^{2}}+2}\, \left (1+x \right )}{2 \left (\frac {\left (1+x \right )^{2}}{\left (1-x \right )^{2}}+1\right ) \left (1-x \right )}\right )-\arctanh \left (\sqrt {\frac {2 \left (1+x \right )^{2}}{\left (1-x \right )^{2}}+2}\right )\right )}{8 \sqrt {\frac {\frac {\left (1+x \right )^{2}}{\left (1-x \right )^{2}}+1}{\left (\frac {1+x}{1-x}+1\right )^{2}}}\, \left (\frac {1+x}{1-x}+1\right )}-\frac {x \sqrt {x^{2}+1}}{6}+\frac {8 \sqrt {x^{2}+1}}{9}+\frac {\sqrt {2}\, \sqrt {\frac {2 \left (1+x \right )^{2}}{\left (1-x \right )^{2}}+2}\, \left (13 \sqrt {2}\, \arctan \left (\frac {\sqrt {2}\, \sqrt {\frac {2 \left (1+x \right )^{2}}{\left (1-x \right )^{2}}+2}\, \left (1+x \right )}{2 \left (\frac {\left (1+x \right )^{2}}{\left (1-x \right )^{2}}+1\right ) \left (1-x \right )}\right )+43 \arctanh \left (\sqrt {\frac {2 \left (1+x \right )^{2}}{\left (1-x \right )^{2}}+2}\right )\right )}{216 \sqrt {\frac {\frac {\left (1+x \right )^{2}}{\left (1-x \right )^{2}}+1}{\left (\frac {1+x}{1-x}+1\right )^{2}}}\, \left (\frac {1+x}{1-x}+1\right )}+\frac {\sqrt {2}\, \sqrt {\frac {2 \left (1+x \right )^{2}}{\left (1-x \right )^{2}}+2}\, \left (11 \sqrt {2}\, \arctan \left (\frac {\sqrt {2}\, \sqrt {\frac {2 \left (1+x \right )^{2}}{\left (1-x \right )^{2}}+2}\, \left (1+x \right )}{2 \left (\frac {\left (1+x \right )^{2}}{\left (1-x \right )^{2}}+1\right ) \left (1-x \right )}\right )-\arctanh \left (\sqrt {\frac {2 \left (1+x \right )^{2}}{\left (1-x \right )^{2}}+2}\right )\right )}{36 \sqrt {\frac {\frac {\left (1+x \right )^{2}}{\left (1-x \right )^{2}}+1}{\left (\frac {1+x}{1-x}+1\right )^{2}}}\, \left (\frac {1+x}{1-x}+1\right )}\]
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.49, size = 170, normalized size = 1.25 \begin {gather*} -\frac {1}{6} \, x^{2} - \frac {1}{18} \, \sqrt {x^{2} + 1} {\left (3 \, x - 16\right )} + \frac {4}{27} \, \sqrt {2} \arctan \left (\frac {1}{4} \, \sqrt {2} {\left (3 \, x + 1\right )}\right ) + \frac {4}{27} \, \sqrt {2} \arctan \left (-\frac {1}{2} \, \sqrt {2} {\left (3 \, x - 1\right )} + \frac {3}{2} \, \sqrt {2} \sqrt {x^{2} + 1}\right ) - \frac {4}{27} \, \sqrt {2} \arctan \left (-\frac {1}{2} \, \sqrt {2} {\left (x + 1\right )} + \frac {1}{2} \, \sqrt {2} \sqrt {x^{2} + 1}\right ) + \frac {8}{9} \, x + \frac {7}{54} \, \log \left (3 \, x^{2} - \sqrt {x^{2} + 1} {\left (3 \, x - 1\right )} - x + 2\right ) - \frac {7}{54} \, \log \left (3 \, x^{2} + 2 \, x + 3\right ) - \frac {7}{54} \, \log \left (x^{2} - \sqrt {x^{2} + 1} {\left (x + 1\right )} + x + 2\right ) + \frac {41}{54} \, \log \left (-x + \sqrt {x^{2} + 1}\right ) \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F(-1)] Timed out
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Timed out} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A]
time = 0.57, size = 176, normalized size = 1.29 \begin {gather*} -\frac {1}{6} \, x^{2} - \frac {1}{18} \, \sqrt {x^{2} + 1} {\left (3 \, x - 16\right )} + \frac {4}{27} \, \sqrt {2} \arctan \left (-\frac {1}{2} \, \sqrt {2} {\left (3 \, x - 3 \, \sqrt {x^{2} + 1} - 1\right )}\right ) + \frac {4}{27} \, \sqrt {2} \arctan \left (\frac {1}{4} \, \sqrt {2} {\left (3 \, x + 1\right )}\right ) - \frac {4}{27} \, \sqrt {2} \arctan \left (-\frac {1}{2} \, \sqrt {2} {\left (x - \sqrt {x^{2} + 1} + 1\right )}\right ) + \frac {8}{9} \, x + \frac {7}{54} \, \log \left (3 \, {\left (x - \sqrt {x^{2} + 1}\right )}^{2} - 2 \, x + 2 \, \sqrt {x^{2} + 1} + 1\right ) - \frac {7}{54} \, \log \left ({\left (x - \sqrt {x^{2} + 1}\right )}^{2} + 2 \, x - 2 \, \sqrt {x^{2} + 1} + 3\right ) - \frac {7}{54} \, \log \left (3 \, x^{2} + 2 \, x + 3\right ) + \frac {41}{54} \, \log \left (-x + \sqrt {x^{2} + 1}\right ) \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 0.62, size = 216, normalized size = 1.59 \begin {gather*} \frac {8\,x}{9}-\frac {41\,\mathrm {asinh}\left (x\right )}{54}-\left (\frac {x}{6}-\frac {8}{9}\right )\,\sqrt {x^2+1}-\frac {x^2}{6}+\frac {\sqrt {2}\,\ln \left (x+\frac {1}{3}-\frac {\sqrt {2}\,2{}\mathrm {i}}{3}\right )\,\left (-\frac {16}{27}+\frac {\sqrt {2}\,14{}\mathrm {i}}{27}\right )\,1{}\mathrm {i}}{8}+\frac {\sqrt {2}\,\ln \left (x+\frac {1}{3}+\frac {\sqrt {2}\,2{}\mathrm {i}}{3}\right )\,\left (\frac {16}{27}+\frac {\sqrt {2}\,14{}\mathrm {i}}{27}\right )\,1{}\mathrm {i}}{8}+\frac {\sqrt {2}\,\left (\frac {4}{81}+\frac {\sqrt {2}\,44{}\mathrm {i}}{81}\right )\,\left (\ln \left (x+\frac {1}{3}+\frac {\sqrt {2}\,2{}\mathrm {i}}{3}\right )-\ln \left (1+\left (\frac {2}{3}+\frac {\sqrt {2}\,1{}\mathrm {i}}{3}\right )\,\sqrt {x^2+1}-\frac {x}{3}-\frac {\sqrt {2}\,x\,2{}\mathrm {i}}{3}\right )\right )\,1{}\mathrm {i}}{8\,\sqrt {{\left (\frac {1}{3}+\frac {\sqrt {2}\,2{}\mathrm {i}}{3}\right )}^2+1}}+\frac {\sqrt {2}\,\left (-\frac {4}{81}+\frac {\sqrt {2}\,44{}\mathrm {i}}{81}\right )\,\left (\ln \left (x+\frac {1}{3}-\frac {\sqrt {2}\,2{}\mathrm {i}}{3}\right )-\ln \left (1-\left (-\frac {2}{3}+\frac {\sqrt {2}\,1{}\mathrm {i}}{3}\right )\,\sqrt {x^2+1}-\frac {x}{3}+\frac {\sqrt {2}\,x\,2{}\mathrm {i}}{3}\right )\right )\,1{}\mathrm {i}}{8\,\sqrt {{\left (-\frac {1}{3}+\frac {\sqrt {2}\,2{}\mathrm {i}}{3}\right )}^2+1}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________