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

Optimal. Leaf size=17 \[ -\frac {F\left (\sin ^{-1}(1-x)|-\frac {1}{3}\right )}{\sqrt {3}} \]

[Out]

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

________________________________________________________________________________________

Rubi [A]
time = 0.01, antiderivative size = 17, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 3, integrand size = 19, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.158, Rules used = {1120, 1109, 430} \begin {gather*} -\frac {F\left (\text {ArcSin}(1-x)\left |-\frac {1}{3}\right .\right )}{\sqrt {3}} \end {gather*}

Antiderivative was successfully verified.

[In]

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

[Out]

-(EllipticF[ArcSin[1 - x], -1/3]/Sqrt[3])

Rule 430

Int[1/(Sqrt[(a_) + (b_.)*(x_)^2]*Sqrt[(c_) + (d_.)*(x_)^2]), x_Symbol] :> Simp[(1/(Sqrt[a]*Sqrt[c]*Rt[-d/c, 2]
))*EllipticF[ArcSin[Rt[-d/c, 2]*x], b*(c/(a*d))], x] /; FreeQ[{a, b, c, d}, x] && NegQ[d/c] && GtQ[c, 0] && Gt
Q[a, 0] &&  !(NegQ[b/a] && SimplerSqrtQ[-b/a, -d/c])

Rule 1109

Int[1/Sqrt[(a_) + (b_.)*(x_)^2 + (c_.)*(x_)^4], x_Symbol] :> With[{q = Rt[b^2 - 4*a*c, 2]}, Dist[2*Sqrt[-c], I
nt[1/(Sqrt[b + q + 2*c*x^2]*Sqrt[-b + q - 2*c*x^2]), x], x]] /; FreeQ[{a, b, c}, x] && GtQ[b^2 - 4*a*c, 0] &&
LtQ[c, 0]

Rule 1120

Int[(P4_)^(p_), x_Symbol] :> With[{a = Coeff[P4, x, 0], b = Coeff[P4, x, 1], c = Coeff[P4, x, 2], d = Coeff[P4
, x, 3], e = Coeff[P4, x, 4]}, Subst[Int[SimplifyIntegrand[(a + d^4/(256*e^3) - b*(d/(8*e)) + (c - 3*(d^2/(8*e
)))*x^2 + e*x^4)^p, x], x], x, d/(4*e) + x] /; EqQ[d^3 - 4*c*d*e + 8*b*e^2, 0] && NeQ[d, 0]] /; FreeQ[p, x] &&
 PolyQ[P4, x, 4] && NeQ[p, 2] && NeQ[p, 3]

Rubi steps

\begin {align*} \int \frac {1}{\sqrt {(2-x) x \left (4-2 x+x^2\right )}} \, dx &=\text {Subst}\left (\int \frac {1}{\sqrt {3-2 x^2-x^4}} \, dx,x,-1+x\right )\\ &=2 \text {Subst}\left (\int \frac {1}{\sqrt {2-2 x^2} \sqrt {6+2 x^2}} \, dx,x,-1+x\right )\\ &=-\frac {F\left (\sin ^{-1}(1-x)|-\frac {1}{3}\right )}{\sqrt {3}}\\ \end {align*}

________________________________________________________________________________________

Mathematica [C] Result contains complex when optimal does not.
time = 31.92, size = 100, normalized size = 5.88 \begin {gather*} -\frac {\sqrt [3]{-1} (-2+x)^2 \sqrt {\frac {x \left (-1+i \sqrt {3}+x\right )}{(-2+x)^2}} \sqrt {\frac {-2+x-\sqrt [3]{-1} x}{-2+x}} F\left (\sin ^{-1}\left (\sqrt {-\frac {(-1)^{2/3} x}{-2+x}}\right )|(-1)^{2/3}\right )}{\sqrt {-x \left (-8+8 x-4 x^2+x^3\right )}} \end {gather*}

Antiderivative was successfully verified.

[In]

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

[Out]

