\(\int \frac {5 x^3+2 x^4+e^x (-80+40 x^2+8 x^3)+e^{-1-x} (-20 x-20 x^2-16 x^3-4 x^4)}{4 x^3} \, dx\) [9804]

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

Optimal result

Integrand size = 61, antiderivative size = 32 \[ \int \frac {5 x^3+2 x^4+e^x \left (-80+40 x^2+8 x^3\right )+e^{-1-x} \left (-20 x-20 x^2-16 x^3-4 x^4\right )}{4 x^3} \, dx=\frac {\left (e^{-1-x}+\frac {2 e^x}{x}+\frac {x}{4}\right ) (5+x (5+x))}{x} \]

[Out]

(5+(5+x)*x)/x*(exp(-1-x)+2*exp(x)/x+1/4*x)

Rubi [A] (verified)

Time = 0.13 (sec) , antiderivative size = 64, normalized size of antiderivative = 2.00, number of steps used = 18, number of rules used = 7, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.115, Rules used = {12, 14, 2230, 2225, 2208, 2209, 2207} \[ \int \frac {5 x^3+2 x^4+e^x \left (-80+40 x^2+8 x^3\right )+e^{-1-x} \left (-20 x-20 x^2-16 x^3-4 x^4\right )}{4 x^3} \, dx=\frac {x^2}{4}+\frac {10 e^x}{x^2}+e^{-x-1} x+\frac {5 x}{4}+5 e^{-x-1}+2 e^x+\frac {5 e^{-x-1}}{x}+\frac {10 e^x}{x} \]

[In]

Int[(5*x^3 + 2*x^4 + E^x*(-80 + 40*x^2 + 8*x^3) + E^(-1 - x)*(-20*x - 20*x^2 - 16*x^3 - 4*x^4))/(4*x^3),x]

[Out]

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

Rule 12

Int[(a_)*(u_), x_Symbol] :> Dist[a, Int[u, x], x] /; FreeQ[a, x] &&  !MatchQ[u, (b_)*(v_) /; FreeQ[b, x]]

Rule 14

Int[(u_)*((c_.)*(x_))^(m_.), x_Symbol] :> Int[ExpandIntegrand[(c*x)^m*u, x], x] /; FreeQ[{c, m}, x] && SumQ[u]
 &&  !LinearQ[u, x] &&  !MatchQ[u, (a_) + (b_.)*(v_) /; FreeQ[{a, b}, x] && InverseFunctionQ[v]]

Rule 2207

Int[((b_.)*(F_)^((g_.)*((e_.) + (f_.)*(x_))))^(n_.)*((c_.) + (d_.)*(x_))^(m_.), x_Symbol] :> Simp[(c + d*x)^m*
((b*F^(g*(e + f*x)))^n/(f*g*n*Log[F])), x] - Dist[d*(m/(f*g*n*Log[F])), 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] && GtQ[m, 0] && IntegerQ[2*m] &&  !TrueQ[$UseGamma]

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 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 2230

Int[(F_)^((c_.)*(v_))*(u_)^(m_.)*(w_), x_Symbol] :> Int[ExpandIntegrand[F^(c*ExpandToSum[v, x]), w*NormalizePo
werOfLinear[u, x]^m, x], x] /; FreeQ[{F, c}, x] && PolynomialQ[w, x] && LinearQ[v, x] && PowerOfLinearQ[u, x]
&& IntegerQ[m] &&  !TrueQ[$UseGamma]

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

Mathematica [A] (verified)

Time = 0.49 (sec) , antiderivative size = 55, normalized size of antiderivative = 1.72 \[ \int \frac {5 x^3+2 x^4+e^x \left (-80+40 x^2+8 x^3\right )+e^{-1-x} \left (-20 x-20 x^2-16 x^3-4 x^4\right )}{4 x^3} \, dx=\frac {1}{4} \left (8 e^x \left (1+\frac {5}{x^2}+\frac {5}{x}\right )+5 x+x^2-4 e^{-x} \left (-\frac {5}{e}-\frac {5}{e x}-\frac {x}{e}\right )\right ) \]

[In]

Integrate[(5*x^3 + 2*x^4 + E^x*(-80 + 40*x^2 + 8*x^3) + E^(-1 - x)*(-20*x - 20*x^2 - 16*x^3 - 4*x^4))/(4*x^3),
x]

[Out]

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

Maple [A] (verified)

Time = 0.65 (sec) , antiderivative size = 43, normalized size of antiderivative = 1.34

