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

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

Optimal result

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

[Out]

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

Rubi [A] (verified)

Time = 0.28 (sec) , antiderivative size = 28, normalized size of antiderivative = 1.00, number of steps used = 4, number of rules used = 3, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.100, Rules used = {6847, 2119, 213} \[ \int \frac {x^2 \left (-2+x^3\right ) \sqrt {1+x^3}}{1+3 x^3+x^9} \, dx=-\frac {2 \text {arctanh}\left (\frac {\left (x^3+1\right )^{3/2}}{\sqrt {3} x^3}\right )}{3 \sqrt {3}} \]

[In]

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

[Out]

(-2*ArcTanh[(1 + x^3)^(3/2)/(Sqrt[3]*x^3)])/(3*Sqrt[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 2119

Int[((x_)^(m_.)*((A_) + (B_.)*(x_)^(n_.)))/((a_) + (b_.)*(x_)^(k_.) + (c_.)*(x_)^(n_.) + (d_.)*(x_)^(n2_)), x_
Symbol] :> Dist[A^2*((m - n + 1)/(m + 1)), Subst[Int[1/(a + A^2*b*(m - n + 1)^2*x^2), x], x, x^(m + 1)/(A*(m -
 n + 1) + B*(m + 1)*x^n)], x] /; FreeQ[{a, b, c, d, A, B, m, n}, x] && EqQ[n2, 2*n] && EqQ[k, 2*(m + 1)] && Eq
Q[a*B^2*(m + 1)^2 - A^2*d*(m - n + 1)^2, 0] && EqQ[B*c*(m + 1) - 2*A*d*(m - n + 1), 0]

Rule 6847

Int[(u_)*(x_)^(m_.), x_Symbol] :> Dist[1/(m + 1), Subst[Int[SubstFor[x^(m + 1), u, x], x], x, x^(m + 1)], x] /
; FreeQ[m, x] && NeQ[m, -1] && FunctionOfQ[x^(m + 1), u, x]

Rubi steps \begin{align*} \text {integral}& = \frac {1}{3} \text {Subst}\left (\int \frac {(-2+x) \sqrt {1+x}}{1+3 x+x^3} \, dx,x,x^3\right ) \\ & = \frac {2}{3} \text {Subst}\left (\int \frac {x^2 \left (-3+x^2\right )}{-3+6 x^2-3 x^4+x^6} \, dx,x,\sqrt {1+x^3}\right ) \\ & = 2 \text {Subst}\left (\int \frac {1}{-3+9 x^2} \, dx,x,\frac {\left (1+x^3\right )^{3/2}}{3 x^3}\right ) \\ & = -\frac {2 \text {arctanh}\left (\frac {\left (1+x^3\right )^{3/2}}{\sqrt {3} x^3}\right )}{3 \sqrt {3}} \\ \end{align*}

Mathematica [A] (verified)

Time = 0.07 (sec) , antiderivative size = 28, normalized size of antiderivative = 1.00 \[ \int \frac {x^2 \left (-2+x^3\right ) \sqrt {1+x^3}}{1+3 x^3+x^9} \, dx=-\frac {2 \text {arctanh}\left (\frac {\sqrt {3} x^3}{\left (1+x^3\right )^{3/2}}\right )}{3 \sqrt {3}} \]

[In]

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

[Out]

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

Maple [B] (verified)

Leaf count of result is larger than twice the leaf count of optimal. \(63\) vs. \(2(21)=42\).

Time = 2.31 (sec) , antiderivative size = 64, normalized size of antiderivative = 2.29

method result size
default \(\frac {\sqrt {3}\, \left (\ln \left (-\sqrt {3}\, x^{3}+\sqrt {x^{3}+1}\, x^{3}+\sqrt {x^{3}+1}\right )-\ln \left (\sqrt {3}\, x^{3}+\sqrt {x^{3}+1}\, x^{3}+\sqrt {x^{3}+1}\right )\right )}{9}\) \(64\)
pseudoelliptic \(\frac {\sqrt {3}\, \left (\ln \left (-\sqrt {3}\, x^{3}+\sqrt {x^{3}+1}\, x^{3}+\sqrt {x^{3}+1}\right )-\ln \left (\sqrt {3}\, x^{3}+\sqrt {x^{3}+1}\, x^{3}+\sqrt {x^{3}+1}\right )\right )}{9}\) \(64\)
trager \(-\frac {\operatorname {RootOf}\left (\textit {\_Z}^{2}-3\right ) \ln \left (\frac {\operatorname {RootOf}\left (\textit {\_Z}^{2}-3\right ) x^{9}+6 \sqrt {x^{3}+1}\, x^{6}+6 \operatorname {RootOf}\left (\textit {\_Z}^{2}-3\right ) x^{6}+6 \sqrt {x^{3}+1}\, x^{3}+3 \operatorname {RootOf}\left (\textit {\_Z}^{2}-3\right ) x^{3}+\operatorname {RootOf}\left (\textit {\_Z}^{2}-3\right )}{x^{9}+3 x^{3}+1}\right )}{9}\) \(86\)
elliptic \(\frac {\sqrt {2}\, \left (\munderset {\underline {\hspace {1.25 ex}}\alpha =\operatorname {RootOf}\left (\textit {\_Z}^{9}+3 \textit {\_Z}^{3}+1\right )}{\sum }\frac {\left (-\underline {\hspace {1.25 ex}}\alpha ^{6}+\underline {\hspace {1.25 ex}}\alpha ^{3}-1\right ) \left (-\underline {\hspace {1.25 ex}}\alpha ^{8}+\underline {\hspace {1.25 ex}}\alpha ^{7}-\underline {\hspace {1.25 ex}}\alpha ^{6}+\underline {\hspace {1.25 ex}}\alpha ^{5}-\underline {\hspace {1.25 ex}}\alpha ^{4}+\underline {\hspace {1.25 ex}}\alpha ^{3}-4 \underline {\hspace {1.25 ex}}\alpha ^{2}+4 \underline {\hspace {1.25 ex}}\alpha -4\right ) \left (3-i \sqrt {3}\right ) \sqrt {\frac {1+x}{3-i \sqrt {3}}}\, \sqrt {\frac {-1+2 x -i \sqrt {3}}{-3-i \sqrt {3}}}\, \sqrt {\frac {-1+2 x +i \sqrt {3}}{-3+i \sqrt {3}}}\, \operatorname {EllipticPi}\left (\sqrt {\frac {1+x}{\frac {3}{2}-\frac {i \sqrt {3}}{2}}}, \frac {\underline {\hspace {1.25 ex}}\alpha ^{8}}{2}-\frac {\underline {\hspace {1.25 ex}}\alpha ^{7}}{2}+\frac {\underline {\hspace {1.25 ex}}\alpha ^{6}}{2}-\frac {\underline {\hspace {1.25 ex}}\alpha ^{5}}{2}+\frac {\underline {\hspace {1.25 ex}}\alpha ^{4}}{2}-\frac {\underline {\hspace {1.25 ex}}\alpha ^{3}}{2}+2 \underline {\hspace {1.25 ex}}\alpha ^{2}-2 \underline {\hspace {1.25 ex}}\alpha +2-\frac {i \underline {\hspace {1.25 ex}}\alpha ^{4} \sqrt {3}}{6}+\frac {2 i \sqrt {3}\, \underline {\hspace {1.25 ex}}\alpha }{3}+\frac {i \sqrt {3}\, \underline {\hspace {1.25 ex}}\alpha ^{7}}{6}+\frac {i \underline {\hspace {1.25 ex}}\alpha ^{3} \sqrt {3}}{6}-\frac {i \sqrt {3}\, \underline {\hspace {1.25 ex}}\alpha ^{6}}{6}-\frac {2 i \sqrt {3}}{3}-\frac {i \sqrt {3}\, \underline {\hspace {1.25 ex}}\alpha ^{8}}{6}-\frac {2 i \underline {\hspace {1.25 ex}}\alpha ^{2} \sqrt {3}}{3}+\frac {i \sqrt {3}\, \underline {\hspace {1.25 ex}}\alpha ^{5}}{6}, \sqrt {\frac {-\frac {3}{2}+\frac {i \sqrt {3}}{2}}{-\frac {3}{2}-\frac {i \sqrt {3}}{2}}}\right )}{\sqrt {x^{3}+1}}\right )}{27}\) \(298\)

[In]

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

[Out]

1/9*3^(1/2)*(ln(-3^(1/2)*x^3+(x^3+1)^(1/2)*x^3+(x^3+1)^(1/2))-ln(3^(1/2)*x^3+(x^3+1)^(1/2)*x^3+(x^3+1)^(1/2)))

Fricas [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 53 vs. \(2 (21) = 42\).

Time = 0.24 (sec) , antiderivative size = 53, normalized size of antiderivative = 1.89 \[ \int \frac {x^2 \left (-2+x^3\right ) \sqrt {1+x^3}}{1+3 x^3+x^9} \, dx=\frac {1}{9} \, \sqrt {3} \log \left (\frac {x^{9} + 6 \, x^{6} + 3 \, x^{3} - 2 \, \sqrt {3} {\left (x^{6} + x^{3}\right )} \sqrt {x^{3} + 1} + 1}{x^{9} + 3 \, x^{3} + 1}\right ) \]

[In]

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

[Out]

1/9*sqrt(3)*log((x^9 + 6*x^6 + 3*x^3 - 2*sqrt(3)*(x^6 + x^3)*sqrt(x^3 + 1) + 1)/(x^9 + 3*x^3 + 1))

Sympy [F(-1)]

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

[In]

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

[Out]

Timed out

Maxima [F]

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

[In]

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

[Out]

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

Giac [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 58 vs. \(2 (21) = 42\).

Time = 0.27 (sec) , antiderivative size = 58, normalized size of antiderivative = 2.07 \[ \int \frac {x^2 \left (-2+x^3\right ) \sqrt {1+x^3}}{1+3 x^3+x^9} \, dx=-\frac {1}{9} \, \sqrt {3} \log \left ({\left | \sqrt {3} {\left (x^{3} + 1\right )} + {\left (x^{3} + 1\right )}^{\frac {3}{2}} - \sqrt {3} \right |}\right ) + \frac {1}{9} \, \sqrt {3} \log \left ({\left | -\sqrt {3} {\left (x^{3} + 1\right )} + {\left (x^{3} + 1\right )}^{\frac {3}{2}} + \sqrt {3} \right |}\right ) \]

[In]

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

[Out]

-1/9*sqrt(3)*log(abs(sqrt(3)*(x^3 + 1) + (x^3 + 1)^(3/2) - sqrt(3))) + 1/9*sqrt(3)*log(abs(-sqrt(3)*(x^3 + 1)
+ (x^3 + 1)^(3/2) + sqrt(3)))

Mupad [B] (verification not implemented)

Time = 6.34 (sec) , antiderivative size = 236, normalized size of antiderivative = 8.43 \[ \int \frac {x^2 \left (-2+x^3\right ) \sqrt {1+x^3}}{1+3 x^3+x^9} \, dx=\sum _{k=1}^9\frac {\sqrt {6}\,\left (\frac {3}{2}+\frac {\sqrt {3}\,1{}\mathrm {i}}{2}\right )\,\sqrt {-\left (-3+\sqrt {3}\,1{}\mathrm {i}\right )\,\left (x+1\right )}\,\Pi \left (\frac {3+\sqrt {3}\,1{}\mathrm {i}}{2\,\left (\mathrm {root}\left (z^9+3\,z^3+1,z,k\right )+1\right )};\mathrm {asin}\left (\frac {\sqrt {6}\,\sqrt {-\left (-3+\sqrt {3}\,1{}\mathrm {i}\right )\,\left (x+1\right )}}{6}\right )\middle |\frac {1}{2}+\frac {\sqrt {3}\,1{}\mathrm {i}}{2}\right )\,\left (-{\mathrm {root}\left (z^9+3\,z^3+1,z,k\right )}^6+{\mathrm {root}\left (z^9+3\,z^3+1,z,k\right )}^3+2\right )\,{\mathrm {root}\left (z^9+3\,z^3+1,z,k\right )}^2\,\sqrt {3-3\,x+\sqrt {3}\,x\,1{}\mathrm {i}+\sqrt {3}\,1{}\mathrm {i}}\,\sqrt {3-3\,x-\sqrt {3}\,x\,1{}\mathrm {i}-\sqrt {3}\,1{}\mathrm {i}}}{162\,\left (\mathrm {root}\left (z^9+3\,z^3+1,z,k\right )+1\right )\,\sqrt {x^3+1}\,\left ({\mathrm {root}\left (z^9+3\,z^3+1,z,k\right )}^8+{\mathrm {root}\left (z^9+3\,z^3+1,z,k\right )}^2\right )} \]

[In]

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

[Out]

symsum((6^(1/2)*((3^(1/2)*1i)/2 + 3/2)*(-(3^(1/2)*1i - 3)*(x + 1))^(1/2)*ellipticPi((3^(1/2)*1i + 3)/(2*(root(
z^9 + 3*z^3 + 1, z, k) + 1)), asin((6^(1/2)*(-(3^(1/2)*1i - 3)*(x + 1))^(1/2))/6), (3^(1/2)*1i)/2 + 1/2)*(root
(z^9 + 3*z^3 + 1, z, k)^3 - root(z^9 + 3*z^3 + 1, z, k)^6 + 2)*root(z^9 + 3*z^3 + 1, z, k)^2*(3^(1/2)*x*1i - 3
*x + 3^(1/2)*1i + 3)^(1/2)*(3 - 3^(1/2)*x*1i - 3^(1/2)*1i - 3*x)^(1/2))/(162*(root(z^9 + 3*z^3 + 1, z, k) + 1)
*(x^3 + 1)^(1/2)*(root(z^9 + 3*z^3 + 1, z, k)^2 + root(z^9 + 3*z^3 + 1, z, k)^8)), k, 1, 9)