3.275 \(\int \frac{1+2 x-x^2+8 x^3+x^4}{\left (x+x^2\right ) \left (1+x^3\right )} \, dx\)

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

[Out]

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

_______________________________________________________________________________________

Rubi [A]  time = 0.422485, antiderivative size = 44, normalized size of antiderivative = 1., number of steps used = 7, number of rules used = 6, integrand size = 33, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.182 \[ \log \left (x^2-x+1\right )-\frac{3}{x+1}+\log (x)-2 \log (x+1)-\frac{2 \tan ^{-1}\left (\frac{1-2 x}{\sqrt{3}}\right )}{\sqrt{3}} \]

Antiderivative was successfully verified.

[In]  Int[(1 + 2*x - x^2 + 8*x^3 + x^4)/((x + x^2)*(1 + x^3)),x]

[Out]

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

_______________________________________________________________________________________

Rubi in Sympy [A]  time = 148.204, size = 46, normalized size = 1.05 \[ \log{\left (x \right )} - 2 \log{\left (x + 1 \right )} + \log{\left (x^{2} - x + 1 \right )} + \frac{2 \sqrt{3} \operatorname{atan}{\left (\sqrt{3} \left (\frac{2 x}{3} - \frac{1}{3}\right ) \right )}}{3} - \frac{3}{x + 1} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]  rubi_integrate((x**4+8*x**3-x**2+2*x+1)/(x**2+x)/(x**3+1),x)

[Out]

log(x) - 2*log(x + 1) + log(x**2 - x + 1) + 2*sqrt(3)*atan(sqrt(3)*(2*x/3 - 1/3)
)/3 - 3/(x + 1)

_______________________________________________________________________________________

Mathematica [A]  time = 0.0376188, size = 44, normalized size = 1. \[ \log \left (x^2-x+1\right )-\frac{3}{x+1}+\log (x)-2 \log (x+1)+\frac{2 \tan ^{-1}\left (\frac{2 x-1}{\sqrt{3}}\right )}{\sqrt{3}} \]

Antiderivative was successfully verified.

[In]  Integrate[(1 + 2*x - x^2 + 8*x^3 + x^4)/((x + x^2)*(1 + x^3)),x]

[Out]

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

_______________________________________________________________________________________

Maple [A]  time = 0.013, size = 42, normalized size = 1. \[ -3\, \left ( 1+x \right ) ^{-1}-2\,\ln \left ( 1+x \right ) +\ln \left ( x \right ) +\ln \left ({x}^{2}-x+1 \right ) +{\frac{2\,\sqrt{3}}{3}\arctan \left ({\frac{ \left ( 2\,x-1 \right ) \sqrt{3}}{3}} \right ) } \]

Verification of antiderivative is not currently implemented for this CAS.

[In]  int((x^4+8*x^3-x^2+2*x+1)/(x^2+x)/(x^3+1),x)

[Out]

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

_______________________________________________________________________________________

Maxima [A]  time = 0.888519, size = 55, normalized size = 1.25 \[ \frac{2}{3} \, \sqrt{3} \arctan \left (\frac{1}{3} \, \sqrt{3}{\left (2 \, x - 1\right )}\right ) - \frac{3}{x + 1} + \log \left (x^{2} - x + 1\right ) - 2 \, \log \left (x + 1\right ) + \log \left (x\right ) \]

Verification of antiderivative is not currently implemented for this CAS.

[In]  integrate((x^4 + 8*x^3 - x^2 + 2*x + 1)/((x^3 + 1)*(x^2 + x)),x, algorithm="maxima")

[Out]

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

_______________________________________________________________________________________

Fricas [A]  time = 0.253884, size = 93, normalized size = 2.11 \[ \frac{\sqrt{3}{\left (\sqrt{3}{\left (x + 1\right )} \log \left (x^{2} - x + 1\right ) - 2 \, \sqrt{3}{\left (x + 1\right )} \log \left (x + 1\right ) + \sqrt{3}{\left (x + 1\right )} \log \left (x\right ) + 2 \,{\left (x + 1\right )} \arctan \left (\frac{1}{3} \, \sqrt{3}{\left (2 \, x - 1\right )}\right ) - 3 \, \sqrt{3}\right )}}{3 \,{\left (x + 1\right )}} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]  integrate((x^4 + 8*x^3 - x^2 + 2*x + 1)/((x^3 + 1)*(x^2 + x)),x, algorithm="fricas")

[Out]

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

_______________________________________________________________________________________

Sympy [A]  time = 0.606367, size = 49, normalized size = 1.11 \[ \log{\left (x \right )} - 2 \log{\left (x + 1 \right )} + \log{\left (x^{2} - x + 1 \right )} + \frac{2 \sqrt{3} \operatorname{atan}{\left (\frac{2 \sqrt{3} x}{3} - \frac{\sqrt{3}}{3} \right )}}{3} - \frac{3}{x + 1} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]  integrate((x**4+8*x**3-x**2+2*x+1)/(x**2+x)/(x**3+1),x)

[Out]

log(x) - 2*log(x + 1) + log(x**2 - x + 1) + 2*sqrt(3)*atan(2*sqrt(3)*x/3 - sqrt(
3)/3)/3 - 3/(x + 1)

_______________________________________________________________________________________

GIAC/XCAS [A]  time = 0.262553, size = 58, normalized size = 1.32 \[ \frac{2}{3} \, \sqrt{3} \arctan \left (\frac{1}{3} \, \sqrt{3}{\left (2 \, x - 1\right )}\right ) - \frac{3}{x + 1} +{\rm ln}\left (x^{2} - x + 1\right ) - 2 \,{\rm ln}\left ({\left | x + 1 \right |}\right ) +{\rm ln}\left ({\left | x \right |}\right ) \]

Verification of antiderivative is not currently implemented for this CAS.

[In]  integrate((x^4 + 8*x^3 - x^2 + 2*x + 1)/((x^3 + 1)*(x^2 + x)),x, algorithm="giac")

[Out]

2/3*sqrt(3)*arctan(1/3*sqrt(3)*(2*x - 1)) - 3/(x + 1) + ln(x^2 - x + 1) - 2*ln(a
bs(x + 1)) + ln(abs(x))