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

3.8.46.1 Optimal result
3.8.46.2 Mathematica [C] (verified)
3.8.46.3 Rubi [C] (verified)
3.8.46.4 Maple [A] (verified)
3.8.46.5 Fricas [A] (verification not implemented)
3.8.46.6 Sympy [F]
3.8.46.7 Maxima [F]
3.8.46.8 Giac [F]
3.8.46.9 Mupad [B] (verification not implemented)

3.8.46.1 Optimal result

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

output
-3/4*arctan(2*(x^3-x)^(1/2)/(x^2-2*x-1))-1/4*arctanh((-1/2+x+1/2*x^2)/(x^3 
-x)^(1/2))
 
3.8.46.2 Mathematica [C] (verified)

Result contains complex when optimal does not.

Time = 0.47 (sec) , antiderivative size = 84, normalized size of antiderivative = 1.45 \[ \int \frac {-1+x+x^2}{\left (1+x^2\right ) \sqrt {-x+x^3}} \, dx=\frac {\left (\frac {1}{4}+\frac {i}{4}\right ) \sqrt {x} \sqrt {-1+x^2} \left ((-1+2 i) \arctan \left (\frac {(1+i) \sqrt {x}}{\sqrt {-1+x^2}}\right )+(2-i) \arctan \left (\frac {\left (\frac {1}{2}+\frac {i}{2}\right ) \sqrt {-1+x^2}}{\sqrt {x}}\right )\right )}{\sqrt {x \left (-1+x^2\right )}} \]

input
Integrate[(-1 + x + x^2)/((1 + x^2)*Sqrt[-x + x^3]),x]
 
output
((1/4 + I/4)*Sqrt[x]*Sqrt[-1 + x^2]*((-1 + 2*I)*ArcTan[((1 + I)*Sqrt[x])/S 
qrt[-1 + x^2]] + (2 - I)*ArcTan[((1/2 + I/2)*Sqrt[-1 + x^2])/Sqrt[x]]))/Sq 
rt[x*(-1 + x^2)]
 
3.8.46.3 Rubi [C] (verified)

Result contains complex when optimal does not.

Time = 0.67 (sec) , antiderivative size = 82, normalized size of antiderivative = 1.41, number of steps used = 6, number of rules used = 5, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.200, Rules used = {2467, 25, 2035, 7276, 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^2+x-1}{\left (x^2+1\right ) \sqrt {x^3-x}} \, dx\)

\(\Big \downarrow \) 2467

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

\(\Big \downarrow \) 25

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

\(\Big \downarrow \) 2035

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

\(\Big \downarrow \) 7276

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

\(\Big \downarrow \) 2009

\(\displaystyle -\frac {2 \sqrt {x} \sqrt {x^2-1} \left (\left (\frac {3}{8}-\frac {i}{8}\right ) \arctan \left (\frac {(1+i) \sqrt {x}}{\sqrt {x^2-1}}\right )+\left (\frac {1}{8}-\frac {3 i}{8}\right ) \text {arctanh}\left (\frac {(1+i) \sqrt {x}}{\sqrt {x^2-1}}\right )\right )}{\sqrt {x^3-x}}\)

input
Int[(-1 + x + x^2)/((1 + x^2)*Sqrt[-x + x^3]),x]
 
output
(-2*Sqrt[x]*Sqrt[-1 + x^2]*((3/8 - I/8)*ArcTan[((1 + I)*Sqrt[x])/Sqrt[-1 + 
 x^2]] + (1/8 - (3*I)/8)*ArcTanh[((1 + I)*Sqrt[x])/Sqrt[-1 + x^2]]))/Sqrt[ 
-x + x^3]
 

3.8.46.3.1 Defintions of rubi rules used

rule 25
Int[-(Fx_), x_Symbol] :> Simp[Identity[-1]   Int[Fx, x], x]
 

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

