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

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

Optimal result

Integrand size = 21, antiderivative size = 46 \[ \int \frac {-1+x}{(1+x) \sqrt {x+x^2+x^3}} \, dx=-\frac {2 \sqrt {x} \sqrt {1+x+x^2} \arctan \left (\frac {\sqrt {x}}{\sqrt {1+x+x^2}}\right )}{\sqrt {x+x^2+x^3}} \] Output:

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

Mathematica [A] (verified)

Time = 0.15 (sec) , antiderivative size = 46, normalized size of antiderivative = 1.00 \[ \int \frac {-1+x}{(1+x) \sqrt {x+x^2+x^3}} \, dx=-\frac {2 \sqrt {x} \sqrt {1+x+x^2} \arctan \left (\frac {\sqrt {x}}{\sqrt {1+x+x^2}}\right )}{\sqrt {x \left (1+x+x^2\right )}} \] Input:

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

Output:

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

Rubi [A] (verified)

Time = 0.34 (sec) , antiderivative size = 46, normalized size of antiderivative = 1.00, number of steps used = 6, number of rules used = 5, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.238, Rules used = {2467, 25, 2035, 2212, 216}

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

\(\Big \downarrow \) 2467

\(\displaystyle \frac {\sqrt {x} \sqrt {x^2+x+1} \int -\frac {1-x}{\sqrt {x} (x+1) \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}{\sqrt {x} (x+1) \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}{(x+1) \sqrt {x^2+x+1}}d\sqrt {x}}{\sqrt {x^3+x^2+x}}\)

\(\Big \downarrow \) 2212

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

\(\Big \downarrow \) 216

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

Input:

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

Output:

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

Defintions of rubi rules used

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

rule 216
Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1/(Rt[a, 2]*Rt[b, 2]))*A 
rcTan[Rt[b, 2]*(x/Rt[a, 2])], x] /; FreeQ[{a, b}, x] && PosQ[a/b] && (GtQ[a 
, 0] || GtQ[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 2212
Int[((A_) + (B_.)*(x_)^2)/(((d_) + (e_.)*(x_)^2)*Sqrt[(a_) + (b_.)*(x_)^2 + 
 (c_.)*(x_)^4]), x_Symbol] :> Simp[A   Subst[Int[1/(d - (b*d - 2*a*e)*x^2), 
 x], x, x/Sqrt[a + b*x^2 + c*x^4]], x] /; FreeQ[{a, b, c, d, e, A, B}, x] & 
& EqQ[c*d^2 - a*e^2, 0] && EqQ[B*d + A*e, 0]
 

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]
 
Maple [A] (verified)

Time = 3.02 (sec) , antiderivative size = 18, normalized size of antiderivative = 0.39

method result size
default \(2 \arctan \left (\frac {\sqrt {\left (x^{2}+x +1\right ) x}}{x}\right )\) \(18\)
pseudoelliptic \(2 \arctan \left (\frac {\sqrt {\left (x^{2}+x +1\right ) x}}{x}\right )\) \(18\)
trager \(\operatorname {RootOf}\left (\textit {\_Z}^{2}+1\right ) \ln \left (-\frac {\operatorname {RootOf}\left (\textit {\_Z}^{2}+1\right ) x^{2}+\operatorname {RootOf}\left (\textit {\_Z}^{2}+1\right )-2 \sqrt {x^{3}+x^{2}+x}}{\left (x +1\right )^{2}}\right )\) \(45\)
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 {4 \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 {EllipticPi}\left (\sqrt {\frac {x +\frac {1}{2}+\frac {i \sqrt {3}}{2}}{\frac {1}{2}+\frac {i \sqrt {3}}{2}}}, \frac {-\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}\, \left (\frac {1}{2}-\frac {i \sqrt {3}}{2}\right )}\) \(271\)

Input:

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

Output:

2*arctan(((x^2+x+1)*x)^(1/2)/x)
 

Fricas [A] (verification not implemented)

Time = 0.11 (sec) , antiderivative size = 22, normalized size of antiderivative = 0.48 \[ \int \frac {-1+x}{(1+x) \sqrt {x+x^2+x^3}} \, dx=-\arctan \left (\frac {2 \, \sqrt {x^{3} + x^{2} + x}}{x^{2} + 1}\right ) \] Input:

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

Output:

-arctan(2*sqrt(x^3 + x^2 + x)/(x^2 + 1))
 

Sympy [F]

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

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

Output:

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

Maxima [F]

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

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

Output:

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

Giac [F]

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

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

Output:

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

Mupad [B] (verification not implemented)

Time = 0.26 (sec) , antiderivative size = 179, normalized size of antiderivative = 3.89 \[ \int \frac {-1+x}{(1+x) \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 )-2\,\Pi \left (\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 )\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 - 1)/((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)*1 
i)/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)*(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)) - 2*ellipticPi(1/2 - (3^(1/2)*1 
i)/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)))*1i)/(x^2 + x^3 - x*((3^(1/2)*1i)/2 - 1/2)*((3^(1/2)*1 
i)/2 + 1/2))^(1/2)
 

Reduce [F]

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

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

Output:

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