\(\int \frac {2+x^2}{x (2-2 x+x^2) \sqrt [3]{1-x+x^2}} \, dx\) [1706]

   Optimal result
   Rubi [F]
   Mathematica [A] (verified)
   Maple [C] (verified)
   Fricas [A] (verification not implemented)
   Sympy [F]
   Maxima [F]
   Giac [F]
   Mupad [F(-1)]

Optimal result

Integrand size = 31, antiderivative size = 115 \[ \int \frac {2+x^2}{x \left (2-2 x+x^2\right ) \sqrt [3]{1-x+x^2}} \, dx=-\sqrt {3} \arctan \left (\frac {\frac {2}{\sqrt {3}}-\frac {2 x}{\sqrt {3}}+\frac {\sqrt [3]{1-x+x^2}}{\sqrt {3}}}{\sqrt [3]{1-x+x^2}}\right )+\log \left (-1+x+\sqrt [3]{1-x+x^2}\right )-\frac {1}{2} \log \left (1-2 x+x^2+(1-x) \sqrt [3]{1-x+x^2}+\left (1-x+x^2\right )^{2/3}\right ) \]

[Out]

-3^(1/2)*arctan((2/3*3^(1/2)-2/3*x*3^(1/2)+1/3*(x^2-x+1)^(1/3)*3^(1/2))/(x^2-x+1)^(1/3))+ln(-1+x+(x^2-x+1)^(1/
3))-1/2*ln(1-2*x+x^2+(1-x)*(x^2-x+1)^(1/3)+(x^2-x+1)^(2/3))

Rubi [F]

\[ \int \frac {2+x^2}{x \left (2-2 x+x^2\right ) \sqrt [3]{1-x+x^2}} \, dx=\int \frac {2+x^2}{x \left (2-2 x+x^2\right ) \sqrt [3]{1-x+x^2}} \, dx \]

[In]

Int[(2 + x^2)/(x*(2 - 2*x + x^2)*(1 - x + x^2)^(1/3)),x]

[Out]

(-3*(-((1 - I*Sqrt[3] - 2*x)/x))^(1/3)*(-((1 + I*Sqrt[3] - 2*x)/x))^(1/3)*AppellF1[2/3, 1/3, 1/3, 5/3, (1 - I*
Sqrt[3])/(2*x), (1 + I*Sqrt[3])/(2*x)])/(2*2^(2/3)*(1 - x + x^2)^(1/3)) + 2*Defer[Int][1/((2 - 2*x + x^2)*(1 -
 x + x^2)^(1/3)), x]

Rubi steps \begin{align*} \text {integral}& = \int \left (\frac {1}{x \sqrt [3]{1-x+x^2}}+\frac {2}{\left (2-2 x+x^2\right ) \sqrt [3]{1-x+x^2}}\right ) \, dx \\ & = 2 \int \frac {1}{\left (2-2 x+x^2\right ) \sqrt [3]{1-x+x^2}} \, dx+\int \frac {1}{x \sqrt [3]{1-x+x^2}} \, dx \\ & = 2 \int \frac {1}{\left (2-2 x+x^2\right ) \sqrt [3]{1-x+x^2}} \, dx-\frac {\left (\sqrt [3]{\frac {-1-i \sqrt {3}+2 x}{x}} \sqrt [3]{\frac {-1+i \sqrt {3}+2 x}{x}}\right ) \text {Subst}\left (\int \frac {1}{\sqrt [3]{x} \sqrt [3]{1-\frac {1}{2} \left (1-i \sqrt {3}\right ) x} \sqrt [3]{1-\frac {1}{2} \left (1+i \sqrt {3}\right ) x}} \, dx,x,\frac {1}{x}\right )}{2^{2/3} \left (\frac {1}{x}\right )^{2/3} \sqrt [3]{1-x+x^2}} \\ & = -\frac {3 \sqrt [3]{-\frac {1-i \sqrt {3}-2 x}{x}} \sqrt [3]{-\frac {1+i \sqrt {3}-2 x}{x}} \operatorname {AppellF1}\left (\frac {2}{3},\frac {1}{3},\frac {1}{3},\frac {5}{3},\frac {1-i \sqrt {3}}{2 x},\frac {1+i \sqrt {3}}{2 x}\right )}{2\ 2^{2/3} \sqrt [3]{1-x+x^2}}+2 \int \frac {1}{\left (2-2 x+x^2\right ) \sqrt [3]{1-x+x^2}} \, dx \\ \end{align*}

Mathematica [A] (verified)

