\(\int \frac {-36 x^2-60 x^3-37 x^4-10 x^5-x^6+e^x (-12-8 x+6 x^2+8 x^3+2 x^4+e^2 (-12-8 x+5 x^2+5 x^3+x^4))}{36 x^2+60 x^3+37 x^4+10 x^5+x^6} \, dx\) [695]

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

Optimal result

Integrand size = 99, antiderivative size = 31 \[ \int \frac {-36 x^2-60 x^3-37 x^4-10 x^5-x^6+e^x \left (-12-8 x+6 x^2+8 x^3+2 x^4+e^2 \left (-12-8 x+5 x^2+5 x^3+x^4\right )\right )}{36 x^2+60 x^3+37 x^4+10 x^5+x^6} \, dx=-2-x+\frac {e^x \left (2+e^2-\frac {4}{4+2 x}\right )}{x (3+x)} \]

[Out]

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

Rubi [A] (verified)

Time = 1.06 (sec) , antiderivative size = 45, normalized size of antiderivative = 1.45, number of steps used = 14, number of rules used = 4, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.040, Rules used = {6820, 6874, 2208, 2209} \[ \int \frac {-36 x^2-60 x^3-37 x^4-10 x^5-x^6+e^x \left (-12-8 x+6 x^2+8 x^3+2 x^4+e^2 \left (-12-8 x+5 x^2+5 x^3+x^4\right )\right )}{36 x^2+60 x^3+37 x^4+10 x^5+x^6} \, dx=-x+\frac {e^x}{x+2}-\frac {\left (4+e^2\right ) e^x}{3 (x+3)}+\frac {\left (1+e^2\right ) e^x}{3 x} \]

[In]

Int[(-36*x^2 - 60*x^3 - 37*x^4 - 10*x^5 - x^6 + E^x*(-12 - 8*x + 6*x^2 + 8*x^3 + 2*x^4 + E^2*(-12 - 8*x + 5*x^
2 + 5*x^3 + x^4)))/(36*x^2 + 60*x^3 + 37*x^4 + 10*x^5 + x^6),x]

[Out]

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

Rule 2208

Int[((b_.)*(F_)^((g_.)*((e_.) + (f_.)*(x_))))^(n_.)*((c_.) + (d_.)*(x_))^(m_), x_Symbol] :> Simp[(c + d*x)^(m
+ 1)*((b*F^(g*(e + f*x)))^n/(d*(m + 1))), x] - Dist[f*g*n*(Log[F]/(d*(m + 1))), Int[(c + d*x)^(m + 1)*(b*F^(g*
(e + f*x)))^n, x], x] /; FreeQ[{F, b, c, d, e, f, g, n}, x] && LtQ[m, -1] && IntegerQ[2*m] &&  !TrueQ[$UseGamm
a]

Rule 2209

Int[(F_)^((g_.)*((e_.) + (f_.)*(x_)))/((c_.) + (d_.)*(x_)), x_Symbol] :> Simp[(F^(g*(e - c*(f/d)))/d)*ExpInteg
ralEi[f*g*(c + d*x)*(Log[F]/d)], x] /; FreeQ[{F, c, d, e, f, g}, x] &&  !TrueQ[$UseGamma]

Rule 6820

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

Rule 6874

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

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

Mathematica [A] (verified)

Time = 10.18 (sec) , antiderivative size = 34, normalized size of antiderivative = 1.10 \[ \int \frac {-36 x^2-60 x^3-37 x^4-10 x^5-x^6+e^x \left (-12-8 x+6 x^2+8 x^3+2 x^4+e^2 \left (-12-8 x+5 x^2+5 x^3+x^4\right )\right )}{36 x^2+60 x^3+37 x^4+10 x^5+x^6} \, dx=-x+\frac {e^x \left (2 (1+x)+e^2 (2+x)\right )}{x (2+x) (3+x)} \]

[In]

Integrate[(-36*x^2 - 60*x^3 - 37*x^4 - 10*x^5 - x^6 + E^x*(-12 - 8*x + 6*x^2 + 8*x^3 + 2*x^4 + E^2*(-12 - 8*x
+ 5*x^2 + 5*x^3 + x^4)))/(36*x^2 + 60*x^3 + 37*x^4 + 10*x^5 + x^6),x]

[Out]

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

Maple [A] (verified)

