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

3.13.22.1 Optimal result
3.13.22.2 Mathematica [A] (verified)
3.13.22.3 Rubi [F]
3.13.22.4 Maple [C] (verified)
3.13.22.5 Fricas [B] (verification not implemented)
3.13.22.6 Sympy [F(-1)]
3.13.22.7 Maxima [F]
3.13.22.8 Giac [F]
3.13.22.9 Mupad [F(-1)]

3.13.22.1 Optimal result

Integrand size = 66, antiderivative size = 89 \[ \int \frac {(-1+x)^2 \left (x-2 x^2+2 x^3\right )}{(-1+2 x) \sqrt {\frac {1-2 x}{1+2 x^2}} \left (-2+4 x+3 x^2-4 x^3+2 x^4\right )} \, dx=\frac {\sqrt {\frac {1-2 x}{1+2 x^2}} \left (1-x+2 x^2-2 x^3\right )}{3 (-1+2 x)}-\frac {\text {arctanh}\left (\frac {-\frac {1}{\sqrt {3}}+\frac {x}{\sqrt {3}}}{\sqrt {\frac {1-2 x}{1+2 x^2}}}\right )}{\sqrt {3}} \]

output
((1-2*x)/(2*x^2+1))^(1/2)*(-2*x^3+2*x^2-x+1)/(-3+6*x)-1/3*arctanh((-1/3*3^ 
(1/2)+1/3*x*3^(1/2))/((1-2*x)/(2*x^2+1))^(1/2))*3^(1/2)
 
3.13.22.2 Mathematica [A] (verified)

Time = 10.85 (sec) , antiderivative size = 72, normalized size of antiderivative = 0.81 \[ \int \frac {(-1+x)^2 \left (x-2 x^2+2 x^3\right )}{(-1+2 x) \sqrt {\frac {1-2 x}{1+2 x^2}} \left (-2+4 x+3 x^2-4 x^3+2 x^4\right )} \, dx=\frac {\sqrt {\frac {1-2 x}{1+2 x^2}} \left (-1+x-2 x^2+2 x^3\right )}{3-6 x}-\frac {\text {arctanh}\left (\frac {-1+x}{\sqrt {\frac {3-6 x}{1+2 x^2}}}\right )}{\sqrt {3}} \]

input
Integrate[((-1 + x)^2*(x - 2*x^2 + 2*x^3))/((-1 + 2*x)*Sqrt[(1 - 2*x)/(1 + 
 2*x^2)]*(-2 + 4*x + 3*x^2 - 4*x^3 + 2*x^4)),x]
 
output
(Sqrt[(1 - 2*x)/(1 + 2*x^2)]*(-1 + x - 2*x^2 + 2*x^3))/(3 - 6*x) - ArcTanh 
[(-1 + x)/Sqrt[(3 - 6*x)/(1 + 2*x^2)]]/Sqrt[3]
 
3.13.22.3 Rubi [F]

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 \left (2 x^3-2 x^2+x\right )}{(2 x-1) \sqrt {\frac {1-2 x}{2 x^2+1}} \left (2 x^4-4 x^3+3 x^2+4 x-2\right )} \, dx\)

\(\Big \downarrow \) 2028

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

\(\Big \downarrow \) 7270

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

\(\Big \downarrow \) 7293

\(\displaystyle \frac {\sqrt {1-2 x} \int \left (-\frac {\sqrt {2 x^2+1} x}{(1-2 x)^{3/2}}+\frac {\sqrt {2 x^2+1}}{(1-2 x)^{3/2}}-\frac {\sqrt {2 x^2+1} \left (5 x^2-7 x+2\right )}{(1-2 x)^{3/2} \left (-2 x^4+4 x^3-3 x^2-4 x+2\right )}\right )dx}{\sqrt {\frac {1-2 x}{2 x^2+1}} \sqrt {2 x^2+1}}\)

\(\Big \downarrow \) 2009

