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

   Optimal result
   Rubi [C] (warning: unable to verify)
   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 = 29, antiderivative size = 40 \[ \int \frac {2+x^2}{\left (-2+x^2\right ) \sqrt {-2 x+2 x^2+x^3}} \, dx=-\sqrt {2} \text {arctanh}\left (\frac {\sqrt {2} \sqrt {-2 x+2 x^2+x^3}}{-2+2 x+x^2}\right ) \]

[Out]

-2^(1/2)*arctanh(2^(1/2)*(x^3+2*x^2-2*x)^(1/2)/(x^2+2*x-2))

Rubi [C] (warning: unable to verify)

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

Time = 0.76 (sec) , antiderivative size = 355, normalized size of antiderivative = 8.88, number of steps used = 15, number of rules used = 8, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.276, Rules used = {2081, 6857, 730, 1112, 948, 174, 552, 551} \[ \int \frac {2+x^2}{\left (-2+x^2\right ) \sqrt {-2 x+2 x^2+x^3}} \, dx=\frac {\sqrt {x} \sqrt {\frac {2-\left (1-\sqrt {3}\right ) x}{2-\left (1+\sqrt {3}\right ) x}} \sqrt {\left (1+\sqrt {3}\right ) x-2} \operatorname {EllipticF}\left (\arcsin \left (\frac {\sqrt {2} \sqrt [4]{3} \sqrt {x}}{\sqrt {\left (1+\sqrt {3}\right ) x-2}}\right ),\frac {1}{6} \left (3+\sqrt {3}\right )\right )}{\sqrt [4]{3} \sqrt {\frac {1}{2-\left (1+\sqrt {3}\right ) x}} \sqrt {x^3+2 x^2-2 x}}-\frac {2 \sqrt {2-\sqrt {3}} \sqrt {x} \sqrt {x+\sqrt {3}+1} \sqrt {\frac {x}{1-\sqrt {3}}+1} \operatorname {EllipticPi}\left (-\frac {1-\sqrt {3}}{\sqrt {2}},\arcsin \left (\frac {\sqrt {x}}{\sqrt {-1+\sqrt {3}}}\right ),-2+\sqrt {3}\right )}{\sqrt {x^3+2 x^2-2 x}}-\frac {2 \sqrt {2-\sqrt {3}} \sqrt {x} \sqrt {x+\sqrt {3}+1} \sqrt {\frac {x}{1-\sqrt {3}}+1} \operatorname {EllipticPi}\left (\frac {1-\sqrt {3}}{\sqrt {2}},\arcsin \left (\frac {\sqrt {x}}{\sqrt {-1+\sqrt {3}}}\right ),-2+\sqrt {3}\right )}{\sqrt {x^3+2 x^2-2 x}} \]

[In]

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

[Out]

(Sqrt[x]*Sqrt[(2 - (1 - Sqrt[3])*x)/(2 - (1 + Sqrt[3])*x)]*Sqrt[-2 + (1 + Sqrt[3])*x]*EllipticF[ArcSin[(Sqrt[2
]*3^(1/4)*Sqrt[x])/Sqrt[-2 + (1 + Sqrt[3])*x]], (3 + Sqrt[3])/6])/(3^(1/4)*Sqrt[(2 - (1 + Sqrt[3])*x)^(-1)]*Sq
rt[-2*x + 2*x^2 + x^3]) - (2*Sqrt[2 - Sqrt[3]]*Sqrt[x]*Sqrt[1 + Sqrt[3] + x]*Sqrt[1 + x/(1 - Sqrt[3])]*Ellipti
cPi[-((1 - Sqrt[3])/Sqrt[2]), ArcSin[Sqrt[x]/Sqrt[-1 + Sqrt[3]]], -2 + Sqrt[3]])/Sqrt[-2*x + 2*x^2 + x^3] - (2
*Sqrt[2 - Sqrt[3]]*Sqrt[x]*Sqrt[1 + Sqrt[3] + x]*Sqrt[1 + x/(1 - Sqrt[3])]*EllipticPi[(1 - Sqrt[3])/Sqrt[2], A
rcSin[Sqrt[x]/Sqrt[-1 + Sqrt[3]]], -2 + Sqrt[3]])/Sqrt[-2*x + 2*x^2 + x^3]

