3.304 \(\int \frac{1+3 x+3 x^2}{1+2 x+2 x^2+x^3} \, dx\)

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

[Out]

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

_______________________________________________________________________________________

Rubi [A]  time = 0.0885131, antiderivative size = 31, normalized size of antiderivative = 1., number of steps used = 6, number of rules used = 5, integrand size = 26, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.192 \[ \log \left (x^2+x+1\right )+\log (x+1)-\frac{2 \tan ^{-1}\left (\frac{2 x+1}{\sqrt{3}}\right )}{\sqrt{3}} \]

Antiderivative was successfully verified.

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

[Out]

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

_______________________________________________________________________________________

Rubi in Sympy [F(-1)]  time = 0., size = 0, normalized size = 0. \[ \text{Timed out} \]

Verification of antiderivative is not currently implemented for this CAS.

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

[Out]

Timed out

_______________________________________________________________________________________

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

Antiderivative was successfully verified.

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

[Out]

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

_______________________________________________________________________________________

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

Verification of antiderivative is not currently implemented for this CAS.

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

[Out]

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

_______________________________________________________________________________________

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

Verification of antiderivative is not currently implemented for this CAS.

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

[Out]

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

_______________________________________________________________________________________

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

Verification of antiderivative is not currently implemented for this CAS.

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

[Out]

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

_______________________________________________________________________________________

Sympy [A]  time = 0.270119, size = 3, normalized size = 0.1 \[ \log{\left (x + 1 \right )} \]

Verification of antiderivative is not currently implemented for this CAS.

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

[Out]

log(x + 1)

_______________________________________________________________________________________

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

Verification of antiderivative is not currently implemented for this CAS.

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

[Out]

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