rule 2035
Int[(Fx_)*(x_)^(m_), x_Symbol] :> With[{k = Denominator[m]}, Simp[k   Subst 
[Int[x^(k*(m + 1) - 1)*SubstPower[Fx, x, k], x], x, x^(1/k)], x]] /; Fracti 
onQ[m] && AlgebraicFunctionQ[Fx, x]
 

rule 2467
Int[(Fx_.)*(Px_)^(p_), x_Symbol] :> With[{r = Expon[Px, x, Min]}, Simp[Px^F 
racPart[p]/(x^(r*FracPart[p])*ExpandToSum[Px/x^r, x]^FracPart[p])   Int[x^( 
p*r)*ExpandToSum[Px/x^r, x]^p*Fx, x], x] /; IGtQ[r, 0]] /; FreeQ[p, x] && P 
olyQ[Px, x] &&  !IntegerQ[p] &&  !MonomialQ[Px, x] &&  !PolyQ[Fx, x]
 

rule 7276
Int[(u_)/((a_) + (b_.)*(x_)^(n_)), x_Symbol] :> With[{v = RationalFunctionE 
xpand[u/(a + b*x^n), x]}, Int[v, x] /; SumQ[v]] /; FreeQ[{a, b}, x] && IGtQ 
[n, 0]
 
3.8.46.4 Maple [A] (verified)

Time = 3.65 (sec) , antiderivative size = 92, normalized size of antiderivative = 1.59