Time = 0.12 (sec) , antiderivative size = 34, normalized size of antiderivative = 1.10

method result size
risch \(-x +\frac {\left ({\mathrm e}^{2} x +2 \,{\mathrm e}^{2}+2 x +2\right ) {\mathrm e}^{x}}{x \left (x^{2}+5 x +6\right )}\) \(34\)
norman \(\frac {19 x^{2}+30 x +\left (2 \,{\mathrm e}^{2}+2\right ) {\mathrm e}^{x}+\left ({\mathrm e}^{2}+2\right ) x \,{\mathrm e}^{x}-x^{4}}{x \left (x^{2}+5 x +6\right )}\) \(46\)
parallelrisch \(\frac {-x^{4}+x \,{\mathrm e}^{2} {\mathrm e}^{x}+2 \,{\mathrm e}^{2} {\mathrm e}^{x}+19 x^{2}+2 \,{\mathrm e}^{x} x +30 x +2 \,{\mathrm e}^{x}}{x \left (x^{2}+5 x +6\right )}\) \(50\)
default \({\mathrm e}^{2} \left (-\frac {9 \,{\mathrm e}^{x}}{3+x}-21 \,{\mathrm e}^{-3} \operatorname {Ei}_{1}\left (-3-x \right )-\frac {4 \,{\mathrm e}^{x}}{2+x}+8 \,{\mathrm e}^{-2} \operatorname {Ei}_{1}\left (-2-x \right )\right )-x -\frac {4 \,{\mathrm e}^{x}}{3 \left (3+x \right )}+\frac {{\mathrm e}^{x}}{3 x}+\frac {{\mathrm e}^{x}}{2+x}-12 \,{\mathrm e}^{2} \left (\frac {\operatorname {Ei}_{1}\left (-x \right )}{54}-\frac {{\mathrm e}^{x}}{9 \left (3+x \right )}-\frac {11 \,{\mathrm e}^{-3} \operatorname {Ei}_{1}\left (-3-x \right )}{27}-\frac {{\mathrm e}^{x}}{36 x}-\frac {{\mathrm e}^{x}}{4 \left (2+x \right )}\right )-8 \,{\mathrm e}^{2} \left (-\frac {\operatorname {Ei}_{1}\left (-x \right )}{36}+\frac {{\mathrm e}^{x}}{3 x +9}+\frac {10 \,{\mathrm e}^{-3} \operatorname {Ei}_{1}\left (-3-x \right )}{9}+\frac {{\mathrm e}^{x}}{4+2 x}-\frac {{\mathrm e}^{-2} \operatorname {Ei}_{1}\left (-2-x \right )}{4}\right )+5 \,{\mathrm e}^{2} \left (-\frac {{\mathrm e}^{x}}{3+x}-3 \,{\mathrm e}^{-3} \operatorname {Ei}_{1}\left (-3-x \right )-\frac {{\mathrm e}^{x}}{2+x}+{\mathrm e}^{-2} \operatorname {Ei}_{1}\left (-2-x \right )\right )+5 \,{\mathrm e}^{2} \left (\frac {3 \,{\mathrm e}^{x}}{3+x}+8 \,{\mathrm e}^{-3} \operatorname {Ei}_{1}\left (-3-x \right )+\frac {2 \,{\mathrm e}^{x}}{2+x}-3 \,{\mathrm e}^{-2} \operatorname {Ei}_{1}\left (-2-x \right )\right )\) \(262\)
parts \({\mathrm e}^{2} \left (-\frac {9 \,{\mathrm e}^{x}}{3+x}-21 \,{\mathrm e}^{-3} \operatorname {Ei}_{1}\left (-3-x \right )-\frac {4 \,{\mathrm e}^{x}}{2+x}+8 \,{\mathrm e}^{-2} \operatorname {Ei}_{1}\left (-2-x \right )\right )-x -\frac {4 \,{\mathrm e}^{x}}{3 \left (3+x \right )}+\frac {{\mathrm e}^{x}}{3 x}+\frac {{\mathrm e}^{x}}{2+x}-12 \,{\mathrm e}^{2} \left (\frac {\operatorname {Ei}_{1}\left (-x \right )}{54}-\frac {{\mathrm e}^{x}}{9 \left (3+x \right )}-\frac {11 \,{\mathrm e}^{-3} \operatorname {Ei}_{1}\left (-3-x \right )}{27}-\frac {{\mathrm e}^{x}}{36 x}-\frac {{\mathrm e}^{x}}{4 \left (2+x \right )}\right )-8 \,{\mathrm e}^{2} \left (-\frac {\operatorname {Ei}_{1}\left (-x \right )}{36}+\frac {{\mathrm e}^{x}}{3 x +9}+\frac {10 \,{\mathrm e}^{-3} \operatorname {Ei}_{1}\left (-3-x \right )}{9}+\frac {{\mathrm e}^{x}}{4+2 x}-\frac {{\mathrm e}^{-2} \operatorname {Ei}_{1}\left (-2-x \right )}{4}\right )+5 \,{\mathrm e}^{2} \left (-\frac {{\mathrm e}^{x}}{3+x}-3 \,{\mathrm e}^{-3} \operatorname {Ei}_{1}\left (-3-x \right )-\frac {{\mathrm e}^{x}}{2+x}+{\mathrm e}^{-2} \operatorname {Ei}_{1}\left (-2-x \right )\right )+5 \,{\mathrm e}^{2} \left (\frac {3 \,{\mathrm e}^{x}}{3+x}+8 \,{\mathrm e}^{-3} \operatorname {Ei}_{1}\left (-3-x \right )+\frac {2 \,{\mathrm e}^{x}}{2+x}-3 \,{\mathrm e}^{-2} \operatorname {Ei}_{1}\left (-2-x \right )\right )\) \(262\)

