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

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

Optimal result

Integrand size = 30, antiderivative size = 21 \[ \int \frac {-1+2 x+2 x^2}{(-1+x) x \sqrt {-x+x^4}} \, dx=-\frac {2 \sqrt {-x+x^4}}{(-1+x) x} \]

[Out]

-2*(x^4-x)^(1/2)/(-1+x)/x

Rubi [F]

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

[In]

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

[Out]

(-2*(1 - x^3))/Sqrt[-x + x^4] - (2*(1 + Sqrt[3])*x*(1 - x^3))/((1 - (1 + Sqrt[3])*x)*Sqrt[-x + x^4]) + (2*3^(1
/4)*(1 - x)*x*Sqrt[(1 + x + x^2)/(1 - (1 + Sqrt[3])*x)^2]*EllipticE[ArcCos[(1 - (1 - Sqrt[3])*x)/(1 - (1 + Sqr
t[3])*x)], (2 + Sqrt[3])/4])/(Sqrt[-(((1 - x)*x)/(1 - (1 + Sqrt[3])*x)^2)]*Sqrt[-x + x^4]) + (2*(1 - x)*x*Sqrt
[(1 + x + x^2)/(1 - (1 + Sqrt[3])*x)^2]*EllipticF[ArcCos[(1 - (1 - Sqrt[3])*x)/(1 - (1 + Sqrt[3])*x)], (2 + Sq
rt[3])/4])/(3^(1/4)*Sqrt[-(((1 - x)*x)/(1 - (1 + Sqrt[3])*x)^2)]*Sqrt[-x + x^4]) + ((1 - Sqrt[3])*(1 - x)*x*Sq
rt[(1 + x + x^2)/(1 - (1 + Sqrt[3])*x)^2]*EllipticF[ArcCos[(1 - (1 - Sqrt[3])*x)/(1 - (1 + Sqrt[3])*x)], (2 +
Sqrt[3])/4])/(3^(1/4)*Sqrt[-(((1 - x)*x)/(1 - (1 + Sqrt[3])*x)^2)]*Sqrt[-x + x^4]) + (3*Sqrt[x]*Sqrt[-1 + x^3]
*Defer[Subst][Defer[Int][1/((-1 + x)*Sqrt[-1 + x^6]), x], x, Sqrt[x]])/Sqrt[-x + x^4] - (3*Sqrt[x]*Sqrt[-1 + x
^3]*Defer[Subst][Defer[Int][1/((1 + x)*Sqrt[-1 + x^6]), x], x, Sqrt[x]])/Sqrt[-x + x^4]

