3.466 \(\int \frac{-4+x^2}{2+x} \, dx\)

Optimal. Leaf size=11 \[ \frac{x^2}{2}-2 x \]

[Out]

-2*x + x^2/2

_______________________________________________________________________________________

Rubi [A]  time = 0.0107793, antiderivative size = 11, 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 \]

Antiderivative was successfully verified.

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

[Out]

-2*x + x^2/2

_______________________________________________________________________________________

Rubi in Sympy [F]  time = 0., size = 0, normalized size = 0. \[ - 2 x + \int x\, dx \]

Verification of antiderivative is not currently implemented for this CAS.

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

[Out]

-2*x + Integral(x, x)

_______________________________________________________________________________________

Mathematica [A]  time = 0.00056637, size = 11, normalized size = 1. \[ \frac{x^2}{2}-2 x \]

Antiderivative was successfully verified.

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

[Out]

-2*x + x^2/2

_______________________________________________________________________________________

Maple [A]  time = 0.001, size = 10, normalized size = 0.9 \[ -2\,x+{\frac{{x}^{2}}{2}} \]

Verification of antiderivative is not currently implemented for this CAS.

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

[Out]

-2*x+1/2*x^2

_______________________________________________________________________________________

Maxima [A]  time = 0.807066, size = 12, normalized size = 1.09 \[ \frac{1}{2} \, x^{2} - 2 \, x \]

Verification of antiderivative is not currently implemented for this CAS.

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

[Out]

1/2*x^2 - 2*x

_______________________________________________________________________________________

Fricas [A]  time = 0.25402, size = 12, normalized size = 1.09 \[ \frac{1}{2} \, x^{2} - 2 \, x \]

Verification of antiderivative is not currently implemented for this CAS.

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

[Out]

1/2*x^2 - 2*x

_______________________________________________________________________________________

Sympy [A]  time = 0.062842, size = 7, normalized size = 0.64 \[ \frac{x^{2}}{2} - 2 x \]

Verification of antiderivative is not currently implemented for this CAS.

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

[Out]

x**2/2 - 2*x

_______________________________________________________________________________________

GIAC/XCAS [A]  time = 0.261172, size = 12, normalized size = 1.09 \[ \frac{1}{2} \, x^{2} - 2 \, x \]

Verification of antiderivative is not currently implemented for this CAS.

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

[Out]

1/2*x^2 - 2*x