Optimal. Leaf size=87 \[ -\frac {7}{4} \sqrt {2+x+x^2}+\frac {1}{2} x \sqrt {2+x+x^2}-\frac {1}{8} \sinh ^{-1}\left (\frac {1+2 x}{\sqrt {7}}\right )+\frac {\tan ^{-1}\left (\frac {1+2 x}{\sqrt {3} \sqrt {2+x+x^2}}\right )}{\sqrt {3}}-\tanh ^{-1}\left (\sqrt {2+x+x^2}\right ) \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.15, antiderivative size = 87, normalized size of antiderivative = 1.00, number of steps
used = 14, number of rules used = 10, integrand size = 24, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.417, Rules used = {6860, 654,
633, 221, 756, 1039, 996, 210, 1038, 212} \begin {gather*} \frac {\text {ArcTan}\left (\frac {2 x+1}{\sqrt {3} \sqrt {x^2+x+2}}\right )}{\sqrt {3}}+\frac {1}{2} \sqrt {x^2+x+2} x-\frac {7}{4} \sqrt {x^2+x+2}-\tanh ^{-1}\left (\sqrt {x^2+x+2}\right )-\frac {1}{8} \sinh ^{-1}\left (\frac {2 x+1}{\sqrt {7}}\right ) \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 210
Rule 212
Rule 221
Rule 633
Rule 654
Rule 756
Rule 996
Rule 1038
Rule 1039
Rule 6860
Rubi steps
\begin {align*} \int \frac {1+x^4}{\left (1+x+x^2\right ) \sqrt {2+x+x^2}} \, dx &=\int \left (-\frac {x}{\sqrt {2+x+x^2}}+\frac {x^2}{\sqrt {2+x+x^2}}+\frac {1+x}{\left (1+x+x^2\right ) \sqrt {2+x+x^2}}\right ) \, dx\\ &=-\int \frac {x}{\sqrt {2+x+x^2}} \, dx+\int \frac {x^2}{\sqrt {2+x+x^2}} \, dx+\int \frac {1+x}{\left (1+x+x^2\right ) \sqrt {2+x+x^2}} \, dx\\ &=-\sqrt {2+x+x^2}+\frac {1}{2} x \sqrt {2+x+x^2}+\frac {1}{2} \int \frac {1}{\sqrt {2+x+x^2}} \, dx+\frac {1}{2} \int \frac {-2-\frac {3 x}{2}}{\sqrt {2+x+x^2}} \, dx+\frac {1}{2} \int \frac {1}{\left (1+x+x^2\right ) \sqrt {2+x+x^2}} \, dx+\frac {1}{2} \int \frac {1+2 x}{\left (1+x+x^2\right ) \sqrt {2+x+x^2}} \, dx\\ &=-\frac {7}{4} \sqrt {2+x+x^2}+\frac {1}{2} x \sqrt {2+x+x^2}-\frac {5}{8} \int \frac {1}{\sqrt {2+x+x^2}} \, dx+\frac {\text {Subst}\left (\int \frac {1}{\sqrt {1+\frac {x^2}{7}}} \, dx,x,1+2 x\right )}{2 \sqrt {7}}-\text {Subst}\left (\int \frac {1}{-3-x^2} \, dx,x,\frac {1+2 x}{\sqrt {2+x+x^2}}\right )-\text {Subst}\left (\int \frac {1}{1-x^2} \, dx,x,\sqrt {2+x+x^2}\right )\\ &=-\frac {7}{4} \sqrt {2+x+x^2}+\frac {1}{2} x \sqrt {2+x+x^2}+\frac {1}{2} \sinh ^{-1}\left (\frac {1+2 x}{\sqrt {7}}\right )+\frac {\tan ^{-1}\left (\frac {1+2 x}{\sqrt {3} \sqrt {2+x+x^2}}\right )}{\sqrt {3}}-\tanh ^{-1}\left (\sqrt {2+x+x^2}\right )-\frac {5 \text {Subst}\left (\int \frac {1}{\sqrt {1+\frac {x^2}{7}}} \, dx,x,1+2 x\right )}{8 \sqrt {7}}\\ &=-\frac {7}{4} \sqrt {2+x+x^2}+\frac {1}{2} x \sqrt {2+x+x^2}-\frac {1}{8} \sinh ^{-1}\left (\frac {1+2 x}{\sqrt {7}}\right )+\frac {\tan ^{-1}\left (\frac {1+2 x}{\sqrt {3} \sqrt {2+x+x^2}}\right )}{\sqrt {3}}-\tanh ^{-1}\left (\sqrt {2+x+x^2}\right )\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.37, size = 95, normalized size = 1.09 \begin {gather*} -\frac {\tan ^{-1}\left (\frac {2+2 x+2 x^2-(1+2 x) \sqrt {2+x+x^2}}{\sqrt {3}}\right )}{\sqrt {3}}-\tanh ^{-1}\left (\sqrt {2+x+x^2}\right )+\frac {1}{8} \left (2 (-7+2 x) \sqrt {2+x+x^2}+\log \left (-1-2 x+2 \sqrt {2+x+x^2}\right )\right ) \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 1.54, size = 69, normalized size = 0.79
method | result | size |
risch | \(\frac {\left (2 x -7\right ) \sqrt {x^{2}+x +2}}{4}-\frac {\arcsinh \left (\frac {2 \sqrt {7}\, \left (x +\frac {1}{2}\right )}{7}\right )}{8}-\arctanh \left (\sqrt {x^{2}+x +2}\right )+\frac {\arctan \left (\frac {\left (1+2 x \right ) \sqrt {3}}{3 \sqrt {x^{2}+x +2}}\right ) \sqrt {3}}{3}\) | \(63\) |
default | \(\frac {x \sqrt {x^{2}+x +2}}{2}-\frac {7 \sqrt {x^{2}+x +2}}{4}-\frac {\arcsinh \left (\frac {2 \sqrt {7}\, \left (x +\frac {1}{2}\right )}{7}\right )}{8}-\arctanh \left (\sqrt {x^{2}+x +2}\right )+\frac {\arctan \left (\frac {\left (1+2 x \right ) \sqrt {3}}{3 \sqrt {x^{2}+x +2}}\right ) \sqrt {3}}{3}\) | \(69\) |
trager | \(\text {Expression too large to display}\) | \(1101\) |
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 [B] Leaf count of result is larger than twice the leaf count of optimal. 147 vs.
\(2 (70) = 140\).
time = 0.58, size = 147, normalized size = 1.69 \begin {gather*} \frac {1}{4} \, \sqrt {x^{2} + x + 2} {\left (2 \, x - 7\right )} - \frac {1}{3} \, \sqrt {3} \arctan \left (-\frac {1}{3} \, \sqrt {3} {\left (2 \, x + 3\right )} + \frac {2}{3} \, \sqrt {3} \sqrt {x^{2} + x + 2}\right ) + \frac {1}{3} \, \sqrt {3} \arctan \left (-\frac {1}{3} \, \sqrt {3} {\left (2 \, x - 1\right )} + \frac {2}{3} \, \sqrt {3} \sqrt {x^{2} + x + 2}\right ) + \frac {1}{2} \, \log \left (2 \, x^{2} - \sqrt {x^{2} + x + 2} {\left (2 \, x + 3\right )} + 4 \, x + 5\right ) - \frac {1}{2} \, \log \left (2 \, x^{2} - \sqrt {x^{2} + x + 2} {\left (2 \, x - 1\right )} + 3\right ) + \frac {1}{8} \, \log \left (-2 \, x + 2 \, \sqrt {x^{2} + x + 2} - 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^{4} + 1}{\left (x^{2} + x + 1\right ) \sqrt {x^{2} + x + 2}}\, dx \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [B] Leaf count of result is larger than twice the leaf count of optimal. 148 vs.
\(2 (70) = 140\).
time = 0.84, size = 148, normalized size = 1.70 \begin {gather*} \frac {1}{4} \, \sqrt {x^{2} + x + 2} {\left (2 \, x - 7\right )} - \frac {1}{3} \, \sqrt {3} \arctan \left (-\frac {1}{3} \, \sqrt {3} {\left (2 \, x - 2 \, \sqrt {x^{2} + x + 2} + 3\right )}\right ) + \frac {1}{3} \, \sqrt {3} \arctan \left (-\frac {1}{3} \, \sqrt {3} {\left (2 \, x - 2 \, \sqrt {x^{2} + x + 2} - 1\right )}\right ) + \frac {1}{2} \, \log \left ({\left (x - \sqrt {x^{2} + x + 2}\right )}^{2} + 3 \, x - 3 \, \sqrt {x^{2} + x + 2} + 3\right ) - \frac {1}{2} \, \log \left ({\left (x - \sqrt {x^{2} + x + 2}\right )}^{2} - x + \sqrt {x^{2} + x + 2} + 1\right ) + \frac {1}{8} \, \log \left (-2 \, x + 2 \, \sqrt {x^{2} + x + 2} - 1\right ) \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [F]
time = 0.00, size = -1, normalized size = -0.01 \begin {gather*} \int \frac {x^4+1}{\left (x^2+x+1\right )\,\sqrt {x^2+x+2}} \,d x \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________