3.94 \(\int \frac{x^2}{5+2 x+x^2} \, dx\)

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

[Out]

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

_______________________________________________________________________________________

Rubi [A]  time = 0.0443573, antiderivative size = 25, normalized size of antiderivative = 1., number of steps used = 5, number of rules used = 5, integrand size = 14, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.357 \[ -\log \left (x^2+2 x+5\right )+x-\frac{3}{2} \tan ^{-1}\left (\frac{x+1}{2}\right ) \]

Antiderivative was successfully verified.

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

[Out]

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

_______________________________________________________________________________________

Rubi in Sympy [A]  time = 3.76183, size = 22, normalized size = 0.88 \[ x - \log{\left (x^{2} + 2 x + 5 \right )} - \frac{3 \operatorname{atan}{\left (\frac{x}{2} + \frac{1}{2} \right )}}{2} \]

Verification of antiderivative is not currently implemented for this CAS.

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

[Out]

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

_______________________________________________________________________________________

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

Antiderivative was successfully verified.

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

[Out]

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

_______________________________________________________________________________________

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

Verification of antiderivative is not currently implemented for this CAS.

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

[Out]

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

_______________________________________________________________________________________

Maxima [A]  time = 1.50057, size = 28, normalized size = 1.12 \[ x - \frac{3}{2} \, \arctan \left (\frac{1}{2} \, x + \frac{1}{2}\right ) - \log \left (x^{2} + 2 \, x + 5\right ) \]

Verification of antiderivative is not currently implemented for this CAS.

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

[Out]

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

_______________________________________________________________________________________

Fricas [A]  time = 0.199437, size = 28, normalized size = 1.12 \[ x - \frac{3}{2} \, \arctan \left (\frac{1}{2} \, x + \frac{1}{2}\right ) - \log \left (x^{2} + 2 \, x + 5\right ) \]

Verification of antiderivative is not currently implemented for this CAS.

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

[Out]

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

_______________________________________________________________________________________

Sympy [A]  time = 0.118235, size = 22, normalized size = 0.88 \[ x - \log{\left (x^{2} + 2 x + 5 \right )} - \frac{3 \operatorname{atan}{\left (\frac{x}{2} + \frac{1}{2} \right )}}{2} \]

Verification of antiderivative is not currently implemented for this CAS.

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

[Out]

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

_______________________________________________________________________________________

GIAC/XCAS [A]  time = 0.20023, size = 28, normalized size = 1.12 \[ x - \frac{3}{2} \, \arctan \left (\frac{1}{2} \, x + \frac{1}{2}\right ) -{\rm ln}\left (x^{2} + 2 \, x + 5\right ) \]

Verification of antiderivative is not currently implemented for this CAS.

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

[Out]

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