method result size
risch \(\frac {x^{2}}{4}+\frac {5 x}{4}+\frac {2 \left (x^{2}+5 x +5\right ) {\mathrm e}^{x}}{x^{2}}+\frac {\left (x^{2}+5 x +5\right ) {\mathrm e}^{-1-x}}{x}\) \(43\)
parts \(\frac {5 x}{4}+\frac {x^{2}}{4}+4 \,{\mathrm e}^{-1-x}+\frac {5 \,{\mathrm e}^{-1-x}}{x}-{\mathrm e}^{-1-x} \left (-1-x \right )+\frac {10 \,{\mathrm e}^{x}}{x^{2}}+\frac {10 \,{\mathrm e}^{x}}{x}+2 \,{\mathrm e}^{x}\) \(60\)
parallelrisch \(\frac {4 x^{3} {\mathrm e}^{-1-x}+x^{4}+8 \,{\mathrm e}^{x} x^{2}+20 \,{\mathrm e}^{-1-x} x^{2}+5 x^{3}+40 \,{\mathrm e}^{x} x +20 x \,{\mathrm e}^{-1-x}+40 \,{\mathrm e}^{x}}{4 x^{2}}\) \(62\)
norman \(\frac {\left ({\mathrm e}^{-1} x^{3}+10 \,{\mathrm e}^{2 x}+5 \,{\mathrm e}^{-1} x +10 x \,{\mathrm e}^{2 x}+5 x^{2} {\mathrm e}^{-1}+\frac {5 \,{\mathrm e}^{x} x^{3}}{4}+\frac {{\mathrm e}^{x} x^{4}}{4}+2 \,{\mathrm e}^{2 x} x^{2}\right ) {\mathrm e}^{-x}}{x^{2}}\) \(70\)
default \(\frac {x^{2}}{4}+\frac {5 x}{4}+4 \,{\mathrm e}^{-1} {\mathrm e}^{-x}+\frac {10 \,{\mathrm e}^{x}}{x^{2}}+\frac {10 \,{\mathrm e}^{x}}{x}-5 \,{\mathrm e}^{-1} \left (-\frac {{\mathrm e}^{-x}}{x}+\operatorname {Ei}_{1}\left (x \right )\right )+5 \,{\mathrm e}^{-1} \operatorname {Ei}_{1}\left (x \right )-{\mathrm e}^{-1} \left (-x \,{\mathrm e}^{-x}-{\mathrm e}^{-x}\right )+2 \,{\mathrm e}^{x}\) \(78\)

[In]

int(1/4*((8*x^3+40*x^2-80)*exp(x)+(-4*x^4-16*x^3-20*x^2-20*x)*exp(-1-x)+2*x^4+5*x^3)/x^3,x,method=_RETURNVERBO
SE)

[Out]

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

Fricas [A] (verification not implemented)

none

Time = 0.24 (sec) , antiderivative size = 55, normalized size of antiderivative = 1.72 \[ \int \frac {5 x^3+2 x^4+e^x \left (-80+40 x^2+8 x^3\right )+e^{-1-x} \left (-20 x-20 x^2-16 x^3-4 x^4\right )}{4 x^3} \, dx=\frac {{\left (4 \, x^{3} + 20 \, x^{2} + 8 \, {\left (x^{2} + 5 \, x + 5\right )} e^{\left (2 \, x + 1\right )} + {\left (x^{4} + 5 \, x^{3}\right )} e^{\left (x + 1\right )} + 20 \, x\right )} e^{\left (-x - 1\right )}}{4 \, x^{2}} \]

[In]

