\(\int \frac {-8-12 x-6 x^2-x^3-128 x^5-112 x^6-36 x^7-4 x^8+e^x (8 x^2+12 x^3+6 x^4+x^5)}{8 x^2+12 x^3+6 x^4+x^5} \, dx\) [7591]

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

Optimal result

Integrand size = 80, antiderivative size = 30 \[ \int \frac {-8-12 x-6 x^2-x^3-128 x^5-112 x^6-36 x^7-4 x^8+e^x \left (8 x^2+12 x^3+6 x^4+x^5\right )}{8 x^2+12 x^3+6 x^4+x^5} \, dx=e^x+\frac {1}{x}-x^2 \left (x+\frac {2 x^2}{2 x+x^2}\right )^2 \]

[Out]

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

Rubi [A] (verified)

Time = 0.48 (sec) , antiderivative size = 48, normalized size of antiderivative = 1.60, number of steps used = 17, number of rules used = 6, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.075, Rules used = {6873, 6874, 2225, 46, 37, 45} \[ \int \frac {-8-12 x-6 x^2-x^3-128 x^5-112 x^6-36 x^7-4 x^8+e^x \left (8 x^2+12 x^3+6 x^4+x^5\right )}{8 x^2+12 x^3+6 x^4+x^5} \, dx=-x^4-4 x^3-\frac {x^2}{4 (x+2)^2}+4 x^2+e^x+\frac {63}{x+2}-\frac {63}{(x+2)^2}+\frac {1}{x} \]

[In]

Int[(-8 - 12*x - 6*x^2 - x^3 - 128*x^5 - 112*x^6 - 36*x^7 - 4*x^8 + E^x*(8*x^2 + 12*x^3 + 6*x^4 + x^5))/(8*x^2
 + 12*x^3 + 6*x^4 + x^5),x]

[Out]

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

Rule 37

Int[((a_.) + (b_.)*(x_))^(m_.)*((c_.) + (d_.)*(x_))^(n_), x_Symbol] :> Simp[(a + b*x)^(m + 1)*((c + d*x)^(n +
1)/((b*c - a*d)*(m + 1))), x] /; FreeQ[{a, b, c, d, m, n}, x] && NeQ[b*c - a*d, 0] && EqQ[m + n + 2, 0] && NeQ
[m, -1]

Rule 45

Int[((a_.) + (b_.)*(x_))^(m_.)*((c_.) + (d_.)*(x_))^(n_.), x_Symbol] :> Int[ExpandIntegrand[(a + b*x)^m*(c + d
*x)^n, x], x] /; FreeQ[{a, b, c, d, n}, x] && NeQ[b*c - a*d, 0] && IGtQ[m, 0] && ( !IntegerQ[n] || (EqQ[c, 0]
&& LeQ[7*m + 4*n + 4, 0]) || LtQ[9*m + 5*(n + 1), 0] || GtQ[m + n + 2, 0])

Rule 46

Int[((a_) + (b_.)*(x_))^(m_)*((c_.) + (d_.)*(x_))^(n_.), x_Symbol] :> Int[ExpandIntegrand[(a + b*x)^m*(c + d*x
)^n, x], x] /; FreeQ[{a, b, c, d}, x] && NeQ[b*c - a*d, 0] && ILtQ[m, 0] && IntegerQ[n] &&  !(IGtQ[n, 0] && Lt
Q[m + n + 2, 0])

Rule 2225

Int[((F_)^((c_.)*((a_.) + (b_.)*(x_))))^(n_.), x_Symbol] :> Simp[(F^(c*(a + b*x)))^n/(b*c*n*Log[F]), x] /; Fre
eQ[{F, a, b, c, n}, x]

Rule 6873

Int[u_, x_Symbol] :> With[{v = NormalizeIntegrand[u, x]}, Int[v, x] /; v =!= u]

Rule 6874

Int[u_, x_Symbol] :> With[{v = ExpandIntegrand[u, x]}, Int[v, x] /; SumQ[v]]

