Integrand size = 24, antiderivative size = 87 \[ \int \frac {1+x^4}{\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 {1}{8} \text {arcsinh}\left (\frac {1+2 x}{\sqrt {7}}\right )+\frac {\arctan \left (\frac {1+2 x}{\sqrt {3} \sqrt {2+x+x^2}}\right )}{\sqrt {3}}-\text {arctanh}\left (\sqrt {2+x+x^2}\right ) \]
[Out]
Time = 0.16 (sec) , antiderivative size = 87, normalized size of antiderivative = 1.00, number of steps used = 14, number of rules used = 10, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.417, Rules used = {6860, 654, 633, 221, 756, 1039, 996, 210, 1038, 212} \[ \int \frac {1+x^4}{\left (1+x+x^2\right ) \sqrt {2+x+x^2}} \, dx=-\frac {1}{8} \text {arcsinh}\left (\frac {2 x+1}{\sqrt {7}}\right )+\frac {\arctan \left (\frac {2 x+1}{\sqrt {3} \sqrt {x^2+x+2}}\right )}{\sqrt {3}}-\text {arctanh}\left (\sqrt {x^2+x+2}\right )+\frac {1}{2} \sqrt {x^2+x+2} x-\frac {7}{4} \sqrt {x^2+x+2} \]
[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*} \text {integral}& = \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} \text {arcsinh}\left (\frac {1+2 x}{\sqrt {7}}\right )+\frac {\arctan \left (\frac {1+2 x}{\sqrt {3} \sqrt {2+x+x^2}}\right )}{\sqrt {3}}-\text {arctanh}\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} \text {arcsinh}\left (\frac {1+2 x}{\sqrt {7}}\right )+\frac {\arctan \left (\frac {1+2 x}{\sqrt {3} \sqrt {2+x+x^2}}\right )}{\sqrt {3}}-\text {arctanh}\left (\sqrt {2+x+x^2}\right ) \\ \end{align*}
Time = 0.54 (sec) , antiderivative size = 95, normalized size of antiderivative = 1.09 \[ \int \frac {1+x^4}{\left (1+x+x^2\right ) \sqrt {2+x+x^2}} \, dx=-\frac {\arctan \left (\frac {2+2 x+2 x^2-(1+2 x) \sqrt {2+x+x^2}}{\sqrt {3}}\right )}{\sqrt {3}}-\text {arctanh}\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 ) \]
[In]
[Out]
Time = 1.82 (sec) , antiderivative size = 63, normalized size of antiderivative = 0.72
method | result | size |
risch | \(\frac {\left (2 x -7\right ) \sqrt {x^{2}+x +2}}{4}-\frac {\operatorname {arcsinh}\left (\frac {2 \sqrt {7}\, \left (x +\frac {1}{2}\right )}{7}\right )}{8}-\operatorname {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 {\operatorname {arcsinh}\left (\frac {2 \sqrt {7}\, \left (x +\frac {1}{2}\right )}{7}\right )}{8}-\operatorname {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\) |
[In]
[Out]
Leaf count of result is larger than twice the leaf count of optimal. 147 vs. \(2 (70) = 140\).
Time = 0.25 (sec) , antiderivative size = 147, normalized size of antiderivative = 1.69 \[ \int \frac {1+x^4}{\left (1+x+x^2\right ) \sqrt {2+x+x^2}} \, dx=\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 ) \]
[In]
[Out]
\[ \int \frac {1+x^4}{\left (1+x+x^2\right ) \sqrt {2+x+x^2}} \, dx=\int \frac {x^{4} + 1}{\left (x^{2} + x + 1\right ) \sqrt {x^{2} + x + 2}}\, dx \]
[In]
[Out]
\[ \int \frac {1+x^4}{\left (1+x+x^2\right ) \sqrt {2+x+x^2}} \, dx=\int { \frac {x^{4} + 1}{\sqrt {x^{2} + x + 2} {\left (x^{2} + x + 1\right )}} \,d x } \]
[In]
[Out]
Leaf count of result is larger than twice the leaf count of optimal. 148 vs. \(2 (70) = 140\).
Time = 0.30 (sec) , antiderivative size = 148, normalized size of antiderivative = 1.70 \[ \int \frac {1+x^4}{\left (1+x+x^2\right ) \sqrt {2+x+x^2}} \, dx=\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 ) \]
[In]
[Out]
Timed out. \[ \int \frac {1+x^4}{\left (1+x+x^2\right ) \sqrt {2+x+x^2}} \, dx=\int \frac {x^4+1}{\left (x^2+x+1\right )\,\sqrt {x^2+x+2}} \,d x \]
[In]
[Out]