method result size
default \(-\frac {\ln \left (\frac {x^{2}+2 \sqrt {x^{3}-x}+2 x -1}{x}\right )}{8}+\frac {3 \arctan \left (\frac {\sqrt {x^{3}-x}+x}{x}\right )}{4}+\frac {\ln \left (\frac {x^{2}-2 \sqrt {x^{3}-x}+2 x -1}{x}\right )}{8}+\frac {3 \arctan \left (\frac {\sqrt {x^{3}-x}-x}{x}\right )}{4}\) \(92\)
pseudoelliptic \(-\frac {\ln \left (\frac {x^{2}+2 \sqrt {x^{3}-x}+2 x -1}{x}\right )}{8}+\frac {3 \arctan \left (\frac {\sqrt {x^{3}-x}+x}{x}\right )}{4}+\frac {\ln \left (\frac {x^{2}-2 \sqrt {x^{3}-x}+2 x -1}{x}\right )}{8}+\frac {3 \arctan \left (\frac {\sqrt {x^{3}-x}-x}{x}\right )}{4}\) \(92\)
elliptic \(\frac {\sqrt {1+x}\, \sqrt {2-2 x}\, \sqrt {-x}\, \operatorname {EllipticF}\left (\sqrt {1+x}, \frac {\sqrt {2}}{2}\right )}{\sqrt {x^{3}-x}}-\frac {3 \sqrt {1+x}\, \sqrt {2-2 x}\, \sqrt {-x}\, \operatorname {EllipticPi}\left (\sqrt {1+x}, \frac {1}{2}-\frac {i}{2}, \frac {\sqrt {2}}{2}\right )}{4 \sqrt {x^{3}-x}}-\frac {i \sqrt {1+x}\, \sqrt {2-2 x}\, \sqrt {-x}\, \operatorname {EllipticPi}\left (\sqrt {1+x}, \frac {1}{2}-\frac {i}{2}, \frac {\sqrt {2}}{2}\right )}{4 \sqrt {x^{3}-x}}-\frac {3 \sqrt {1+x}\, \sqrt {2-2 x}\, \sqrt {-x}\, \operatorname {EllipticPi}\left (\sqrt {1+x}, \frac {1}{2}+\frac {i}{2}, \frac {\sqrt {2}}{2}\right )}{4 \sqrt {x^{3}-x}}+\frac {i \sqrt {1+x}\, \sqrt {2-2 x}\, \sqrt {-x}\, \operatorname {EllipticPi}\left (\sqrt {1+x}, \frac {1}{2}+\frac {i}{2}, \frac {\sqrt {2}}{2}\right )}{4 \sqrt {x^{3}-x}}\) \(210\)
trager \(\frac {\operatorname {RootOf}\left (8 \textit {\_Z}^{2}+4 \textit {\_Z} +5\right ) \ln \left (-\frac {-928 \operatorname {RootOf}\left (8 \textit {\_Z}^{2}+4 \textit {\_Z} +5\right )^{2} x^{2}+1392 \operatorname {RootOf}\left (8 \textit {\_Z}^{2}+4 \textit {\_Z} +5\right )^{2} x -14 \operatorname {RootOf}\left (8 \textit {\_Z}^{2}+4 \textit {\_Z} +5\right ) x^{2}+2400 \sqrt {x^{3}-x}\, \operatorname {RootOf}\left (8 \textit {\_Z}^{2}+4 \textit {\_Z} +5\right )+928 \operatorname {RootOf}\left (8 \textit {\_Z}^{2}+4 \textit {\_Z} +5\right )^{2}+2196 \operatorname {RootOf}\left (8 \textit {\_Z}^{2}+4 \textit {\_Z} +5\right ) x +95 x^{2}+1050 \sqrt {x^{3}-x}+14 \operatorname {RootOf}\left (8 \textit {\_Z}^{2}+4 \textit {\_Z} +5\right )+570 x -95}{{\left (4 \operatorname {RootOf}\left (8 \textit {\_Z}^{2}+4 \textit {\_Z} +5\right ) x -8 \operatorname {RootOf}\left (8 \textit {\_Z}^{2}+4 \textit {\_Z} +5\right )+7 x +1\right )}^{2}}\right )}{2}-\frac {\ln \left (\frac {464 \operatorname {RootOf}\left (8 \textit {\_Z}^{2}+4 \textit {\_Z} +5\right )^{2} x^{2}-696 \operatorname {RootOf}\left (8 \textit {\_Z}^{2}+4 \textit {\_Z} +5\right )^{2} x +457 \operatorname {RootOf}\left (8 \textit {\_Z}^{2}+4 \textit {\_Z} +5\right ) x^{2}+1200 \sqrt {x^{3}-x}\, \operatorname {RootOf}\left (8 \textit {\_Z}^{2}+4 \textit {\_Z} +5\right )-464 \operatorname {RootOf}\left (8 \textit {\_Z}^{2}+4 \textit {\_Z} +5\right )^{2}+402 \operatorname {RootOf}\left (8 \textit {\_Z}^{2}+4 \textit {\_Z} +5\right ) x +65 x^{2}+75 \sqrt {x^{3}-x}-457 \operatorname {RootOf}\left (8 \textit {\_Z}^{2}+4 \textit {\_Z} +5\right )+90 x -65}{{\left (4 \operatorname {RootOf}\left (8 \textit {\_Z}^{2}+4 \textit {\_Z} +5\right ) x -8 \operatorname {RootOf}\left (8 \textit {\_Z}^{2}+4 \textit {\_Z} +5\right )-5 x -5\right )}^{2}}\right )}{4}-\frac {\ln \left (\frac {464 \operatorname {RootOf}\left (8 \textit {\_Z}^{2}+4 \textit {\_Z} +5\right )^{2} x^{2}-696 \operatorname {RootOf}\left (8 \textit {\_Z}^{2}+4 \textit {\_Z} +5\right )^{2} x +457 \operatorname {RootOf}\left (8 \textit {\_Z}^{2}+4 \textit {\_Z} +5\right ) x^{2}+1200 \sqrt {x^{3}-x}\, \operatorname {RootOf}\left (8 \textit {\_Z}^{2}+4 \textit {\_Z} +5\right )-464 \operatorname {RootOf}\left (8 \textit {\_Z}^{2}+4 \textit {\_Z} +5\right )^{2}+402 \operatorname {RootOf}\left (8 \textit {\_Z}^{2}+4 \textit {\_Z} +5\right ) x +65 x^{2}+75 \sqrt {x^{3}-x}-457 \operatorname {RootOf}\left (8 \textit {\_Z}^{2}+4 \textit {\_Z} +5\right )+90 x -65}{{\left (4 \operatorname {RootOf}\left (8 \textit {\_Z}^{2}+4 \textit {\_Z} +5\right ) x -8 \operatorname {RootOf}\left (8 \textit {\_Z}^{2}+4 \textit {\_Z} +5\right )-5 x -5\right )}^{2}}\right ) \operatorname {RootOf}\left (8 \textit {\_Z}^{2}+4 \textit {\_Z} +5\right )}{2}\) \(544\)

