\(\int \frac {46+56 x+12 x^2-6 x^3-2 x^4+e^3 (-16-24 x-12 x^2-2 x^3)}{8+12 x+6 x^2+x^3} \, dx\) [1672]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [A] (verified)
   Fricas [B] (verification not implemented)
   Sympy [A] (verification not implemented)
   Maxima [A] (verification not implemented)
   Giac [A] (verification not implemented)
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 55, antiderivative size = 20 \[ \int \frac {46+56 x+12 x^2-6 x^3-2 x^4+e^3 \left (-16-24 x-12 x^2-2 x^3\right )}{8+12 x+6 x^2+x^3} \, dx=-\left (3-e^3-x\right )^2+\frac {1}{(2+x)^2} \]

[Out]

1/(2+x)^2-(-exp(3)+3-x)^2

Rubi [A] (verified)

Time = 0.04 (sec) , antiderivative size = 21, normalized size of antiderivative = 1.05, number of steps used = 2, number of rules used = 1, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.018, Rules used = {2099} \[ \int \frac {46+56 x+12 x^2-6 x^3-2 x^4+e^3 \left (-16-24 x-12 x^2-2 x^3\right )}{8+12 x+6 x^2+x^3} \, dx=-x^2+2 \left (3-e^3\right ) x+\frac {1}{(x+2)^2} \]

[In]

Int[(46 + 56*x + 12*x^2 - 6*x^3 - 2*x^4 + E^3*(-16 - 24*x - 12*x^2 - 2*x^3))/(8 + 12*x + 6*x^2 + x^3),x]

[Out]

2*(3 - E^3)*x - x^2 + (2 + x)^(-2)

Rule 2099

Int[(P_)^(p_)*(Q_)^(q_.), x_Symbol] :> With[{PP = Factor[P]}, Int[ExpandIntegrand[PP^p*Q^q, x], x] /;  !SumQ[N
onfreeFactors[PP, x]]] /; FreeQ[q, x] && PolyQ[P, x] && PolyQ[Q, x] && IntegerQ[p] && NeQ[P, x]

Rubi steps \begin{align*} \text {integral}& = \int \left (-2 \left (-3+e^3\right )-2 x-\frac {2}{(2+x)^3}\right ) \, dx \\ & = 2 \left (3-e^3\right ) x-x^2+\frac {1}{(2+x)^2} \\ \end{align*}

Mathematica [A] (verified)

Time = 0.02 (sec) , antiderivative size = 30, normalized size of antiderivative = 1.50 \[ \int \frac {46+56 x+12 x^2-6 x^3-2 x^4+e^3 \left (-16-24 x-12 x^2-2 x^3\right )}{8+12 x+6 x^2+x^3} \, dx=-2 \left (-\frac {1}{2 (2+x)^2}+\left (-5+e^3\right ) (2+x)+\frac {1}{2} (2+x)^2\right ) \]

[In]

Integrate[(46 + 56*x + 12*x^2 - 6*x^3 - 2*x^4 + E^3*(-16 - 24*x - 12*x^2 - 2*x^3))/(8 + 12*x + 6*x^2 + x^3),x]

[Out]

-2*(-1/2*1/(2 + x)^2 + (-5 + E^3)*(2 + x) + (2 + x)^2/2)

Maple [A] (verified)

Time = 0.07 (sec) , antiderivative size = 20, normalized size of antiderivative = 1.00

method result size
default \(-2 x \,{\mathrm e}^{3}+6 x -x^{2}+\frac {1}{\left (2+x \right )^{2}}\) \(20\)
risch \(-2 x \,{\mathrm e}^{3}-x^{2}+6 x +\frac {1}{x^{2}+4 x +4}\) \(25\)
norman \(\frac {\left (-2 \,{\mathrm e}^{3}+2\right ) x^{3}+\left (-56+24 \,{\mathrm e}^{3}\right ) x -x^{4}-79+32 \,{\mathrm e}^{3}}{\left (2+x \right )^{2}}\) \(36\)
gosper \(-\frac {2 x^{3} {\mathrm e}^{3}+x^{4}-2 x^{3}-24 x \,{\mathrm e}^{3}-32 \,{\mathrm e}^{3}+56 x +79}{x^{2}+4 x +4}\) \(42\)
parallelrisch \(-\frac {2 x^{3} {\mathrm e}^{3}+x^{4}-2 x^{3}-24 x \,{\mathrm e}^{3}-32 \,{\mathrm e}^{3}+56 x +79}{x^{2}+4 x +4}\) \(42\)

[In]

