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

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

[Out]

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

________________________________________________________________________________________

Rubi [A]  time = 0.00, antiderivative size = 11, normalized size of antiderivative = 1.00, number of steps used = 2, number of rules used = 1, integrand size = 11, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.091, Rules used = {627} \[ \frac {x^2}{2}-2 x \]

Antiderivative was successfully verified.

[In]

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

[Out]

-2*x + x^2/2

Rule 627

Int[((d_) + (e_.)*(x_))^(m_.)*((a_) + (c_.)*(x_)^2)^(p_.), x_Symbol] :> Int[(d + e*x)^(m + p)*(a/d + (c*x)/e)^
p, x] /; FreeQ[{a, c, d, e, m, p}, x] && EqQ[c*d^2 + a*e^2, 0] && (IntegerQ[p] || (GtQ[a, 0] && GtQ[d, 0] && I
ntegerQ[m + p]))

Rubi steps

\begin {align*} \int \frac {-4+x^2}{2+x} \, dx &=\int (-2+x) \, dx\\ &=-2 x+\frac {x^2}{2}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]  time = 0.00, size = 11, normalized size = 1.00 \[ \frac {x^2}{2}-2 x \]

Antiderivative was successfully verified.

[In]

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

[Out]

-2*x + x^2/2

________________________________________________________________________________________

fricas [A]  time = 0.60, size = 9, normalized size = 0.82 \[ \frac {1}{2} \, x^{2} - 2 \, x \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

1/2*x^2 - 2*x

________________________________________________________________________________________

giac [A]  time = 0.29, size = 9, normalized size = 0.82 \[ \frac {1}{2} \, x^{2} - 2 \, x \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

1/2*x^2 - 2*x

________________________________________________________________________________________

maple [A]  time = 0.00, size = 10, normalized size = 0.91 \[ \frac {1}{2} x^{2}-2 x \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((x^2-4)/(x+2),x)

[Out]

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

________________________________________________________________________________________

maxima [A]  time = 0.45, size = 9, normalized size = 0.82 \[ \frac {1}{2} \, x^{2} - 2 \, x \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

1/2*x^2 - 2*x

________________________________________________________________________________________

mupad [B]  time = 0.02, size = 6, normalized size = 0.55 \[ \frac {x\,\left (x-4\right )}{2} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((x^2 - 4)/(x + 2),x)

[Out]

(x*(x - 4))/2

________________________________________________________________________________________

sympy [A]  time = 0.06, 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

________________________________________________________________________________________