Time = 0.12 (sec) , antiderivative size = 102, normalized size of antiderivative = 0.89 \[ \int \frac {2+x^2}{x \left (2-2 x+x^2\right ) \sqrt [3]{1-x+x^2}} \, dx=-\sqrt {3} \arctan \left (\frac {2-2 x+\sqrt [3]{1-x+x^2}}{\sqrt {3} \sqrt [3]{1-x+x^2}}\right )+\log \left (-1+x+\sqrt [3]{1-x+x^2}\right )-\frac {1}{2} \log \left (1-2 x+x^2-(-1+x) \sqrt [3]{1-x+x^2}+\left (1-x+x^2\right )^{2/3}\right ) \]

[In]

Integrate[(2 + x^2)/(x*(2 - 2*x + x^2)*(1 - x + x^2)^(1/3)),x]

[Out]

-(Sqrt[3]*ArcTan[(2 - 2*x + (1 - x + x^2)^(1/3))/(Sqrt[3]*(1 - x + x^2)^(1/3))]) + Log[-1 + x + (1 - x + x^2)^
(1/3)] - Log[1 - 2*x + x^2 - (-1 + x)*(1 - x + x^2)^(1/3) + (1 - x + x^2)^(2/3)]/2

Maple [C] (verified)

Result contains higher order function than in optimal. Order 9 vs. order 3.

Time = 1.05 (sec) , antiderivative size = 705, normalized size of antiderivative = 6.13

method result size
trager \(\text {Expression too large to display}\) \(705\)

[In]

int((x^2+2)/x/(x^2-2*x+2)/(x^2-x+1)^(1/3),x,method=_RETURNVERBOSE)

[Out]

RootOf(_Z^2+_Z+1)*ln((RootOf(_Z^2+_Z+1)*(x^2-x+1)^(2/3)*x-RootOf(_Z^2+_Z+1)*(x^2-x+1)^(1/3)*x^2+RootOf(_Z^2+_Z
+1)*x^3-RootOf(_Z^2+_Z+1)*(x^2-x+1)^(2/3)+2*RootOf(_Z^2+_Z+1)*(x^2-x+1)^(1/3)*x-3*RootOf(_Z^2+_Z+1)*x^2+2*x*(x
^2-x+1)^(2/3)-2*(x^2-x+1)^(1/3)*x^2+x^3-(x^2-x+1)^(1/3)*RootOf(_Z^2+_Z+1)+3*RootOf(_Z^2+_Z+1)*x-2*(x^2-x+1)^(2
/3)+4*(x^2-x+1)^(1/3)*x-4*x^2-RootOf(_Z^2+_Z+1)-2*(x^2-x+1)^(1/3)+4*x-2)/x/(x^2-2*x+2))-ln(-(RootOf(_Z^2+_Z+1)
*(x^2-x+1)^(2/3)*x-RootOf(_Z^2+_Z+1)*(x^2-x+1)^(1/3)*x^2+RootOf(_Z^2+_Z+1)*x^3-RootOf(_Z^2+_Z+1)*(x^2-x+1)^(2/
3)+2*RootOf(_Z^2+_Z+1)*(x^2-x+1)^(1/3)*x-3*RootOf(_Z^2+_Z+1)*x^2-x*(x^2-x+1)^(2/3)+(x^2-x+1)^(1/3)*x^2-(x^2-x+
1)^(1/3)*RootOf(_Z^2+_Z+1)+3*RootOf(_Z^2+_Z+1)*x+(x^2-x+1)^(2/3)-2*(x^2-x+1)^(1/3)*x+x^2-RootOf(_Z^2+_Z+1)+(x^
2-x+1)^(1/3)-x+1)/x/(x^2-2*x+2))*RootOf(_Z^2+_Z+1)-ln(-(RootOf(_Z^2+_Z+1)*(x^2-x+1)^(2/3)*x-RootOf(_Z^2+_Z+1)*
(x^2-x+1)^(1/3)*x^2+RootOf(_Z^2+_Z+1)*x^3-RootOf(_Z^2+_Z+1)*(x^2-x+1)^(2/3)+2*RootOf(_Z^2+_Z+1)*(x^2-x+1)^(1/3
)*x-3*RootOf(_Z^2+_Z+1)*x^2-x*(x^2-x+1)^(2/3)+(x^2-x+1)^(1/3)*x^2-(x^2-x+1)^(1/3)*RootOf(_Z^2+_Z+1)+3*RootOf(_
Z^2+_Z+1)*x+(x^2-x+1)^(2/3)-2*(x^2-x+1)^(1/3)*x+x^2-RootOf(_Z^2+_Z+1)+(x^2-x+1)^(1/3)-x+1)/x/(x^2-2*x+2))