integrate(1/4*((8*x^3+40*x^2-80)*exp(x)+(-4*x^4-16*x^3-20*x^2-20*x)*exp(-1-x)+2*x^4+5*x^3)/x^3,x, algorithm="f
ricas")

[Out]

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

Sympy [B] (verification not implemented)

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

Time = 0.14 (sec) , antiderivative size = 60, normalized size of antiderivative = 1.88 \[ \int \frac {5 x^3+2 x^4+e^x \left (-80+40 x^2+8 x^3\right )+e^{-1-x} \left (-20 x-20 x^2-16 x^3-4 x^4\right )}{4 x^3} \, dx=\frac {x^{2}}{4} + \frac {5 x}{4} + \frac {\left (x^{4} + 5 x^{3} + 5 x^{2}\right ) e^{- x} + \left (2 e x^{3} + 10 e x^{2} + 10 e x\right ) e^{x}}{e x^{3}} \]

[In]

integrate(1/4*((8*x**3+40*x**2-80)*exp(x)+(-4*x**4-16*x**3-20*x**2-20*x)*exp(-1-x)+2*x**4+5*x**3)/x**3,x)

[Out]

x**2/4 + 5*x/4 + ((x**4 + 5*x**3 + 5*x**2)*exp(-x) + (2*E*x**3 + 10*E*x**2 + 10*E*x)*exp(x))*exp(-1)/x**3

Maxima [C] (verification not implemented)

Result contains higher order function than in optimal. Order 4 vs. order 3.

Time = 0.22 (sec) , antiderivative size = 57, normalized size of antiderivative = 1.78 \[ \int \frac {5 x^3+2 x^4+e^x \left (-80+40 x^2+8 x^3\right )+e^{-1-x} \left (-20 x-20 x^2-16 x^3-4 x^4\right )}{4 x^3} \, dx=\frac {1}{4} \, x^{2} - 5 \, {\rm Ei}\left (-x\right ) e^{\left (-1\right )} + {\left (x + 1\right )} e^{\left (-x - 1\right )} + 5 \, e^{\left (-1\right )} \Gamma \left (-1, x\right ) + \frac {5}{4} \, x + 10 \, {\rm Ei}\left (x\right ) + 2 \, e^{x} + 4 \, e^{\left (-x - 1\right )} + 20 \, \Gamma \left (-2, -x\right ) \]

[In]

integrate(1/4*((8*x^3+40*x^2-80)*exp(x)+(-4*x^4-16*x^3-20*x^2-20*x)*exp(-1-x)+2*x^4+5*x^3)/x^3,x, algorithm="m
axima")

[Out]

1/4*x^2 - 5*Ei(-x)*e^(-1) + (x + 1)*e^(-x - 1) + 5*e^(-1)*gamma(-1, x) + 5/4*x + 10*Ei(x) + 2*e^x + 4*e^(-x -
1) + 20*gamma(-2, -x)

Giac [B] (verification not implemented)

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

Time = 0.28 (sec) , antiderivative size = 68, normalized size of antiderivative = 2.12 \[ \int \frac {5 x^3+2 x^4+e^x \left (-80+40 x^2+8 x^3\right )+e^{-1-x} \left (-20 x-20 x^2-16 x^3-4 x^4\right )}{4 x^3} \, dx=\frac {{\left (x^{4} e + 5 \, x^{3} e + 4 \, x^{3} e^{\left (-x\right )} + 20 \, x^{2} e^{\left (-x\right )} + 8 \, x^{2} e^{\left (x + 1\right )} + 20 \, x e^{\left (-x\right )} + 40 \, x e^{\left (x + 1\right )} + 40 \, e^{\left (x + 1\right )}\right )} e^{\left (-1\right )}}{4 \, x^{2}} \]

[In]

integrate(1/4*((8*x^3+40*x^2-80)*exp(x)+(-4*x^4-16*x^3-20*x^2-20*x)*exp(-1-x)+2*x^4+5*x^3)/x^3,x, algorithm="g
iac")

[Out]

1/4*(x^4*e + 5*x^3*e + 4*x^3*e^(-x) + 20*x^2*e^(-x) + 8*x^2*e^(x + 1) + 20*x*e^(-x) + 40*x*e^(x + 1) + 40*e^(x
 + 1))*e^(-1)/x^2

Mupad [B] (verification not implemented)

Time = 0.18 (sec) , antiderivative size = 54, normalized size of antiderivative = 1.69 \[ \int \frac {5 x^3+2 x^4+e^x \left (-80+40 x^2+8 x^3\right )+e^{-1-x} \left (-20 x-20 x^2-16 x^3-4 x^4\right )}{4 x^3} \, dx=\frac {5\,x}{4}+5\,{\mathrm {e}}^{-x-1}+2\,{\mathrm {e}}^x+\frac {10\,{\mathrm {e}}^x}{x}+\frac {10\,{\mathrm {e}}^x}{x^2}+x\,{\mathrm {e}}^{-x-1}+\frac {5\,{\mathrm {e}}^{-x-1}}{x}+\frac {x^2}{4} \]

[In]

int(((exp(x)*(40*x^2 + 8*x^3 - 80))/4 - (exp(- x - 1)*(20*x + 20*x^2 + 16*x^3 + 4*x^4))/4 + (5*x^3)/4 + x^4/2)
/x^3,x)

[Out]

(5*x)/4 + 5*exp(- x - 1) + 2*exp(x) + (10*exp(x))/x + (10*exp(x))/x^2 + x*exp(- x - 1) + (5*exp(- x - 1))/x +
x^2/4