[In]

int((((x^4+5*x^3+5*x^2-8*x-12)*exp(2)+2*x^4+8*x^3+6*x^2-8*x-12)*exp(x)-x^6-10*x^5-37*x^4-60*x^3-36*x^2)/(x^6+1
0*x^5+37*x^4+60*x^3+36*x^2),x,method=_RETURNVERBOSE)

[Out]

-x+(exp(2)*x+2*exp(2)+2*x+2)/x/(x^2+5*x+6)*exp(x)

Fricas [A] (verification not implemented)

none

Time = 0.24 (sec) , antiderivative size = 45, normalized size of antiderivative = 1.45 \[ \int \frac {-36 x^2-60 x^3-37 x^4-10 x^5-x^6+e^x \left (-12-8 x+6 x^2+8 x^3+2 x^4+e^2 \left (-12-8 x+5 x^2+5 x^3+x^4\right )\right )}{36 x^2+60 x^3+37 x^4+10 x^5+x^6} \, dx=-\frac {x^{4} + 5 \, x^{3} + 6 \, x^{2} - {\left ({\left (x + 2\right )} e^{2} + 2 \, x + 2\right )} e^{x}}{x^{3} + 5 \, x^{2} + 6 \, x} \]

[In]

integrate((((x^4+5*x^3+5*x^2-8*x-12)*exp(2)+2*x^4+8*x^3+6*x^2-8*x-12)*exp(x)-x^6-10*x^5-37*x^4-60*x^3-36*x^2)/
(x^6+10*x^5+37*x^4+60*x^3+36*x^2),x, algorithm="fricas")

[Out]

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

Sympy [A] (verification not implemented)

Time = 0.10 (sec) , antiderivative size = 31, normalized size of antiderivative = 1.00 \[ \int \frac {-36 x^2-60 x^3-37 x^4-10 x^5-x^6+e^x \left (-12-8 x+6 x^2+8 x^3+2 x^4+e^2 \left (-12-8 x+5 x^2+5 x^3+x^4\right )\right )}{36 x^2+60 x^3+37 x^4+10 x^5+x^6} \, dx=- x + \frac {\left (2 x + x e^{2} + 2 + 2 e^{2}\right ) e^{x}}{x^{3} + 5 x^{2} + 6 x} \]

[In]

integrate((((x**4+5*x**3+5*x**2-8*x-12)*exp(2)+2*x**4+8*x**3+6*x**2-8*x-12)*exp(x)-x**6-10*x**5-37*x**4-60*x**
3-36*x**2)/(x**6+10*x**5+37*x**4+60*x**3+36*x**2),x)

[Out]

-x + (2*x + x*exp(2) + 2 + 2*exp(2))*exp(x)/(x**3 + 5*x**2 + 6*x)

Maxima [B] (verification not implemented)

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