Rule 174

Int[1/(((a_.) + (b_.)*(x_))*Sqrt[(c_.) + (d_.)*(x_)]*Sqrt[(e_.) + (f_.)*(x_)]*Sqrt[(g_.) + (h_.)*(x_)]), x_Sym
bol] :> Dist[-2, Subst[Int[1/(Simp[b*c - a*d - b*x^2, x]*Sqrt[Simp[(d*e - c*f)/d + f*(x^2/d), x]]*Sqrt[Simp[(d
*g - c*h)/d + h*(x^2/d), x]]), x], x, Sqrt[c + d*x]], x] /; FreeQ[{a, b, c, d, e, f, g, h}, x] && GtQ[(d*e - c
*f)/d, 0]

Rule 551

Int[1/(((a_) + (b_.)*(x_)^2)*Sqrt[(c_) + (d_.)*(x_)^2]*Sqrt[(e_) + (f_.)*(x_)^2]), x_Symbol] :> Simp[(1/(a*Sqr
t[c]*Sqrt[e]*Rt[-d/c, 2]))*EllipticPi[b*(c/(a*d)), ArcSin[Rt[-d/c, 2]*x], c*(f/(d*e))], x] /; FreeQ[{a, b, c,
d, e, f}, x] &&  !GtQ[d/c, 0] && GtQ[c, 0] && GtQ[e, 0] &&  !( !GtQ[f/e, 0] && SimplerSqrtQ[-f/e, -d/c])

Rule 552

Int[1/(((a_) + (b_.)*(x_)^2)*Sqrt[(c_) + (d_.)*(x_)^2]*Sqrt[(e_) + (f_.)*(x_)^2]), x_Symbol] :> Dist[Sqrt[1 +
(d/c)*x^2]/Sqrt[c + d*x^2], Int[1/((a + b*x^2)*Sqrt[1 + (d/c)*x^2]*Sqrt[e + f*x^2]), x], x] /; FreeQ[{a, b, c,
 d, e, f}, x] &&  !GtQ[c, 0]

Rule 730

Int[(x_)^(m_)/Sqrt[(a_) + (b_.)*(x_) + (c_.)*(x_)^2], x_Symbol] :> Dist[2, Subst[Int[x^(2*m + 1)/Sqrt[a + b*x^
2 + c*x^4], x], x, Sqrt[x]], x] /; FreeQ[{a, b, c}, x] && NeQ[b^2 - 4*a*c, 0] && EqQ[m^2, 1/4]

Rule 948

Int[1/(((d_.) + (e_.)*(x_))*Sqrt[(f_.) + (g_.)*(x_)]*Sqrt[(a_.) + (b_.)*(x_) + (c_.)*(x_)^2]), x_Symbol] :> Wi
th[{q = Rt[b^2 - 4*a*c, 2]}, Dist[Sqrt[b - q + 2*c*x]*(Sqrt[b + q + 2*c*x]/Sqrt[a + b*x + c*x^2]), Int[1/((d +
 e*x)*Sqrt[f + g*x]*Sqrt[b - q + 2*c*x]*Sqrt[b + q + 2*c*x]), x], x]] /; FreeQ[{a, b, c, d, e, f, g}, x] && Ne
Q[e*f - d*g, 0] && NeQ[b^2 - 4*a*c, 0] && NeQ[c*d^2 - b*d*e + a*e^2, 0]

Rule 1112

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

Rule 2081