\(\displaystyle \frac {\sqrt {1-2 x} \left (\frac {8}{3} \sqrt {2} \text {Subst}\left (\int \frac {\sqrt {x^4-2 x^2+3}}{x^8-20 x^2+3}dx,x,\sqrt {1-2 x}\right )-5 \sqrt {2} \text {Subst}\left (\int \frac {x^2 \sqrt {x^4-2 x^2+3}}{x^8-20 x^2+3}dx,x,\sqrt {1-2 x}\right )-\frac {1}{3} \sqrt {2} \text {Subst}\left (\int \frac {x^6 \sqrt {x^4-2 x^2+3}}{x^8-20 x^2+3}dx,x,\sqrt {1-2 x}\right )+\frac {\left (2-\sqrt {3}\right ) \left (-2 x+\sqrt {3}+1\right ) \sqrt {\frac {2 x^2+1}{\left (-2 x+\sqrt {3}+1\right )^2}} \operatorname {EllipticF}\left (2 \arctan \left (\frac {\sqrt {1-2 x}}{\sqrt [4]{3}}\right ),\frac {1}{6} \left (3+\sqrt {3}\right )\right )}{\sqrt {2} 3^{3/4} \sqrt {2 x^2+1}}-\frac {\sqrt {2} \left (1-\sqrt {3}\right ) \left (-2 x+\sqrt {3}+1\right ) \sqrt {\frac {2 x^2+1}{\left (-2 x+\sqrt {3}+1\right )^2}} \operatorname {EllipticF}\left (2 \arctan \left (\frac {\sqrt {1-2 x}}{\sqrt [4]{3}}\right ),\frac {1}{6} \left (3+\sqrt {3}\right )\right )}{3 \sqrt [4]{3} \sqrt {2 x^2+1}}+\frac {\left (1-\sqrt {3}\right ) \left (-2 x+\sqrt {3}+1\right ) \sqrt {\frac {2 x^2+1}{\left (-2 x+\sqrt {3}+1\right )^2}} \operatorname {EllipticF}\left (2 \arctan \left (\frac {\sqrt {1-2 x}}{\sqrt [4]{3}}\right ),\frac {1}{6} \left (3+\sqrt {3}\right )\right )}{\sqrt {2} \sqrt [4]{3} \sqrt {2 x^2+1}}+\frac {\sqrt {2} \sqrt [4]{3} \left (-2 x+\sqrt {3}+1\right ) \sqrt {\frac {2 x^2+1}{\left (-2 x+\sqrt {3}+1\right )^2}} E\left (2 \arctan \left (\frac {\sqrt {1-2 x}}{\sqrt [4]{3}}\right )|\frac {1}{6} \left (3+\sqrt {3}\right )\right )}{\sqrt {2 x^2+1}}-\frac {4 \sqrt {2} \left (-2 x+\sqrt {3}+1\right ) \sqrt {\frac {2 x^2+1}{\left (-2 x+\sqrt {3}+1\right )^2}} E\left (2 \arctan \left (\frac {\sqrt {1-2 x}}{\sqrt [4]{3}}\right )|\frac {1}{6} \left (3+\sqrt {3}\right )\right )}{3^{3/4} \sqrt {2 x^2+1}}-\frac {\sqrt {2 x^2+1} (2-x)}{3 \sqrt {1-2 x}}+\frac {\sqrt {2 x^2+1}}{3 \sqrt {1-2 x}}+\frac {2 \sqrt {1-2 x} \sqrt {2 x^2+1}}{3 \left (-2 x+\sqrt {3}+1\right )}\right )}{\sqrt {\frac {1-2 x}{2 x^2+1}} \sqrt {2 x^2+1}}\)

input
Int[((-1 + x)^2*(x - 2*x^2 + 2*x^3))/((-1 + 2*x)*Sqrt[(1 - 2*x)/(1 + 2*x^2 
)]*(-2 + 4*x + 3*x^2 - 4*x^3 + 2*x^4)),x]
 
output
$Aborted
 

3.13.22.3.1 Defintions of rubi rules used

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

rule 2028
Int[(Fx_.)*((a_.)*(x_)^(r_.) + (b_.)*(x_)^(s_.) + (c_.)*(x_)^(t_.))^(p_.), 
x_Symbol] :> Int[x^(p*r)*(a + b*x^(s - r) + c*x^(t - r))^p*Fx, x] /; FreeQ[ 
{a, b, c, r, s, t}, x] && IntegerQ[p] && PosQ[s - r] && PosQ[t - r] &&  !(E 
qQ[p, 1] && EqQ[u, 1])
 

rule 7270
Int[(u_.)*((a_.)*(v_)^(m_.)*(w_)^(n_.))^(p_), x_Symbol] :> Simp[a^IntPart[p 
]*((a*v^m*w^n)^FracPart[p]/(v^(m*FracPart[p])*w^(n*FracPart[p])))   Int[u*v 
^(m*p)*w^(n*p), x], x] /; FreeQ[{a, m, n, p}, x] &&  !IntegerQ[p] &&  !Free 
Q[v, x] &&  !FreeQ[w, x]
 

rule 7293
Int[u_, x_Symbol] :> With[{v = ExpandIntegrand[u, x]}, Int[v, x] /; SumQ[v] 
]
 
3.13.22.4 Maple [C] (verified)

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

