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

Optimal. Leaf size=34 \[ -\frac {2 \tanh ^{-1}\left (\frac {\sqrt {3} \sqrt {x+x^2+x^3}}{1+x+x^2}\right )}{\sqrt {3}} \]

[Out]

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

________________________________________________________________________________________

Rubi [A]
time = 0.27, antiderivative size = 56, normalized size of antiderivative = 1.65, number of steps used = 4, number of rules used = 4, integrand size = 21, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.190, Rules used = {2081, 6865, 1712, 213} \begin {gather*} -\frac {2 \sqrt {x} \sqrt {x^2+x+1} \tanh ^{-1}\left (\frac {\sqrt {3} \sqrt {x}}{\sqrt {x^2+x+1}}\right )}{\sqrt {3} \sqrt {x^3+x^2+x}} \end {gather*}

Antiderivative was successfully verified.

[In]

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

[Out]

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

Rule 213

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

Rule 1712

Int[((A_) + (B_.)*(x_)^2)/(((d_) + (e_.)*(x_)^2)*Sqrt[(a_) + (b_.)*(x_)^2 + (c_.)*(x_)^4]), x_Symbol] :> Dist[
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] && NeQ[b^2 - 4*a*c, 0] && NeQ[c*d^2 - b*d*e + a*e^2, 0] && EqQ[c*d^2 - a*e^2, 0] && EqQ[B*d + A*e, 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 6865

Int[(u_)*(x_)^(m_), x_Symbol] :> With[{k = Denominator[m]}, Dist[k, Subst[Int[x^(k*(m + 1) - 1)*(u /. x -> x^k
), x], x, x^(1/k)], x]] /; FractionQ[m]

Rubi steps

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

________________________________________________________________________________________

Mathematica [A]
time = 0.18, size = 56, normalized size = 1.65 \begin {gather*} -\frac {2 \sqrt {x} \sqrt {1+x+x^2} \tanh ^{-1}\left (\frac {\sqrt {3} \sqrt {x}}{\sqrt {1+x+x^2}}\right )}{\sqrt {3} \sqrt {x \left (1+x+x^2\right )}} \end {gather*}

Antiderivative was successfully verified.

[In]

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

[Out]

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

________________________________________________________________________________________

Maple [C] Result contains higher order function than in optimal. Order 4 vs. order 3.
time = 1.01, size = 271, normalized size = 7.97

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

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

2/3*(1/2+1/2*I*3^(1/2))*((x+1/2+1/2*I*3^(1/2))/(1/2+1/2*I*3^(1/2)))^(1/2)*3^(1/2)*(I*(x+1/2-1/2*I*3^(1/2))*3^(
1/2))^(1/2)*(x/(-1/2-1/2*I*3^(1/2)))^(1/2)/(x^3+x^2+x)^(1/2)*EllipticF(((x+1/2+1/2*I*3^(1/2))/(1/2+1/2*I*3^(1/
2)))^(1/2),1/3*3^(1/2)*(I*(-1/2-1/2*I*3^(1/2))*3^(1/2))^(1/2))+4/3*(1/2+1/2*I*3^(1/2))*((x+1/2+1/2*I*3^(1/2))/
(1/2+1/2*I*3^(1/2)))^(1/2)*3^(1/2)*(I*(x+1/2-1/2*I*3^(1/2))*3^(1/2))^(1/2)*(x/(-1/2-1/2*I*3^(1/2)))^(1/2)/(x^3
+x^2+x)^(1/2)/(-3/2-1/2*I*3^(1/2))*EllipticPi(((x+1/2+1/2*I*3^(1/2))/(1/2+1/2*I*3^(1/2)))^(1/2),(-1/2-1/2*I*3^
(1/2))/(-3/2-1/2*I*3^(1/2)),1/3*3^(1/2)*(I*(-1/2-1/2*I*3^(1/2))*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+x)/(-1+x)/(x^3+x^2+x)^(1/2),x, algorithm="maxima")

[Out]

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

________________________________________________________________________________________

Fricas [B] Leaf count of result is larger than twice the leaf count of optimal. 68 vs. \(2 (28) = 56\).
time = 0.38, size = 68, normalized size = 2.00 \begin {gather*} \frac {1}{6} \, \sqrt {3} \log \left (\frac {x^{4} + 20 \, x^{3} - 4 \, \sqrt {3} \sqrt {x^{3} + x^{2} + x} {\left (x^{2} + 4 \, x + 1\right )} + 30 \, x^{2} + 20 \, x + 1}{x^{4} - 4 \, x^{3} + 6 \, x^{2} - 4 \, x + 1}\right ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

1/6*sqrt(3)*log((x^4 + 20*x^3 - 4*sqrt(3)*sqrt(x^3 + x^2 + x)*(x^2 + 4*x + 1) + 30*x^2 + 20*x + 1)/(x^4 - 4*x^
3 + 6*x^2 - 4*x + 1))

________________________________________________________________________________________

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

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

Integral((x + 1)/(sqrt(x*(x**2 + x + 1))*(x - 1)), 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+x)/(-1+x)/(x^3+x^2+x)^(1/2),x, algorithm="giac")

[Out]

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

________________________________________________________________________________________

Mupad [B]
time = 0.32, size = 179, normalized size = 5.26 \begin {gather*} \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}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

((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)*(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((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)))*1i)/(x^2 + x^3 - x*((3^(1/2)*1i)/2 - 1/2)*((3^(1/
2)*1i)/2 + 1/2))^(1/2)

________________________________________________________________________________________