3.486 \(\int \frac {7-2 x+3 x^2-x^3+x^4}{2+x} \, dx\)

Optimal. Leaf size=29 \[ \frac {x^4}{4}-x^3+\frac {9 x^2}{2}-20 x+47 \log (x+2) \]

[Out]

-20*x+9/2*x^2-x^3+1/4*x^4+47*ln(2+x)

________________________________________________________________________________________

Rubi [A]  time = 0.02, antiderivative size = 29, normalized size of antiderivative = 1.00, number of steps used = 2, number of rules used = 1, integrand size = 24, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.042, Rules used = {1850} \[ \frac {x^4}{4}-x^3+\frac {9 x^2}{2}-20 x+47 \log (x+2) \]

Antiderivative was successfully verified.

[In]

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

[Out]

-20*x + (9*x^2)/2 - x^3 + x^4/4 + 47*Log[2 + x]

Rule 1850

Int[(Pq_)*((a_) + (b_.)*(x_)^(n_.))^(p_.), x_Symbol] :> Int[ExpandIntegrand[Pq*(a + b*x^n)^p, x], x] /; FreeQ[
{a, b, n}, x] && PolyQ[Pq, x] && (IGtQ[p, 0] || EqQ[n, 1])

Rubi steps

\begin {align*} \int \frac {7-2 x+3 x^2-x^3+x^4}{2+x} \, dx &=\int \left (-20+9 x-3 x^2+x^3+\frac {47}{2+x}\right ) \, dx\\ &=-20 x+\frac {9 x^2}{2}-x^3+\frac {x^4}{4}+47 \log (2+x)\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]  time = 0.01, size = 30, normalized size = 1.03 \[ \frac {x^4}{4}-x^3+\frac {9 x^2}{2}-20 x+47 \log (x+2)-70 \]

Antiderivative was successfully verified.

[In]

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

[Out]

-70 - 20*x + (9*x^2)/2 - x^3 + x^4/4 + 47*Log[2 + x]

________________________________________________________________________________________

fricas [A]  time = 0.67, size = 25, normalized size = 0.86 \[ \frac {1}{4} \, x^{4} - x^{3} + \frac {9}{2} \, x^{2} - 20 \, x + 47 \, \log \left (x + 2\right ) \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

1/4*x^4 - x^3 + 9/2*x^2 - 20*x + 47*log(x + 2)

________________________________________________________________________________________

giac [A]  time = 0.28, size = 26, normalized size = 0.90 \[ \frac {1}{4} \, x^{4} - x^{3} + \frac {9}{2} \, x^{2} - 20 \, x + 47 \, \log \left ({\left | x + 2 \right |}\right ) \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

1/4*x^4 - x^3 + 9/2*x^2 - 20*x + 47*log(abs(x + 2))

________________________________________________________________________________________

maple [A]  time = 0.00, size = 26, normalized size = 0.90 \[ \frac {x^{4}}{4}-x^{3}+\frac {9 x^{2}}{2}-20 x +47 \ln \left (x +2\right ) \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((x^4-x^3+3*x^2-2*x+7)/(x+2),x)

[Out]

-20*x+9/2*x^2-x^3+1/4*x^4+47*ln(x+2)

________________________________________________________________________________________

maxima [A]  time = 0.76, size = 25, normalized size = 0.86 \[ \frac {1}{4} \, x^{4} - x^{3} + \frac {9}{2} \, x^{2} - 20 \, x + 47 \, \log \left (x + 2\right ) \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

1/4*x^4 - x^3 + 9/2*x^2 - 20*x + 47*log(x + 2)

________________________________________________________________________________________

mupad [B]  time = 0.03, size = 25, normalized size = 0.86 \[ 47\,\ln \left (x+2\right )-20\,x+\frac {9\,x^2}{2}-x^3+\frac {x^4}{4} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((3*x^2 - 2*x - x^3 + x^4 + 7)/(x + 2),x)

[Out]

47*log(x + 2) - 20*x + (9*x^2)/2 - x^3 + x^4/4

________________________________________________________________________________________

sympy [A]  time = 0.08, size = 24, normalized size = 0.83 \[ \frac {x^{4}}{4} - x^{3} + \frac {9 x^{2}}{2} - 20 x + 47 \log {\left (x + 2 \right )} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((x**4-x**3+3*x**2-2*x+7)/(2+x),x)

[Out]

x**4/4 - x**3 + 9*x**2/2 - 20*x + 47*log(x + 2)

________________________________________________________________________________________