Time = 3.49 (sec) , antiderivative size = 209, normalized size of antiderivative = 2.35

method result size
trager \(-\frac {\left (2 x^{2}+1\right ) \left (x -1\right ) \sqrt {-\frac {-1+2 x}{2 x^{2}+1}}}{3 \left (-1+2 x \right )}-\frac {\operatorname {RootOf}\left (\textit {\_Z}^{2}-3\right ) \ln \left (\frac {2 \operatorname {RootOf}\left (\textit {\_Z}^{2}-3\right ) x^{4}-4 \operatorname {RootOf}\left (\textit {\_Z}^{2}-3\right ) x^{3}+12 \sqrt {-\frac {-1+2 x}{2 x^{2}+1}}\, x^{3}+3 \operatorname {RootOf}\left (\textit {\_Z}^{2}-3\right ) x^{2}-12 \sqrt {-\frac {-1+2 x}{2 x^{2}+1}}\, x^{2}-8 \operatorname {RootOf}\left (\textit {\_Z}^{2}-3\right ) x +6 \sqrt {-\frac {-1+2 x}{2 x^{2}+1}}\, x +4 \operatorname {RootOf}\left (\textit {\_Z}^{2}-3\right )-6 \sqrt {-\frac {-1+2 x}{2 x^{2}+1}}}{2 x^{4}-4 x^{3}+3 x^{2}+4 x -2}\right )}{6}\) \(209\)
default \(\frac {i \left (\munderset {\underline {\hspace {1.25 ex}}\alpha =\operatorname {RootOf}\left (2 \textit {\_Z}^{4}-4 \textit {\_Z}^{3}+3 \textit {\_Z}^{2}+4 \textit {\_Z} -2\right )}{\sum }\frac {\left (2 \underline {\hspace {1.25 ex}}\alpha ^{3}-2 \underline {\hspace {1.25 ex}}\alpha ^{2}+\underline {\hspace {1.25 ex}}\alpha -1\right ) \sqrt {-i \left (i \sqrt {2}+2 x \right )}\, \sqrt {-\frac {-1+2 x}{1+i \sqrt {2}}}\, \sqrt {-i \left (i \sqrt {2}-2 x \right )}\, \left (-2 \underline {\hspace {1.25 ex}}\alpha ^{3}+6 \underline {\hspace {1.25 ex}}\alpha ^{2}-6 \underline {\hspace {1.25 ex}}\alpha -4+i \sqrt {2}\, \left (2 \underline {\hspace {1.25 ex}}\alpha ^{3}-3 \underline {\hspace {1.25 ex}}\alpha ^{2}+7\right )\right ) \operatorname {EllipticPi}\left (\frac {\sqrt {-i \left (i \sqrt {2}+2 x \right ) \sqrt {2}}}{2}, \frac {4 \underline {\hspace {1.25 ex}}\alpha ^{3}}{9}-\frac {2 \underline {\hspace {1.25 ex}}\alpha ^{2}}{3}+\frac {2 i \sqrt {2}\, \underline {\hspace {1.25 ex}}\alpha ^{3}}{9}-\frac {2 i \sqrt {2}\, \underline {\hspace {1.25 ex}}\alpha ^{2}}{3}+\frac {14}{9}+\frac {2 i \underline {\hspace {1.25 ex}}\alpha \sqrt {2}}{3}+\frac {4 i \sqrt {2}}{9}, \sqrt {2}\, \sqrt {\frac {i \sqrt {2}}{1+i \sqrt {2}}}\right )}{\sqrt {-4 x^{3}+2 x^{2}-2 x +1}}\right ) \sqrt {-\left (-1+2 x \right ) \left (2 x^{2}+1\right )}-9 \sqrt {-4 x^{3}+2 x^{2}-2 x +1}\, \sqrt {-\left (-1+2 x \right ) \left (2 x^{2}+1\right )}-18 x^{2}-9}{54 \sqrt {-\frac {-1+2 x}{2 x^{2}+1}}\, \left (2 x^{2}+1\right )}\) \(314\)

input
int((x-1)^2*(2*x^3-2*x^2+x)/(-1+2*x)/((1-2*x)/(2*x^2+1))^(1/2)/(2*x^4-4*x^ 
3+3*x^2+4*x-2),x,method=_RETURNVERBOSE)
 
