3.5.66 \(\int \frac {-4+x^2}{2+x} \, dx\) [466]

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

[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 = {641} \begin {gather*} \frac {x^2}{2}-2 x \end {gather*}

Antiderivative was successfully verified.

[In]

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

[Out]

-2*x + x^2/2

Rule 641

Int[((d_) + (e_.)*(x_))^(m_.)*((a_) + (c_.)*(x_)^2)^(p_.), x_Symbol] :> Int[(d + e*x)^(m + p)*(a/d + (c/e)*x)^
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 \begin {gather*} -2 x+\frac {x^2}{2} \end {gather*}

Antiderivative was successfully verified.

[In]

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

[Out]

-2*x + x^2/2

________________________________________________________________________________________

Maple [A]
time = 0.20, size = 10, normalized size = 0.91

method result size
gosper \(\frac {x \left (x -4\right )}{2}\) \(7\)
meijerg \(-\frac {x \left (-\frac {3 x}{2}+6\right )}{3}\) \(9\)
default \(-2 x +\frac {1}{2} x^{2}\) \(10\)
norman \(-2 x +\frac {1}{2} x^{2}\) \(10\)
risch \(-2 x +\frac {1}{2} x^{2}\) \(10\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((x^2-4)/(x+2),x,method=_RETURNVERBOSE)

[Out]

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

________________________________________________________________________________________

Maxima [A]
time = 0.28, size = 9, normalized size = 0.82 \begin {gather*} \frac {1}{2} \, x^{2} - 2 \, x \end {gather*}

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

________________________________________________________________________________________

Fricas [A]
time = 0.37, size = 9, normalized size = 0.82 \begin {gather*} \frac {1}{2} \, x^{2} - 2 \, x \end {gather*}

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

________________________________________________________________________________________

Sympy [A]
time = 0.01, size = 7, normalized size = 0.64 \begin {gather*} \frac {x^{2}}{2} - 2 x \end {gather*}

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 [A]
time = 4.30, size = 9, normalized size = 0.82 \begin {gather*} \frac {1}{2} \, x^{2} - 2 \, x \end {gather*}

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

________________________________________________________________________________________

Mupad [B]
time = 0.02, size = 6, normalized size = 0.55 \begin {gather*} \frac {x\,\left (x-4\right )}{2} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

(x*(x - 4))/2

________________________________________________________________________________________