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

Optimal. Leaf size=17 \[ \frac{x^2}{2}-2 x+6 \log (x+2) \]

[Out]

-2*x + x^2/2 + 6*Log[2 + x]

_______________________________________________________________________________________

Rubi [A]  time = 0.0244233, antiderivative size = 17, normalized size of antiderivative = 1., number of steps used = 2, number of rules used = 1, integrand size = 11, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.091 \[ \frac{x^2}{2}-2 x+6 \log (x+2) \]

Antiderivative was successfully verified.

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

[Out]

-2*x + x^2/2 + 6*Log[2 + x]

_______________________________________________________________________________________

Rubi in Sympy [F]  time = 0., size = 0, normalized size = 0. \[ - 2 x + 6 \log{\left (x + 2 \right )} + \int x\, dx \]

Verification of antiderivative is not currently implemented for this CAS.

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

[Out]

-2*x + 6*log(x + 2) + Integral(x, x)

_______________________________________________________________________________________

Mathematica [A]  time = 0.00535812, size = 18, normalized size = 1.06 \[ \frac{x^2}{2}-2 x+6 \log (x+2)-6 \]

Antiderivative was successfully verified.

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

[Out]

-6 - 2*x + x^2/2 + 6*Log[2 + x]

_______________________________________________________________________________________

Maple [A]  time = 0.003, size = 16, normalized size = 0.9 \[ -2\,x+{\frac{{x}^{2}}{2}}+6\,\ln \left ( 2+x \right ) \]

Verification of antiderivative is not currently implemented for this CAS.

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

[Out]

-2*x+1/2*x^2+6*ln(2+x)

_______________________________________________________________________________________

Maxima [A]  time = 0.7841, size = 20, normalized size = 1.18 \[ \frac{1}{2} \, x^{2} - 2 \, x + 6 \, \log \left (x + 2\right ) \]

Verification of antiderivative is not currently implemented for this CAS.

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

[Out]

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

_______________________________________________________________________________________

Fricas [A]  time = 0.251039, size = 20, normalized size = 1.18 \[ \frac{1}{2} \, x^{2} - 2 \, x + 6 \, \log \left (x + 2\right ) \]

Verification of antiderivative is not currently implemented for this CAS.

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

[Out]

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

_______________________________________________________________________________________

Sympy [A]  time = 0.118431, size = 14, normalized size = 0.82 \[ \frac{x^{2}}{2} - 2 x + 6 \log{\left (x + 2 \right )} \]

Verification of antiderivative is not currently implemented for this CAS.

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

[Out]

x**2/2 - 2*x + 6*log(x + 2)

_______________________________________________________________________________________

GIAC/XCAS [A]  time = 0.258381, size = 22, normalized size = 1.29 \[ \frac{1}{2} \, x^{2} - 2 \, x + 6 \,{\rm ln}\left ({\left | x + 2 \right |}\right ) \]

Verification of antiderivative is not currently implemented for this CAS.

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

[Out]

1/2*x^2 - 2*x + 6*ln(abs(x + 2))