int(((-2*x^3-12*x^2-24*x-16)*exp(3)-2*x^4-6*x^3+12*x^2+56*x+46)/(x^3+6*x^2+12*x+8),x,method=_RETURNVERBOSE)

[Out]

-2*x*exp(3)+6*x-x^2+1/(2+x)^2

Fricas [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 46 vs. \(2 (15) = 30\).

Time = 0.24 (sec) , antiderivative size = 46, normalized size of antiderivative = 2.30 \[ \int \frac {46+56 x+12 x^2-6 x^3-2 x^4+e^3 \left (-16-24 x-12 x^2-2 x^3\right )}{8+12 x+6 x^2+x^3} \, dx=-\frac {x^{4} - 2 \, x^{3} - 20 \, x^{2} + 2 \, {\left (x^{3} + 4 \, x^{2} + 4 \, x\right )} e^{3} - 24 \, x - 1}{x^{2} + 4 \, x + 4} \]

[In]

integrate(((-2*x^3-12*x^2-24*x-16)*exp(3)-2*x^4-6*x^3+12*x^2+56*x+46)/(x^3+6*x^2+12*x+8),x, algorithm="fricas"
)

[Out]

-(x^4 - 2*x^3 - 20*x^2 + 2*(x^3 + 4*x^2 + 4*x)*e^3 - 24*x - 1)/(x^2 + 4*x + 4)

Sympy [A] (verification not implemented)

Time = 0.07 (sec) , antiderivative size = 20, normalized size of antiderivative = 1.00 \[ \int \frac {46+56 x+12 x^2-6 x^3-2 x^4+e^3 \left (-16-24 x-12 x^2-2 x^3\right )}{8+12 x+6 x^2+x^3} \, dx=- x^{2} - x \left (-6 + 2 e^{3}\right ) + \frac {1}{x^{2} + 4 x + 4} \]

[In]

integrate(((-2*x**3-12*x**2-24*x-16)*exp(3)-2*x**4-6*x**3+12*x**2+56*x+46)/(x**3+6*x**2+12*x+8),x)

[Out]

-x**2 - x*(-6 + 2*exp(3)) + 1/(x**2 + 4*x + 4)

Maxima [A] (verification not implemented)

none

Time = 0.19 (sec) , antiderivative size = 23, normalized size of antiderivative = 1.15 \[ \int \frac {46+56 x+12 x^2-6 x^3-2 x^4+e^3 \left (-16-24 x-12 x^2-2 x^3\right )}{8+12 x+6 x^2+x^3} \, dx=-x^{2} - 2 \, x {\left (e^{3} - 3\right )} + \frac {1}{x^{2} + 4 \, x + 4} \]

[In]

integrate(((-2*x^3-12*x^2-24*x-16)*exp(3)-2*x^4-6*x^3+12*x^2+56*x+46)/(x^3+6*x^2+12*x+8),x, algorithm="maxima"
)

[Out]

-x^2 - 2*x*(e^3 - 3) + 1/(x^2 + 4*x + 4)

Giac [A] (verification not implemented)

none

Time = 0.26 (sec) , antiderivative size = 19, normalized size of antiderivative = 0.95 \[ \int \frac {46+56 x+12 x^2-6 x^3-2 x^4+e^3 \left (-16-24 x-12 x^2-2 x^3\right )}{8+12 x+6 x^2+x^3} \, dx=-x^{2} - 2 \, x e^{3} + 6 \, x + \frac {1}{{\left (x + 2\right )}^{2}} \]

[In]

integrate(((-2*x^3-12*x^2-24*x-16)*exp(3)-2*x^4-6*x^3+12*x^2+56*x+46)/(x^3+6*x^2+12*x+8),x, algorithm="giac")

[Out]

-x^2 - 2*x*e^3 + 6*x + 1/(x + 2)^2

Mupad [B] (verification not implemented)

Time = 8.35 (sec) , antiderivative size = 25, normalized size of antiderivative = 1.25 \[ \int \frac {46+56 x+12 x^2-6 x^3-2 x^4+e^3 \left (-16-24 x-12 x^2-2 x^3\right )}{8+12 x+6 x^2+x^3} \, dx=\frac {1}{x^2+4\,x+4}-x^2-x\,\left (2\,{\mathrm {e}}^3-6\right ) \]

[In]

int((56*x - exp(3)*(24*x + 12*x^2 + 2*x^3 + 16) + 12*x^2 - 6*x^3 - 2*x^4 + 46)/(12*x + 6*x^2 + x^3 + 8),x)

[Out]

1/(4*x + x^2 + 4) - x^2 - x*(2*exp(3) - 6)