Fricas [A] (verification not implemented)

none

Time = 0.70 (sec) , antiderivative size = 147, normalized size of antiderivative = 1.28 \[ \int \frac {2+x^2}{x \left (2-2 x+x^2\right ) \sqrt [3]{1-x+x^2}} \, dx=-\sqrt {3} \arctan \left (\frac {4 \, \sqrt {3} {\left (x^{2} - x + 1\right )}^{\frac {2}{3}} {\left (x - 1\right )} + 2 \, \sqrt {3} {\left (x^{2} - x + 1\right )}^{\frac {1}{3}} {\left (x^{2} - 2 \, x + 1\right )} + \sqrt {3} {\left (x^{3} - 3 \, x^{2} + 3 \, x - 1\right )}}{x^{3} - 11 \, x^{2} + 11 \, x - 9}\right ) + \frac {1}{2} \, \log \left (\frac {x^{3} - 2 \, x^{2} + 3 \, {\left (x^{2} - x + 1\right )}^{\frac {2}{3}} {\left (x - 1\right )} + 3 \, {\left (x^{2} - x + 1\right )}^{\frac {1}{3}} {\left (x^{2} - 2 \, x + 1\right )} + 2 \, x}{x^{3} - 2 \, x^{2} + 2 \, x}\right ) \]

[In]

integrate((x^2+2)/x/(x^2-2*x+2)/(x^2-x+1)^(1/3),x, algorithm="fricas")

[Out]

-sqrt(3)*arctan((4*sqrt(3)*(x^2 - x + 1)^(2/3)*(x - 1) + 2*sqrt(3)*(x^2 - x + 1)^(1/3)*(x^2 - 2*x + 1) + sqrt(
3)*(x^3 - 3*x^2 + 3*x - 1))/(x^3 - 11*x^2 + 11*x - 9)) + 1/2*log((x^3 - 2*x^2 + 3*(x^2 - x + 1)^(2/3)*(x - 1)
+ 3*(x^2 - x + 1)^(1/3)*(x^2 - 2*x + 1) + 2*x)/(x^3 - 2*x^2 + 2*x))

Sympy [F]

\[ \int \frac {2+x^2}{x \left (2-2 x+x^2\right ) \sqrt [3]{1-x+x^2}} \, dx=\int \frac {x^{2} + 2}{x \left (x^{2} - 2 x + 2\right ) \sqrt [3]{x^{2} - x + 1}}\, dx \]

[In]

integrate((x**2+2)/x/(x**2-2*x+2)/(x**2-x+1)**(1/3),x)

[Out]

Integral((x**2 + 2)/(x*(x**2 - 2*x + 2)*(x**2 - x + 1)**(1/3)), x)

Maxima [F]

\[ \int \frac {2+x^2}{x \left (2-2 x+x^2\right ) \sqrt [3]{1-x+x^2}} \, dx=\int { \frac {x^{2} + 2}{{\left (x^{2} - x + 1\right )}^{\frac {1}{3}} {\left (x^{2} - 2 \, x + 2\right )} x} \,d x } \]

[In]

integrate((x^2+2)/x/(x^2-2*x+2)/(x^2-x+1)^(1/3),x, algorithm="maxima")

[Out]

integrate((x^2 + 2)/((x^2 - x + 1)^(1/3)*(x^2 - 2*x + 2)*x), x)

Giac [F]

\[ \int \frac {2+x^2}{x \left (2-2 x+x^2\right ) \sqrt [3]{1-x+x^2}} \, dx=\int { \frac {x^{2} + 2}{{\left (x^{2} - x + 1\right )}^{\frac {1}{3}} {\left (x^{2} - 2 \, x + 2\right )} x} \,d x } \]

[In]

integrate((x^2+2)/x/(x^2-2*x+2)/(x^2-x+1)^(1/3),x, algorithm="giac")

[Out]

integrate((x^2 + 2)/((x^2 - x + 1)^(1/3)*(x^2 - 2*x + 2)*x), x)

Mupad [F(-1)]

Timed out. \[ \int \frac {2+x^2}{x \left (2-2 x+x^2\right ) \sqrt [3]{1-x+x^2}} \, dx=\int \frac {x^2+2}{x\,{\left (x^2-x+1\right )}^{1/3}\,\left (x^2-2\,x+2\right )} \,d x \]

[In]

int((x^2 + 2)/(x*(x^2 - x + 1)^(1/3)*(x^2 - 2*x + 2)),x)

[Out]

int((x^2 + 2)/(x*(x^2 - x + 1)^(1/3)*(x^2 - 2*x + 2)), x)