Rubi steps \begin{align*} \text {integral}& = \int \frac {-8-12 x-6 x^2-x^3-128 x^5-112 x^6-36 x^7-4 x^8+e^x \left (8 x^2+12 x^3+6 x^4+x^5\right )}{x^2 (2+x)^3} \, dx \\ & = \int \left (e^x-\frac {6}{(2+x)^3}-\frac {8}{x^2 (2+x)^3}-\frac {12}{x (2+x)^3}-\frac {x}{(2+x)^3}-\frac {128 x^3}{(2+x)^3}-\frac {112 x^4}{(2+x)^3}-\frac {36 x^5}{(2+x)^3}-\frac {4 x^6}{(2+x)^3}\right ) \, dx \\ & = \frac {3}{(2+x)^2}-4 \int \frac {x^6}{(2+x)^3} \, dx-8 \int \frac {1}{x^2 (2+x)^3} \, dx-12 \int \frac {1}{x (2+x)^3} \, dx-36 \int \frac {x^5}{(2+x)^3} \, dx-112 \int \frac {x^4}{(2+x)^3} \, dx-128 \int \frac {x^3}{(2+x)^3} \, dx+\int e^x \, dx-\int \frac {x}{(2+x)^3} \, dx \\ & = e^x+\frac {3}{(2+x)^2}-\frac {x^2}{4 (2+x)^2}-4 \int \left (-80+24 x-6 x^2+x^3+\frac {64}{(2+x)^3}-\frac {192}{(2+x)^2}+\frac {240}{2+x}\right ) \, dx-8 \int \left (\frac {1}{8 x^2}-\frac {3}{16 x}+\frac {1}{4 (2+x)^3}+\frac {1}{4 (2+x)^2}+\frac {3}{16 (2+x)}\right ) \, dx-12 \int \left (\frac {1}{8 x}-\frac {1}{2 (2+x)^3}-\frac {1}{4 (2+x)^2}-\frac {1}{8 (2+x)}\right ) \, dx-36 \int \left (24-6 x+x^2-\frac {32}{(2+x)^3}+\frac {80}{(2+x)^2}-\frac {80}{2+x}\right ) \, dx-112 \int \left (-6+x+\frac {16}{(2+x)^3}-\frac {32}{(2+x)^2}+\frac {24}{2+x}\right ) \, dx-128 \int \left (1-\frac {8}{(2+x)^3}+\frac {12}{(2+x)^2}-\frac {6}{2+x}\right ) \, dx \\ & = e^x+\frac {1}{x}+4 x^2-4 x^3-x^4-\frac {63}{(2+x)^2}-\frac {x^2}{4 (2+x)^2}+\frac {63}{2+x} \\ \end{align*}

Mathematica [A] (verified)

Time = 2.19 (sec) , antiderivative size = 48, normalized size of antiderivative = 1.60 \[ \int \frac {-8-12 x-6 x^2-x^3-128 x^5-112 x^6-36 x^7-4 x^8+e^x \left (8 x^2+12 x^3+6 x^4+x^5\right )}{8 x^2+12 x^3+6 x^4+x^5} \, dx=e^x+\frac {1}{x}+4 x^2-4 x^3-x^4-\frac {63}{(2+x)^2}-\frac {x^2}{4 (2+x)^2}+\frac {63}{2+x} \]

[In]

Integrate[(-8 - 12*x - 6*x^2 - x^3 - 128*x^5 - 112*x^6 - 36*x^7 - 4*x^8 + E^x*(8*x^2 + 12*x^3 + 6*x^4 + x^5))/
(8*x^2 + 12*x^3 + 6*x^4 + x^5),x]

[Out]

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

Maple [A] (verified)

Time = 0.12 (sec) , antiderivative size = 36, normalized size of antiderivative = 1.20