-(((-1)^(1/3)*(-2 + x)^2*Sqrt[(x*(-1 + I*Sqrt[3] + x))/(-2 + x)^2]*Sqrt[(-2 + x - (-1)^(1/3)*x)/(-2 + x)]*Elli
pticF[ArcSin[Sqrt[-(((-1)^(2/3)*x)/(-2 + x))]], (-1)^(2/3)])/Sqrt[-(x*(-8 + 8*x - 4*x^2 + x^3))])

________________________________________________________________________________________

Maple [B] Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 199 vs. \(2 (15 ) = 30\).
time = 0.51, size = 200, normalized size = 11.76

method result size
default \(\frac {2 \left (-1-i \sqrt {3}\right ) \sqrt {\frac {\left (-1+i \sqrt {3}\right ) x}{\left (1+i \sqrt {3}\right ) \left (x -2\right )}}\, \left (x -2\right )^{2} \sqrt {\frac {x -1+i \sqrt {3}}{\left (1-i \sqrt {3}\right ) \left (x -2\right )}}\, \sqrt {\frac {x -1-i \sqrt {3}}{\left (1+i \sqrt {3}\right ) \left (x -2\right )}}\, \EllipticF \left (\sqrt {\frac {\left (-1+i \sqrt {3}\right ) x}{\left (1+i \sqrt {3}\right ) \left (x -2\right )}}, \sqrt {\frac {\left (1+i \sqrt {3}\right ) \left (-1-i \sqrt {3}\right )}{\left (-1+i \sqrt {3}\right ) \left (1-i \sqrt {3}\right )}}\right )}{\left (-1+i \sqrt {3}\right ) \sqrt {-x \left (x -2\right ) \left (x -1+i \sqrt {3}\right ) \left (x -1-i \sqrt {3}\right )}}\) \(200\)
elliptic \(\frac {2 \left (-1-i \sqrt {3}\right ) \sqrt {\frac {\left (-1+i \sqrt {3}\right ) x}{\left (1+i \sqrt {3}\right ) \left (x -2\right )}}\, \left (x -2\right )^{2} \sqrt {\frac {x -1+i \sqrt {3}}{\left (1-i \sqrt {3}\right ) \left (x -2\right )}}\, \sqrt {\frac {x -1-i \sqrt {3}}{\left (1+i \sqrt {3}\right ) \left (x -2\right )}}\, \EllipticF \left (\sqrt {\frac {\left (-1+i \sqrt {3}\right ) x}{\left (1+i \sqrt {3}\right ) \left (x -2\right )}}, \sqrt {\frac {\left (1+i \sqrt {3}\right ) \left (-1-i \sqrt {3}\right )}{\left (-1+i \sqrt {3}\right ) \left (1-i \sqrt {3}\right )}}\right )}{\left (-1+i \sqrt {3}\right ) \sqrt {-x \left (x -2\right ) \left (x -1+i \sqrt {3}\right ) \left (x -1-i \sqrt {3}\right )}}\) \(200\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Maxima [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Failed to integrate} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Fricas [C] Result contains higher order function than in optimal. Order 9 vs. order 4.
time = 0.08, size = 16, normalized size = 0.94 \begin {gather*} -\frac {1}{2} \, \sqrt {2} {\rm weierstrassPInverse}\left (-\frac {2}{3}, \frac {7}{54}, -\frac {x - 3}{3 \, x}\right ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

-1/2*sqrt(2)*weierstrassPInverse(-2/3, 7/54, -1/3*(x - 3)/x)

________________________________________________________________________________________

Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \frac {1}{\sqrt {x \left (2 - x\right ) \left (x^{2} - 2 x + 4\right )}}\, dx \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Giac [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {could not integrate} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Mupad [F]
time = 0.00, size = -1, normalized size = -0.06 \begin {gather*} \int \frac {1}{\sqrt {-x\,\left (x-2\right )\,\left (x^2-2\,x+4\right )}} \,d x \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________