input
int((x^2+x-1)/(x^2+1)/(x^3-x)^(1/2),x,method=_RETURNVERBOSE)
 
output
-1/8*ln((x^2+2*(x^3-x)^(1/2)+2*x-1)/x)+3/4*arctan(((x^3-x)^(1/2)+x)/x)+1/8 
*ln((x^2-2*(x^3-x)^(1/2)+2*x-1)/x)+3/4*arctan(((x^3-x)^(1/2)-x)/x)
 
3.8.46.5 Fricas [A] (verification not implemented)

Time = 0.30 (sec) , antiderivative size = 76, normalized size of antiderivative = 1.31 \[ \int \frac {-1+x+x^2}{\left (1+x^2\right ) \sqrt {-x+x^3}} \, dx=\frac {3}{4} \, \arctan \left (\frac {x^{2} - 2 \, x - 1}{2 \, \sqrt {x^{3} - x}}\right ) + \frac {1}{8} \, \log \left (\frac {x^{4} + 8 \, x^{3} + 2 \, x^{2} - 4 \, \sqrt {x^{3} - x} {\left (x^{2} + 2 \, x - 1\right )} - 8 \, x + 1}{x^{4} + 2 \, x^{2} + 1}\right ) \]

input
integrate((x^2+x-1)/(x^2+1)/(x^3-x)^(1/2),x, algorithm="fricas")
 
output
3/4*arctan(1/2*(x^2 - 2*x - 1)/sqrt(x^3 - x)) + 1/8*log((x^4 + 8*x^3 + 2*x 
^2 - 4*sqrt(x^3 - x)*(x^2 + 2*x - 1) - 8*x + 1)/(x^4 + 2*x^2 + 1))
 
3.8.46.6 Sympy [F]

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

input
integrate((x**2+x-1)/(x**2+1)/(x**3-x)**(1/2),x)
 
output
Integral((x**2 + x - 1)/(sqrt(x*(x - 1)*(x + 1))*(x**2 + 1)), x)
 
3.8.46.7 Maxima [F]

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

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

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

input
integrate((x^2+x-1)/(x^2+1)/(x^3-x)^(1/2),x, algorithm="giac")
 
output
integrate((x^2 + x - 1)/(sqrt(x^3 - x)*(x^2 + 1)), x)
 
3.8.46.9 Mupad [B] (verification not implemented)

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

input
int((x + x^2 - 1)/((x^3 - x)^(1/2)*(x^2 + 1)),x)
 
output
((-x)^(1/2)*(1 - x)^(1/2)*(x + 1)^(1/2)*ellipticPi(-1i, asin((-x)^(1/2)), 
-1)*(2 + 1i) - 2*(-x)^(1/2)*(1 - x)^(1/2)*(x + 1)^(1/2)*ellipticF(asin((-x 
)^(1/2)), -1) + (-x)^(1/2)*(1 - x)^(1/2)*(x + 1)^(1/2)*ellipticPi(1i, asin 
((-x)^(1/2)), -1)*(2 - 1i))/(x^3 - x)^(1/2)