method result size
default \({\mathrm e}^{x}+\frac {1}{x}+\frac {64}{2+x}-\frac {64}{\left (2+x \right )^{2}}+4 x^{2}-4 x^{3}-x^{4}\) \(36\)
parts \({\mathrm e}^{x}+\frac {1}{x}+\frac {64}{2+x}-\frac {64}{\left (2+x \right )^{2}}+4 x^{2}-4 x^{3}-x^{4}\) \(36\)
risch \(-x^{4}-4 x^{3}+4 x^{2}+\frac {65 x^{2}+68 x +4}{x \left (x^{2}+4 x +4\right )}+{\mathrm e}^{x}\) \(43\)
norman \(\frac {4+x^{2}+4 x +{\mathrm e}^{x} x^{3}-16 x^{5}-8 x^{6}-x^{7}+4 \,{\mathrm e}^{x} x +4 \,{\mathrm e}^{x} x^{2}}{x \left (2+x \right )^{2}}\) \(51\)
parallelrisch \(-\frac {x^{7}+8 x^{6}+16 x^{5}-{\mathrm e}^{x} x^{3}-4-4 \,{\mathrm e}^{x} x^{2}-x^{2}-4 \,{\mathrm e}^{x} x -4 x}{x \left (x^{2}+4 x +4\right )}\) \(58\)

[In]

int(((x^5+6*x^4+12*x^3+8*x^2)*exp(x)-4*x^8-36*x^7-112*x^6-128*x^5-x^3-6*x^2-12*x-8)/(x^5+6*x^4+12*x^3+8*x^2),x
,method=_RETURNVERBOSE)

[Out]

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

