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

3.5.17.1 Optimal result
3.5.17.2 Mathematica [A] (verified)
3.5.17.3 Rubi [A] (verified)
3.5.17.4 Maple [A] (verified)
3.5.17.5 Fricas [B] (verification not implemented)
3.5.17.6 Sympy [F]
3.5.17.7 Maxima [F]
3.5.17.8 Giac [F]
3.5.17.9 Mupad [B] (verification not implemented)

3.5.17.1 Optimal result

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

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

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

input
Integrate[(-1 + x^2)/((1 - x + x^2)*Sqrt[x + x^2 + x^3]),x]
 
output
-((Sqrt[2]*Sqrt[x]*Sqrt[1 + x + x^2]*ArcTanh[(Sqrt[2]*Sqrt[x])/Sqrt[1 + x 
+ x^2]])/Sqrt[x*(1 + x + x^2)])
 
3.5.17.3 Rubi [A] (verified)

Time = 0.40 (sec) , antiderivative size = 56, normalized size of antiderivative = 1.65, number of steps used = 6, number of rules used = 5, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.179, Rules used = {2467, 25, 2035, 2537, 219}

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

\(\Big \downarrow \) 2467

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

\(\Big \downarrow \) 25

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

\(\Big \downarrow \) 2035

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

\(\Big \downarrow \) 2537

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

\(\Big \downarrow \) 219

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

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

3.5.17.3.1 Defintions of rubi rules used

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

rule 219
Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1/(Rt[a, 2]*Rt[-b, 2]))* 
ArcTanh[Rt[-b, 2]*(x/Rt[a, 2])], x] /; FreeQ[{a, b}, x] && NegQ[a/b] && (Gt 
Q[a, 0] || LtQ[b, 0])
 

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 2537
Int[((u_)*((A_) + (B_.)*(x_)^4))/Sqrt[v_], x_Symbol] :> With[{a = Coeff[v, 
x, 0], b = Coeff[v, x, 2], c = Coeff[v, x, 4], d = Coeff[1/u, x, 0], e = Co 
eff[1/u, x, 2], f = Coeff[1/u, x, 4]}, Simp[A   Subst[Int[1/(d - (b*d - a*e 
)*x^2), x], x, x/Sqrt[v]], x] /; EqQ[a*B + A*c, 0] && EqQ[c*d - a*f, 0]] /; 
 FreeQ[{A, B}, x] && PolyQ[v, x^2, 2] && PolyQ[1/u, x^2, 2]
 
3.5.17.4 Maple [A] (verified)

Time = 3.44 (sec) , antiderivative size = 25, normalized size of antiderivative = 0.74

method result size
default \(-\sqrt {2}\, \operatorname {arctanh}\left (\frac {\sqrt {x \left (x^{2}+x +1\right )}\, \sqrt {2}}{2 x}\right )\) \(25\)
pseudoelliptic \(-\sqrt {2}\, \operatorname {arctanh}\left (\frac {\sqrt {x \left (x^{2}+x +1\right )}\, \sqrt {2}}{2 x}\right )\) \(25\)
trager \(\frac {\operatorname {RootOf}\left (\textit {\_Z}^{2}-2\right ) \ln \left (\frac {-\operatorname {RootOf}\left (\textit {\_Z}^{2}-2\right ) x^{2}-3 \operatorname {RootOf}\left (\textit {\_Z}^{2}-2\right ) x +4 \sqrt {x^{3}+x^{2}+x}-\operatorname {RootOf}\left (\textit {\_Z}^{2}-2\right )}{x^{2}-x +1}\right )}{2}\) \(62\)
elliptic \(\frac {2 \left (\frac {1}{2}+\frac {i \sqrt {3}}{2}\right ) \sqrt {\frac {x +\frac {1}{2}+\frac {i \sqrt {3}}{2}}{\frac {1}{2}+\frac {i \sqrt {3}}{2}}}\, \sqrt {3}\, \sqrt {i \left (x +\frac {1}{2}-\frac {i \sqrt {3}}{2}\right ) \sqrt {3}}\, \sqrt {\frac {x}{-\frac {1}{2}-\frac {i \sqrt {3}}{2}}}\, \operatorname {EllipticF}\left (\sqrt {\frac {x +\frac {1}{2}+\frac {i \sqrt {3}}{2}}{\frac {1}{2}+\frac {i \sqrt {3}}{2}}}, \frac {\sqrt {3}\, \sqrt {i \left (-\frac {1}{2}-\frac {i \sqrt {3}}{2}\right ) \sqrt {3}}}{3}\right )}{3 \sqrt {x^{3}+x^{2}+x}}+\frac {2 \left (\frac {1}{2}+\frac {i \sqrt {3}}{2}\right )^{2} \sqrt {\frac {x +\frac {1}{2}+\frac {i \sqrt {3}}{2}}{\frac {1}{2}+\frac {i \sqrt {3}}{2}}}\, \sqrt {3}\, \sqrt {i \left (x +\frac {1}{2}-\frac {i \sqrt {3}}{2}\right ) \sqrt {3}}\, \sqrt {\frac {x}{-\frac {1}{2}-\frac {i \sqrt {3}}{2}}}\, \left (-\frac {i \left (\frac {1}{2}+\frac {i \sqrt {3}}{2}\right ) \sqrt {3}}{4}-\frac {5}{8}+\frac {3 i \sqrt {3}}{8}\right ) \operatorname {EllipticPi}\left (\sqrt {\frac {x +\frac {1}{2}+\frac {i \sqrt {3}}{2}}{\frac {1}{2}+\frac {i \sqrt {3}}{2}}}, \frac {1}{2}, \frac {\sqrt {3}\, \sqrt {i \left (-\frac {1}{2}-\frac {i \sqrt {3}}{2}\right ) \sqrt {3}}}{3}\right )}{3 \sqrt {x^{3}+x^{2}+x}}+\frac {2 \left (\frac {1}{2}-\frac {i \sqrt {3}}{2}\right ) \left (\frac {1}{2}+\frac {i \sqrt {3}}{2}\right ) \sqrt {\frac {x +\frac {1}{2}+\frac {i \sqrt {3}}{2}}{\frac {1}{2}+\frac {i \sqrt {3}}{2}}}\, \sqrt {3}\, \sqrt {i \left (x +\frac {1}{2}-\frac {i \sqrt {3}}{2}\right ) \sqrt {3}}\, \sqrt {\frac {x}{-\frac {1}{2}-\frac {i \sqrt {3}}{2}}}\, \left (-\frac {i \left (\frac {1}{2}-\frac {i \sqrt {3}}{2}\right ) \sqrt {3}}{4}-\frac {5}{8}+\frac {i \sqrt {3}}{8}\right ) \operatorname {EllipticPi}\left (\sqrt {\frac {x +\frac {1}{2}+\frac {i \sqrt {3}}{2}}{\frac {1}{2}+\frac {i \sqrt {3}}{2}}}, \frac {1}{2}+\frac {i \sqrt {3}}{2}, \frac {\sqrt {3}\, \sqrt {i \left (-\frac {1}{2}-\frac {i \sqrt {3}}{2}\right ) \sqrt {3}}}{3}\right )}{3 \sqrt {x^{3}+x^{2}+x}}\) \(425\)

input
int((x^2-1)/(x^2-x+1)/(x^3+x^2+x)^(1/2),x,method=_RETURNVERBOSE)
 
output
-2^(1/2)*arctanh(1/2*(x*(x^2+x+1))^(1/2)/x*2^(1/2))
 
3.5.17.5 Fricas [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 68 vs. \(2 (28) = 56\).

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

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

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

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

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

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

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

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

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

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