Rubi steps \begin{align*} \text {integral}& = \frac {\left (\sqrt {x} \sqrt {-1+x^3}\right ) \int \frac {-1+2 x+2 x^2}{(-1+x) x^{3/2} \sqrt {-1+x^3}} \, dx}{\sqrt {-x+x^4}} \\ & = \frac {\left (2 \sqrt {x} \sqrt {-1+x^3}\right ) \text {Subst}\left (\int \frac {-1+2 x^2+2 x^4}{x^2 \left (-1+x^2\right ) \sqrt {-1+x^6}} \, dx,x,\sqrt {x}\right )}{\sqrt {-x+x^4}} \\ & = \frac {\left (2 \sqrt {x} \sqrt {-1+x^3}\right ) \text {Subst}\left (\int \left (\frac {2}{\sqrt {-1+x^6}}+\frac {1}{x^2 \sqrt {-1+x^6}}+\frac {3}{\left (-1+x^2\right ) \sqrt {-1+x^6}}\right ) \, dx,x,\sqrt {x}\right )}{\sqrt {-x+x^4}} \\ & = \frac {\left (2 \sqrt {x} \sqrt {-1+x^3}\right ) \text {Subst}\left (\int \frac {1}{x^2 \sqrt {-1+x^6}} \, dx,x,\sqrt {x}\right )}{\sqrt {-x+x^4}}+\frac {\left (4 \sqrt {x} \sqrt {-1+x^3}\right ) \text {Subst}\left (\int \frac {1}{\sqrt {-1+x^6}} \, dx,x,\sqrt {x}\right )}{\sqrt {-x+x^4}}+\frac {\left (6 \sqrt {x} \sqrt {-1+x^3}\right ) \text {Subst}\left (\int \frac {1}{\left (-1+x^2\right ) \sqrt {-1+x^6}} \, dx,x,\sqrt {x}\right )}{\sqrt {-x+x^4}} \\ & = -\frac {2 \left (1-x^3\right )}{\sqrt {-x+x^4}}+\frac {2 (1-x) x \sqrt {\frac {1+x+x^2}{\left (1-\left (1+\sqrt {3}\right ) x\right )^2}} \operatorname {EllipticF}\left (\arccos \left (\frac {1-\left (1-\sqrt {3}\right ) x}{1-\left (1+\sqrt {3}\right ) x}\right ),\frac {1}{4} \left (2+\sqrt {3}\right )\right )}{\sqrt [4]{3} \sqrt {-\frac {(1-x) x}{\left (1-\left (1+\sqrt {3}\right ) x\right )^2}} \sqrt {-x+x^4}}-\frac {\left (4 \sqrt {x} \sqrt {-1+x^3}\right ) \text {Subst}\left (\int \frac {x^4}{\sqrt {-1+x^6}} \, dx,x,\sqrt {x}\right )}{\sqrt {-x+x^4}}+\frac {\left (6 \sqrt {x} \sqrt {-1+x^3}\right ) \text {Subst}\left (\int \left (\frac {1}{2 (-1+x) \sqrt {-1+x^6}}-\frac {1}{2 (1+x) \sqrt {-1+x^6}}\right ) \, dx,x,\sqrt {x}\right )}{\sqrt {-x+x^4}} \\ & = -\frac {2 \left (1-x^3\right )}{\sqrt {-x+x^4}}+\frac {2 (1-x) x \sqrt {\frac {1+x+x^2}{\left (1-\left (1+\sqrt {3}\right ) x\right )^2}} \operatorname {EllipticF}\left (\arccos \left (\frac {1-\left (1-\sqrt {3}\right ) x}{1-\left (1+\sqrt {3}\right ) x}\right ),\frac {1}{4} \left (2+\sqrt {3}\right )\right )}{\sqrt [4]{3} \sqrt {-\frac {(1-x) x}{\left (1-\left (1+\sqrt {3}\right ) x\right )^2}} \sqrt {-x+x^4}}+\frac {\left (2 \sqrt {x} \sqrt {-1+x^3}\right ) \text {Subst}\left (\int \frac {-1+\sqrt {3}-2 x^4}{\sqrt {-1+x^6}} \, dx,x,\sqrt {x}\right )}{\sqrt {-x+x^4}}+\frac {\left (3 \sqrt {x} \sqrt {-1+x^3}\right ) \text {Subst}\left (\int \frac {1}{(-1+x) \sqrt {-1+x^6}} \, dx,x,\sqrt {x}\right )}{\sqrt {-x+x^4}}-\frac {\left (3 \sqrt {x} \sqrt {-1+x^3}\right ) \text {Subst}\left (\int \frac {1}{(1+x) \sqrt {-1+x^6}} \, dx,x,\sqrt {x}\right )}{\sqrt {-x+x^4}}-\frac {\left (2 \left (-1+\sqrt {3}\right ) \sqrt {x} \sqrt {-1+x^3}\right ) \text {Subst}\left (\int \frac {1}{\sqrt {-1+x^6}} \, dx,x,\sqrt {x}\right )}{\sqrt {-x+x^4}} \\ & = -\frac {2 \left (1-x^3\right )}{\sqrt {-x+x^4}}-\frac {2 \left (1+\sqrt {3}\right ) x \left (1-x^3\right )}{\left (1-\left (1+\sqrt {3}\right ) x\right ) \sqrt {-x+x^4}}+\frac {2 \sqrt [4]{3} (1-x) x \sqrt {\frac {1+x+x^2}{\left (1-\left (1+\sqrt {3}\right ) x\right )^2}} E\left (\arccos \left (\frac {1-\left (1-\sqrt {3}\right ) x}{1-\left (1+\sqrt {3}\right ) x}\right )|\frac {1}{4} \left (2+\sqrt {3}\right )\right )}{\sqrt {-\frac {(1-x) x}{\left (1-\left (1+\sqrt {3}\right ) x\right )^2}} \sqrt {-x+x^4}}+\frac {2 (1-x) x \sqrt {\frac {1+x+x^2}{\left (1-\left (1+\sqrt {3}\right ) x\right )^2}} \operatorname {EllipticF}\left (\arccos \left (\frac {1-\left (1-\sqrt {3}\right ) x}{1-\left (1+\sqrt {3}\right ) x}\right ),\frac {1}{4} \left (2+\sqrt {3}\right )\right )}{\sqrt [4]{3} \sqrt {-\frac {(1-x) x}{\left (1-\left (1+\sqrt {3}\right ) x\right )^2}} \sqrt {-x+x^4}}+\frac {\left (1-\sqrt {3}\right ) (1-x) x \sqrt {\frac {1+x+x^2}{\left (1-\left (1+\sqrt {3}\right ) x\right )^2}} \operatorname {EllipticF}\left (\arccos \left (\frac {1-\left (1-\sqrt {3}\right ) x}{1-\left (1+\sqrt {3}\right ) x}\right ),\frac {1}{4} \left (2+\sqrt {3}\right )\right )}{\sqrt [4]{3} \sqrt {-\frac {(1-x) x}{\left (1-\left (1+\sqrt {3}\right ) x\right )^2}} \sqrt {-x+x^4}}+\frac {\left (3 \sqrt {x} \sqrt {-1+x^3}\right ) \text {Subst}\left (\int \frac {1}{(-1+x) \sqrt {-1+x^6}} \, dx,x,\sqrt {x}\right )}{\sqrt {-x+x^4}}-\frac {\left (3 \sqrt {x} \sqrt {-1+x^3}\right ) \text {Subst}\left (\int \frac {1}{(1+x) \sqrt {-1+x^6}} \, dx,x,\sqrt {x}\right )}{\sqrt {-x+x^4}} \\ \end{align*}