Int[(u_.)*(P_)^(p_.), x_Symbol] :> With[{m = MinimumMonomialExponent[P, x]}, Dist[P^FracPart[p]/(x^(m*FracPart
[p])*Distrib[1/x^m, P]^FracPart[p]), Int[u*x^(m*p)*Distrib[1/x^m, P]^p, x], x]] /; FreeQ[p, x] &&  !IntegerQ[p
] && SumQ[P] && EveryQ[BinomialQ[#1, x] & , P] &&  !PolyQ[P, x, 2]

Rule 6857

Int[(u_)/((a_) + (b_.)*(x_)^(n_)), x_Symbol] :> With[{v = RationalFunctionExpand[u/(a + b*x^n), x]}, Int[v, x]
 /; SumQ[v]] /; FreeQ[{a, b}, x] && IGtQ[n, 0]

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

Mathematica [A] (verified)

Time = 0.29 (sec) , antiderivative size = 62, normalized size of antiderivative = 1.55 \[ \int \frac {2+x^2}{\left (-2+x^2\right ) \sqrt {-2 x+2 x^2+x^3}} \, dx=-\frac {\sqrt {2} \sqrt {x} \sqrt {-2+2 x+x^2} \text {arctanh}\left (\frac {\sqrt {2} \sqrt {x}}{\sqrt {-2+2 x+x^2}}\right )}{\sqrt {x \left (-2+2 x+x^2\right )}} \]

[In]

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

[Out]

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

Maple [A] (verified)

Time = 1.41 (sec) , antiderivative size = 27, normalized size of antiderivative = 0.68

method result size
default \(-\sqrt {2}\, \operatorname {arctanh}\left (\frac {\sqrt {x \left (x^{2}+2 x -2\right )}\, \sqrt {2}}{2 x}\right )\) \(27\)
pseudoelliptic \(-\sqrt {2}\, \operatorname {arctanh}\left (\frac {\sqrt {x \left (x^{2}+2 x -2\right )}\, \sqrt {2}}{2 x}\right )\) \(27\)
trager \(-\frac {\operatorname {RootOf}\left (\textit {\_Z}^{2}-2\right ) \ln \left (\frac {\operatorname {RootOf}\left (\textit {\_Z}^{2}-2\right ) x^{2}+4 \operatorname {RootOf}\left (\textit {\_Z}^{2}-2\right ) x +4 \sqrt {x^{3}+2 x^{2}-2 x}-2 \operatorname {RootOf}\left (\textit {\_Z}^{2}-2\right )}{x^{2}-2}\right )}{2}\) \(62\)
elliptic \(\frac {\sqrt {\frac {x}{1+\sqrt {3}}+\frac {1}{1+\sqrt {3}}+\frac {\sqrt {3}}{1+\sqrt {3}}}\, \sqrt {-6 x \sqrt {3}+18-6 \sqrt {3}}\, \sqrt {-\frac {x}{1+\sqrt {3}}}\, \operatorname {EllipticF}\left (\sqrt {\frac {x +1+\sqrt {3}}{1+\sqrt {3}}}, \frac {\sqrt {6}\, \sqrt {\left (1+\sqrt {3}\right ) \sqrt {3}}}{6}\right )}{3 \sqrt {x^{3}+2 x^{2}-2 x}}+\frac {\sqrt {\frac {x}{1+\sqrt {3}}+\frac {1}{1+\sqrt {3}}+\frac {\sqrt {3}}{1+\sqrt {3}}}\, \sqrt {-6 x \sqrt {3}+18-6 \sqrt {3}}\, \sqrt {-\frac {x}{1+\sqrt {3}}}\, \operatorname {EllipticF}\left (\sqrt {\frac {x +1+\sqrt {3}}{1+\sqrt {3}}}, \frac {\sqrt {6}\, \sqrt {\left (1+\sqrt {3}\right ) \sqrt {3}}}{6}\right ) \sqrt {3}}{3 \sqrt {x^{3}+2 x^{2}-2 x}}+\frac {\sqrt {2}\, \sqrt {\frac {x}{1+\sqrt {3}}+\frac {1}{1+\sqrt {3}}+\frac {\sqrt {3}}{1+\sqrt {3}}}\, \sqrt {-6 x \sqrt {3}+18-6 \sqrt {3}}\, \sqrt {-\frac {x}{1+\sqrt {3}}}\, \operatorname {EllipticPi}\left (\sqrt {\frac {x +1+\sqrt {3}}{1+\sqrt {3}}}, \frac {-1-\sqrt {3}}{-1-\sqrt {3}-\sqrt {2}}, \frac {\sqrt {6}\, \sqrt {\left (1+\sqrt {3}\right ) \sqrt {3}}}{6}\right )}{3 \sqrt {x^{3}+2 x^{2}-2 x}\, \left (-1-\sqrt {3}-\sqrt {2}\right )}+\frac {\sqrt {2}\, \sqrt {\frac {x}{1+\sqrt {3}}+\frac {1}{1+\sqrt {3}}+\frac {\sqrt {3}}{1+\sqrt {3}}}\, \sqrt {-6 x \sqrt {3}+18-6 \sqrt {3}}\, \sqrt {-\frac {x}{1+\sqrt {3}}}\, \operatorname {EllipticPi}\left (\sqrt {\frac {x +1+\sqrt {3}}{1+\sqrt {3}}}, \frac {-1-\sqrt {3}}{-1-\sqrt {3}-\sqrt {2}}, \frac {\sqrt {6}\, \sqrt {\left (1+\sqrt {3}\right ) \sqrt {3}}}{6}\right ) \sqrt {3}}{3 \sqrt {x^{3}+2 x^{2}-2 x}\, \left (-1-\sqrt {3}-\sqrt {2}\right )}-\frac {\sqrt {2}\, \sqrt {\frac {x}{1+\sqrt {3}}+\frac {1}{1+\sqrt {3}}+\frac {\sqrt {3}}{1+\sqrt {3}}}\, \sqrt {-6 x \sqrt {3}+18-6 \sqrt {3}}\, \sqrt {-\frac {x}{1+\sqrt {3}}}\, \operatorname {EllipticPi}\left (\sqrt {\frac {x +1+\sqrt {3}}{1+\sqrt {3}}}, \frac {-1-\sqrt {3}}{-1-\sqrt {3}+\sqrt {2}}, \frac {\sqrt {6}\, \sqrt {\left (1+\sqrt {3}\right ) \sqrt {3}}}{6}\right )}{3 \sqrt {x^{3}+2 x^{2}-2 x}\, \left (-1-\sqrt {3}+\sqrt {2}\right )}-\frac {\sqrt {2}\, \sqrt {\frac {x}{1+\sqrt {3}}+\frac {1}{1+\sqrt {3}}+\frac {\sqrt {3}}{1+\sqrt {3}}}\, \sqrt {-6 x \sqrt {3}+18-6 \sqrt {3}}\, \sqrt {-\frac {x}{1+\sqrt {3}}}\, \operatorname {EllipticPi}\left (\sqrt {\frac {x +1+\sqrt {3}}{1+\sqrt {3}}}, \frac {-1-\sqrt {3}}{-1-\sqrt {3}+\sqrt {2}}, \frac {\sqrt {6}\, \sqrt {\left (1+\sqrt {3}\right ) \sqrt {3}}}{6}\right ) \sqrt {3}}{3 \sqrt {x^{3}+2 x^{2}-2 x}\, \left (-1-\sqrt {3}+\sqrt {2}\right )}\) \(795\)

[In]

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

[Out]

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

Fricas [A] (verification not implemented)

none

Time = 0.25 (sec) , antiderivative size = 64, normalized size of antiderivative = 1.60 \[ \int \frac {2+x^2}{\left (-2+x^2\right ) \sqrt {-2 x+2 x^2+x^3}} \, dx=\frac {1}{4} \, \sqrt {2} \log \left (\frac {x^{4} + 16 \, x^{3} - 4 \, \sqrt {2} \sqrt {x^{3} + 2 \, x^{2} - 2 \, x} {\left (x^{2} + 4 \, x - 2\right )} + 28 \, x^{2} - 32 \, x + 4}{x^{4} - 4 \, x^{2} + 4}\right ) \]

[In]

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

[Out]

1/4*sqrt(2)*log((x^4 + 16*x^3 - 4*sqrt(2)*sqrt(x^3 + 2*x^2 - 2*x)*(x^2 + 4*x - 2) + 28*x^2 - 32*x + 4)/(x^4 -
4*x^2 + 4))

Sympy [F]

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

[In]

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

[Out]

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

Maxima [F]

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

[In]

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

[Out]

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

Giac [F]

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

[In]

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

[Out]

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

Mupad [B] (verification not implemented)

Time = 0.17 (sec) , antiderivative size = 227, normalized size of antiderivative = 5.68 \[ \int \frac {2+x^2}{\left (-2+x^2\right ) \sqrt {-2 x+2 x^2+x^3}} \, dx=-\frac {2\,\sqrt {x}\,\sqrt {\frac {1}{\sqrt {3}+1}}\,\Pi \left (\sqrt {2}\,\left (\frac {\sqrt {3}}{2}-\frac {1}{2}\right );\mathrm {asin}\left (\sqrt {\frac {x}{\sqrt {3}-1}}\right )\middle |-\frac {\sqrt {3}-1}{\sqrt {3}+1}\right )\,\sqrt {x+\sqrt {3}+1}\,\sqrt {\sqrt {3}-x-1}+2\,\sqrt {x}\,\sqrt {\frac {1}{\sqrt {3}+1}}\,\Pi \left (-\sqrt {2}\,\left (\frac {\sqrt {3}}{2}-\frac {1}{2}\right );\mathrm {asin}\left (\sqrt {\frac {x}{\sqrt {3}-1}}\right )\middle |-\frac {\sqrt {3}-1}{\sqrt {3}+1}\right )\,\sqrt {x+\sqrt {3}+1}\,\sqrt {\sqrt {3}-x-1}-2\,\sqrt {x}\,\sqrt {\frac {1}{\sqrt {3}+1}}\,\mathrm {F}\left (\mathrm {asin}\left (\sqrt {\frac {x}{\sqrt {3}-1}}\right )\middle |-\frac {\sqrt {3}-1}{\sqrt {3}+1}\right )\,\sqrt {x+\sqrt {3}+1}\,\sqrt {\sqrt {3}-x-1}}{\sqrt {x^3+2\,x^2-\left (\sqrt {3}-1\right )\,\left (\sqrt {3}+1\right )\,x}} \]

[In]

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

[Out]

-(2*x^(1/2)*(1/(3^(1/2) + 1))^(1/2)*ellipticPi(2^(1/2)*(3^(1/2)/2 - 1/2), asin((x/(3^(1/2) - 1))^(1/2)), -(3^(
1/2) - 1)/(3^(1/2) + 1))*(x + 3^(1/2) + 1)^(1/2)*(3^(1/2) - x - 1)^(1/2) + 2*x^(1/2)*(1/(3^(1/2) + 1))^(1/2)*e
llipticPi(-2^(1/2)*(3^(1/2)/2 - 1/2), asin((x/(3^(1/2) - 1))^(1/2)), -(3^(1/2) - 1)/(3^(1/2) + 1))*(x + 3^(1/2
) + 1)^(1/2)*(3^(1/2) - x - 1)^(1/2) - 2*x^(1/2)*(1/(3^(1/2) + 1))^(1/2)*ellipticF(asin((x/(3^(1/2) - 1))^(1/2
)), -(3^(1/2) - 1)/(3^(1/2) + 1))*(x + 3^(1/2) + 1)^(1/2)*(3^(1/2) - x - 1)^(1/2))/(2*x^2 + x^3 - x*(3^(1/2) -
 1)*(3^(1/2) + 1))^(1/2)