Fricas [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 60 vs. \(2 (29) = 58\).

Time = 0.31 (sec) , antiderivative size = 60, normalized size of antiderivative = 2.00 \[ \int \frac {-8-12 x-6 x^2-x^3-128 x^5-112 x^6-36 x^7-4 x^8+e^x \left (8 x^2+12 x^3+6 x^4+x^5\right )}{8 x^2+12 x^3+6 x^4+x^5} \, dx=-\frac {x^{7} + 8 \, x^{6} + 16 \, x^{5} - 16 \, x^{3} - 65 \, x^{2} - {\left (x^{3} + 4 \, x^{2} + 4 \, x\right )} e^{x} - 68 \, x - 4}{x^{3} + 4 \, x^{2} + 4 \, x} \]

[In]

integrate(((x^5+6*x^4+12*x^3+8*x^2)*exp(x)-4*x^8-36*x^7-112*x^6-128*x^5-x^3-6*x^2-12*x-8)/(x^5+6*x^4+12*x^3+8*
x^2),x, algorithm="fricas")

[Out]

-(x^7 + 8*x^6 + 16*x^5 - 16*x^3 - 65*x^2 - (x^3 + 4*x^2 + 4*x)*e^x - 68*x - 4)/(x^3 + 4*x^2 + 4*x)

Sympy [A] (verification not implemented)

Time = 0.09 (sec) , antiderivative size = 39, normalized size of antiderivative = 1.30 \[ \int \frac {-8-12 x-6 x^2-x^3-128 x^5-112 x^6-36 x^7-4 x^8+e^x \left (8 x^2+12 x^3+6 x^4+x^5\right )}{8 x^2+12 x^3+6 x^4+x^5} \, dx=- x^{4} - 4 x^{3} + 4 x^{2} - \frac {- 65 x^{2} - 68 x - 4}{x^{3} + 4 x^{2} + 4 x} + e^{x} \]

[In]

integrate(((x**5+6*x**4+12*x**3+8*x**2)*exp(x)-4*x**8-36*x**7-112*x**6-128*x**5-x**3-6*x**2-12*x-8)/(x**5+6*x*
*4+12*x**3+8*x**2),x)

[Out]

-x**4 - 4*x**3 + 4*x**2 - (-65*x**2 - 68*x - 4)/(x**3 + 4*x**2 + 4*x) + exp(x)

Maxima [F]

\[ \int \frac {-8-12 x-6 x^2-x^3-128 x^5-112 x^6-36 x^7-4 x^8+e^x \left (8 x^2+12 x^3+6 x^4+x^5\right )}{8 x^2+12 x^3+6 x^4+x^5} \, dx=\int { -\frac {4 \, x^{8} + 36 \, x^{7} + 112 \, x^{6} + 128 \, x^{5} + x^{3} + 6 \, x^{2} - {\left (x^{5} + 6 \, x^{4} + 12 \, x^{3} + 8 \, x^{2}\right )} e^{x} + 12 \, x + 8}{x^{5} + 6 \, x^{4} + 12 \, x^{3} + 8 \, x^{2}} \,d x } \]

[In]

integrate(((x^5+6*x^4+12*x^3+8*x^2)*exp(x)-4*x^8-36*x^7-112*x^6-128*x^5-x^3-6*x^2-12*x-8)/(x^5+6*x^4+12*x^3+8*
x^2),x, algorithm="maxima")

[Out]

-x^4 - 4*x^3 + 4*x^2 + (x^3 + 6*x^2)*e^x/(x^3 + 6*x^2 + 12*x + 8) + (3*x^2 + 9*x + 4)/(x^3 + 4*x^2 + 4*x) - 12
8*(6*x + 11)/(x^2 + 4*x + 4) + 576*(5*x + 9)/(x^2 + 4*x + 4) - 896*(4*x + 7)/(x^2 + 4*x + 4) + 512*(3*x + 5)/(
x^2 + 4*x + 4) - 3*(x + 3)/(x^2 + 4*x + 4) + (x + 1)/(x^2 + 4*x + 4) + 12*e^x/(x^2 + 4*x + 4) - 8*e^(-2)*exp_i
ntegral_e(3, -x - 2)/(x + 2)^2 + 3/(x^2 + 4*x + 4) - 24*integrate(x*e^x/(x^4 + 8*x^3 + 24*x^2 + 32*x + 16), x)

Giac [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 63 vs. \(2 (29) = 58\).

Time = 0.29 (sec) , antiderivative size = 63, normalized size of antiderivative = 2.10 \[ \int \frac {-8-12 x-6 x^2-x^3-128 x^5-112 x^6-36 x^7-4 x^8+e^x \left (8 x^2+12 x^3+6 x^4+x^5\right )}{8 x^2+12 x^3+6 x^4+x^5} \, dx=-\frac {x^{7} + 8 \, x^{6} + 16 \, x^{5} - x^{3} e^{x} - 16 \, x^{3} - 4 \, x^{2} e^{x} - 65 \, x^{2} - 4 \, x e^{x} - 68 \, x - 4}{x^{3} + 4 \, x^{2} + 4 \, x} \]

[In]

integrate(((x^5+6*x^4+12*x^3+8*x^2)*exp(x)-4*x^8-36*x^7-112*x^6-128*x^5-x^3-6*x^2-12*x-8)/(x^5+6*x^4+12*x^3+8*
x^2),x, algorithm="giac")

[Out]

-(x^7 + 8*x^6 + 16*x^5 - x^3*e^x - 16*x^3 - 4*x^2*e^x - 65*x^2 - 4*x*e^x - 68*x - 4)/(x^3 + 4*x^2 + 4*x)

Mupad [B] (verification not implemented)

Time = 0.23 (sec) , antiderivative size = 37, normalized size of antiderivative = 1.23 \[ \int \frac {-8-12 x-6 x^2-x^3-128 x^5-112 x^6-36 x^7-4 x^8+e^x \left (8 x^2+12 x^3+6 x^4+x^5\right )}{8 x^2+12 x^3+6 x^4+x^5} \, dx={\mathrm {e}}^x+4\,x^2-4\,x^3-x^4+\frac {65\,x^2+68\,x+4}{x\,{\left (x+2\right )}^2} \]

[In]

int(-(12*x - exp(x)*(8*x^2 + 12*x^3 + 6*x^4 + x^5) + 6*x^2 + x^3 + 128*x^5 + 112*x^6 + 36*x^7 + 4*x^8 + 8)/(8*
x^2 + 12*x^3 + 6*x^4 + x^5),x)

[Out]

exp(x) + 4*x^2 - 4*x^3 - x^4 + (68*x + 65*x^2 + 4)/(x*(x + 2)^2)