Time = 0.26 (sec) , antiderivative size = 117, normalized size of antiderivative = 3.77 \[ \int \frac {-36 x^2-60 x^3-37 x^4-10 x^5-x^6+e^x \left (-12-8 x+6 x^2+8 x^3+2 x^4+e^2 \left (-12-8 x+5 x^2+5 x^3+x^4\right )\right )}{36 x^2+60 x^3+37 x^4+10 x^5+x^6} \, dx=-x + \frac {{\left (x {\left (e^{2} + 2\right )} + 2 \, e^{2} + 2\right )} e^{x}}{x^{3} + 5 \, x^{2} + 6 \, x} + \frac {97 \, x + 210}{x^{2} + 5 \, x + 6} - \frac {10 \, {\left (35 \, x + 78\right )}}{x^{2} + 5 \, x + 6} + \frac {37 \, {\left (13 \, x + 30\right )}}{x^{2} + 5 \, x + 6} - \frac {60 \, {\left (5 \, x + 12\right )}}{x^{2} + 5 \, x + 6} + \frac {36 \, {\left (2 \, x + 5\right )}}{x^{2} + 5 \, x + 6} \]

[In]

integrate((((x^4+5*x^3+5*x^2-8*x-12)*exp(2)+2*x^4+8*x^3+6*x^2-8*x-12)*exp(x)-x^6-10*x^5-37*x^4-60*x^3-36*x^2)/
(x^6+10*x^5+37*x^4+60*x^3+36*x^2),x, algorithm="maxima")

[Out]

-x + (x*(e^2 + 2) + 2*e^2 + 2)*e^x/(x^3 + 5*x^2 + 6*x) + (97*x + 210)/(x^2 + 5*x + 6) - 10*(35*x + 78)/(x^2 +
5*x + 6) + 37*(13*x + 30)/(x^2 + 5*x + 6) - 60*(5*x + 12)/(x^2 + 5*x + 6) + 36*(2*x + 5)/(x^2 + 5*x + 6)

Giac [A] (verification not implemented)

none

Time = 0.28 (sec) , antiderivative size = 52, normalized size of antiderivative = 1.68 \[ \int \frac {-36 x^2-60 x^3-37 x^4-10 x^5-x^6+e^x \left (-12-8 x+6 x^2+8 x^3+2 x^4+e^2 \left (-12-8 x+5 x^2+5 x^3+x^4\right )\right )}{36 x^2+60 x^3+37 x^4+10 x^5+x^6} \, dx=-\frac {x^{4} + 5 \, x^{3} + 6 \, x^{2} - x e^{\left (x + 2\right )} - 2 \, x e^{x} - 2 \, e^{\left (x + 2\right )} - 2 \, e^{x}}{x^{3} + 5 \, x^{2} + 6 \, x} \]

[In]

integrate((((x^4+5*x^3+5*x^2-8*x-12)*exp(2)+2*x^4+8*x^3+6*x^2-8*x-12)*exp(x)-x^6-10*x^5-37*x^4-60*x^3-36*x^2)/
(x^6+10*x^5+37*x^4+60*x^3+36*x^2),x, algorithm="giac")

[Out]

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

Mupad [B] (verification not implemented)

Time = 8.00 (sec) , antiderivative size = 37, normalized size of antiderivative = 1.19 \[ \int \frac {-36 x^2-60 x^3-37 x^4-10 x^5-x^6+e^x \left (-12-8 x+6 x^2+8 x^3+2 x^4+e^2 \left (-12-8 x+5 x^2+5 x^3+x^4\right )\right )}{36 x^2+60 x^3+37 x^4+10 x^5+x^6} \, dx=\frac {{\mathrm {e}}^x\,\left (2\,{\mathrm {e}}^2+2\right )+x\,{\mathrm {e}}^x\,\left ({\mathrm {e}}^2+2\right )}{x^3+5\,x^2+6\,x}-x \]

[In]

int(-(36*x^2 - exp(x)*(exp(2)*(5*x^2 - 8*x + 5*x^3 + x^4 - 12) - 8*x + 6*x^2 + 8*x^3 + 2*x^4 - 12) + 60*x^3 +
37*x^4 + 10*x^5 + x^6)/(36*x^2 + 60*x^3 + 37*x^4 + 10*x^5 + x^6),x)

[Out]

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