Mathematica [A] (verified)

Time = 8.42 (sec) , antiderivative size = 19, normalized size of antiderivative = 0.90 \[ \int \frac {-1+2 x+2 x^2}{(-1+x) x \sqrt {-x+x^4}} \, dx=-\frac {2 \left (1+x+x^2\right )}{\sqrt {x \left (-1+x^3\right )}} \]

[In]

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

[Out]

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

Maple [A] (verified)

Time = 2.66 (sec) , antiderivative size = 18, normalized size of antiderivative = 0.86

method result size
gosper \(-\frac {2 \left (x^{2}+x +1\right )}{\sqrt {x^{4}-x}}\) \(18\)
trager \(-\frac {2 \sqrt {x^{4}-x}}{\left (x -1\right ) x}\) \(20\)
default \(\frac {2 x^{3}-2}{\sqrt {x \left (x^{3}-1\right )}}-\frac {2 \left (x^{3}+x^{2}+x \right )}{\sqrt {\left (x -1\right ) \left (x^{3}+x^{2}+x \right )}}\) \(42\)
elliptic \(\frac {2 x^{3}-2}{\sqrt {x \left (x^{3}-1\right )}}-\frac {2 \left (x^{3}+x^{2}+x \right )}{\sqrt {\left (x -1\right ) \left (x^{3}+x^{2}+x \right )}}\) \(42\)

[In]

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

[Out]

-2*(x^2+x+1)/(x^4-x)^(1/2)

Fricas [A] (verification not implemented)

none

Time = 0.24 (sec) , antiderivative size = 20, normalized size of antiderivative = 0.95 \[ \int \frac {-1+2 x+2 x^2}{(-1+x) x \sqrt {-x+x^4}} \, dx=-\frac {2 \, \sqrt {x^{4} - x}}{x^{2} - x} \]

[In]

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

[Out]

-2*sqrt(x^4 - x)/(x^2 - x)

Sympy [F]

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

[In]

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

[Out]

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

Maxima [F]

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

[In]

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

[Out]

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

Giac [F]

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

[In]

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

[Out]

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

Mupad [B] (verification not implemented)

Time = 5.40 (sec) , antiderivative size = 19, normalized size of antiderivative = 0.90 \[ \int \frac {-1+2 x+2 x^2}{(-1+x) x \sqrt {-x+x^4}} \, dx=-\frac {2\,\sqrt {x^4-x}}{x\,\left (x-1\right )} \]

[In]

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

[Out]

-(2*(x^4 - x)^(1/2))/(x*(x - 1))