output
-1/3*(2*x^2+1)*(x-1)/(-1+2*x)*(-(-1+2*x)/(2*x^2+1))^(1/2)-1/6*RootOf(_Z^2- 
3)*ln((2*RootOf(_Z^2-3)*x^4-4*RootOf(_Z^2-3)*x^3+12*(-(-1+2*x)/(2*x^2+1))^ 
(1/2)*x^3+3*RootOf(_Z^2-3)*x^2-12*(-(-1+2*x)/(2*x^2+1))^(1/2)*x^2-8*RootOf 
(_Z^2-3)*x+6*(-(-1+2*x)/(2*x^2+1))^(1/2)*x+4*RootOf(_Z^2-3)-6*(-(-1+2*x)/( 
2*x^2+1))^(1/2))/(2*x^4-4*x^3+3*x^2+4*x-2))
 
3.13.22.5 Fricas [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 195 vs. \(2 (78) = 156\).

Time = 0.33 (sec) , antiderivative size = 195, normalized size of antiderivative = 2.19 \[ \int \frac {(-1+x)^2 \left (x-2 x^2+2 x^3\right )}{(-1+2 x) \sqrt {\frac {1-2 x}{1+2 x^2}} \left (-2+4 x+3 x^2-4 x^3+2 x^4\right )} \, dx=\frac {\sqrt {3} {\left (2 \, x - 1\right )} \log \left (-\frac {4 \, x^{8} - 16 \, x^{7} + 28 \, x^{6} - 104 \, x^{5} + 209 \, x^{4} - 200 \, x^{3} + 172 \, x^{2} - 4 \, \sqrt {3} {\left (4 \, x^{7} - 12 \, x^{6} + 16 \, x^{5} - 28 \, x^{4} + 31 \, x^{3} - 19 \, x^{2} + 12 \, x - 4\right )} \sqrt {-\frac {2 \, x - 1}{2 \, x^{2} + 1}} - 112 \, x + 28}{4 \, x^{8} - 16 \, x^{7} + 28 \, x^{6} - 8 \, x^{5} - 31 \, x^{4} + 40 \, x^{3} + 4 \, x^{2} - 16 \, x + 4}\right ) - 4 \, {\left (2 \, x^{3} - 2 \, x^{2} + x - 1\right )} \sqrt {-\frac {2 \, x - 1}{2 \, x^{2} + 1}}}{12 \, {\left (2 \, x - 1\right )}} \]

input
integrate((-1+x)^2*(2*x^3-2*x^2+x)/(-1+2*x)/((1-2*x)/(2*x^2+1))^(1/2)/(2*x 
^4-4*x^3+3*x^2+4*x-2),x, algorithm="fricas")
 
output
1/12*(sqrt(3)*(2*x - 1)*log(-(4*x^8 - 16*x^7 + 28*x^6 - 104*x^5 + 209*x^4 
- 200*x^3 + 172*x^2 - 4*sqrt(3)*(4*x^7 - 12*x^6 + 16*x^5 - 28*x^4 + 31*x^3 
 - 19*x^2 + 12*x - 4)*sqrt(-(2*x - 1)/(2*x^2 + 1)) - 112*x + 28)/(4*x^8 - 
16*x^7 + 28*x^6 - 8*x^5 - 31*x^4 + 40*x^3 + 4*x^2 - 16*x + 4)) - 4*(2*x^3 
- 2*x^2 + x - 1)*sqrt(-(2*x - 1)/(2*x^2 + 1)))/(2*x - 1)
 
3.13.22.6 Sympy [F(-1)]

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

input
integrate((-1+x)**2*(2*x**3-2*x**2+x)/(-1+2*x)/((1-2*x)/(2*x**2+1))**(1/2) 
/(2*x**4-4*x**3+3*x**2+4*x-2),x)
 
output
Timed out
 
3.13.22.7 Maxima [F]

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

input
integrate((-1+x)^2*(2*x^3-2*x^2+x)/(-1+2*x)/((1-2*x)/(2*x^2+1))^(1/2)/(2*x 
^4-4*x^3+3*x^2+4*x-2),x, algorithm="maxima")
 
output
integrate((2*x^3 - 2*x^2 + x)*(x - 1)^2/((2*x^4 - 4*x^3 + 3*x^2 + 4*x - 2) 
*(2*x - 1)*sqrt(-(2*x - 1)/(2*x^2 + 1))), x)
 
3.13.22.8 Giac [F]

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

input
integrate((-1+x)^2*(2*x^3-2*x^2+x)/(-1+2*x)/((1-2*x)/(2*x^2+1))^(1/2)/(2*x 
^4-4*x^3+3*x^2+4*x-2),x, algorithm="giac")
 
output
integrate((2*x^3 - 2*x^2 + x)*(x - 1)^2/((2*x^4 - 4*x^3 + 3*x^2 + 4*x - 2) 
*(2*x - 1)*sqrt(-(2*x - 1)/(2*x^2 + 1))), x)
 
3.13.22.9 Mupad [F(-1)]

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

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