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

Optimal result
Mathematica [A] (verified)
Rubi [A] (verified)
Maple [C] (warning: unable to verify)
Fricas [A] (verification not implemented)
Sympy [F]
Maxima [F]
Giac [F]
Mupad [F(-1)]
Reduce [F]

Optimal result

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

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

Mathematica [A] (verified)

Time = 0.68 (sec) , antiderivative size = 111, normalized size of antiderivative = 1.00 \[ \int \frac {(-1+x)^2 (1+x)}{x \left (1+x+x^2\right ) \sqrt [3]{-1+x^3}} \, dx=-\frac {3 \left (-1+x^3\right )^{2/3}}{1+x+x^2}-\sqrt {3} \arctan \left (\frac {\sqrt {3} \sqrt [3]{-1+x^3}}{-2+2 x+\sqrt [3]{-1+x^3}}\right )-\log \left (1-x+\sqrt [3]{-1+x^3}\right )+\frac {1}{2} \log \left (1-2 x+x^2+(-1+x) \sqrt [3]{-1+x^3}+\left (-1+x^3\right )^{2/3}\right ) \] Input:

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

Output:

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

Rubi [A] (verified)

Time = 0.44 (sec) , antiderivative size = 118, normalized size of antiderivative = 1.06, number of steps used = 2, number of rules used = 2, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.069, Rules used = {2582, 2009}

Below are the steps used by Rubi to obtain the solution. The rule number used for the transformation is given above next to the arrow. The rules definitions used are listed below.

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

\(\Big \downarrow \) 2582

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

\(\Big \downarrow \) 2009

\(\displaystyle \frac {\arctan \left (\frac {\frac {2 x}{\sqrt [3]{x^3-1}}+1}{\sqrt {3}}\right )}{\sqrt {3}}-\frac {\arctan \left (\frac {1-2 \sqrt [3]{x^3-1}}{\sqrt {3}}\right )}{\sqrt {3}}-\frac {3 x}{\sqrt [3]{x^3-1}}+\frac {3}{\sqrt [3]{x^3-1}}-\frac {1}{2} \log \left (\sqrt [3]{x^3-1}+1\right )-\frac {1}{2} \log \left (\sqrt [3]{x^3-1}-x\right )+\frac {\log (x)}{2}\)

Input:

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

Output:

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

Defintions of rubi rules used

rule 2009
Int[u_, x_Symbol] :> Simp[IntSum[u, x], x] /; SumQ[u]
 

rule 2582
Int[(Px_)*(x_)^(m_.)*((c_) + (d_.)*(x_) + (e_.)*(x_)^2)^(q_)*((a_) + (b_.)* 
(x_)^3)^(p_.), x_Symbol] :> Simp[1/c^q   Int[ExpandIntegrand[(c^3 - d^3*x^3 
)^q*(a + b*x^3)^p, x^m*(Px/(c - d*x)^q), x], x], x] /; FreeQ[{a, b, c, d, e 
, m, p}, x] && PolyQ[Px, x] && EqQ[d^2 - c*e, 0] && ILtQ[q, 0] && IntegerQ[ 
m] && RationalQ[p] && EqQ[Denominator[p], 3]
 
Maple [C] (warning: unable to verify)

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

Time = 1.11 (sec) , antiderivative size = 125, normalized size of antiderivative = 1.13

method result size
risch \(-\frac {3 \left (-1+x \right )}{\left (x^{3}-1\right )^{\frac {1}{3}}}+\frac {\sqrt {3}\, \Gamma \left (\frac {2}{3}\right ) {\left (-\operatorname {signum}\left (x^{3}-1\right )\right )}^{\frac {1}{3}} \left (\frac {2 \left (-\frac {\pi \sqrt {3}}{6}-\frac {3 \ln \left (3\right )}{2}+3 \ln \left (x \right )+i \pi \right ) \pi \sqrt {3}}{3 \Gamma \left (\frac {2}{3}\right )}+\frac {2 \pi \sqrt {3}\, x^{3} \operatorname {hypergeom}\left (\left [1, 1, \frac {4}{3}\right ], \left [2, 2\right ], x^{3}\right )}{9 \Gamma \left (\frac {2}{3}\right )}\right )}{6 \pi \operatorname {signum}\left (x^{3}-1\right )^{\frac {1}{3}}}+\frac {{\left (-\operatorname {signum}\left (x^{3}-1\right )\right )}^{\frac {1}{3}} x \operatorname {hypergeom}\left (\left [\frac {1}{3}, \frac {1}{3}\right ], \left [\frac {4}{3}\right ], x^{3}\right )}{\operatorname {signum}\left (x^{3}-1\right )^{\frac {1}{3}}}\) \(125\)
trager \(\text {Expression too large to display}\) \(623\)

Input:

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

Output:

-3*(-1+x)/(x^3-1)^(1/3)+1/6/Pi*3^(1/2)*GAMMA(2/3)/signum(x^3-1)^(1/3)*(-si 
gnum(x^3-1))^(1/3)*(2/3*(-1/6*Pi*3^(1/2)-3/2*ln(3)+3*ln(x)+I*Pi)*Pi*3^(1/2 
)/GAMMA(2/3)+2/9*Pi*3^(1/2)/GAMMA(2/3)*x^3*hypergeom([1,1,4/3],[2,2],x^3)) 
+1/signum(x^3-1)^(1/3)*(-signum(x^3-1))^(1/3)*x*hypergeom([1/3,1/3],[4/3], 
x^3)
 

Fricas [A] (verification not implemented)

Time = 0.26 (sec) , antiderivative size = 119, normalized size of antiderivative = 1.07 \[ \int \frac {(-1+x)^2 (1+x)}{x \left (1+x+x^2\right ) \sqrt [3]{-1+x^3}} \, dx=\frac {2 \, \sqrt {3} {\left (x^{2} + x + 1\right )} \arctan \left (-\frac {4 \, \sqrt {3} {\left (x^{3} - 1\right )}^{\frac {1}{3}} {\left (x - 1\right )} + \sqrt {3} {\left (x^{2} + x + 1\right )} - 2 \, \sqrt {3} {\left (x^{3} - 1\right )}^{\frac {2}{3}}}{3 \, {\left (3 \, x^{2} - 5 \, x + 3\right )}}\right ) - {\left (x^{2} + x + 1\right )} \log \left (\frac {{\left (x^{3} - 1\right )}^{\frac {1}{3}} {\left (x - 1\right )} + x - {\left (x^{3} - 1\right )}^{\frac {2}{3}}}{x}\right ) - 6 \, {\left (x^{3} - 1\right )}^{\frac {2}{3}}}{2 \, {\left (x^{2} + x + 1\right )}} \] Input:

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

Output:

1/2*(2*sqrt(3)*(x^2 + x + 1)*arctan(-1/3*(4*sqrt(3)*(x^3 - 1)^(1/3)*(x - 1 
) + sqrt(3)*(x^2 + x + 1) - 2*sqrt(3)*(x^3 - 1)^(2/3))/(3*x^2 - 5*x + 3)) 
- (x^2 + x + 1)*log(((x^3 - 1)^(1/3)*(x - 1) + x - (x^3 - 1)^(2/3))/x) - 6 
*(x^3 - 1)^(2/3))/(x^2 + x + 1)
 

Sympy [F]

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

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

Output:

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

Maxima [F]

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

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

Output:

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

Giac [F]

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

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

Output:

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

Mupad [F(-1)]

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

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

Output:

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

Reduce [F]

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

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

Output:

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