\(\int \frac {-32+e^{2 x} (-2+4 x)+e^x (20-20 x-2 x^2)}{x^2} \, dx\) [6440]

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

Optimal result

Integrand size = 31, antiderivative size = 19 \[ \int \frac {-32+e^{2 x} (-2+4 x)+e^x \left (20-20 x-2 x^2\right )}{x^2} \, dx=\frac {\left (4-2 e^x\right ) \left (8-e^x+x\right )}{x} \]

[Out]

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

Rubi [A] (verified)

Time = 0.07 (sec) , antiderivative size = 29, normalized size of antiderivative = 1.53, number of steps used = 9, number of rules used = 6, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.194, Rules used = {14, 2228, 2230, 2225, 2208, 2209} \[ \int \frac {-32+e^{2 x} (-2+4 x)+e^x \left (20-20 x-2 x^2\right )}{x^2} \, dx=-2 e^x-\frac {20 e^x}{x}+\frac {2 e^{2 x}}{x}+\frac {32}{x} \]

[In]

Int[(-32 + E^(2*x)*(-2 + 4*x) + E^x*(20 - 20*x - 2*x^2))/x^2,x]

[Out]

-2*E^x + 32/x - (20*E^x)/x + (2*E^(2*x))/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 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 2228

Int[(F_)^((c_.)*(v_))*(u_)^(m_.)*(w_), x_Symbol] :> With[{b = Coefficient[v, x, 1], d = Coefficient[u, x, 0],
e = Coefficient[u, x, 1], f = Coefficient[w, x, 0], g = Coefficient[w, x, 1]}, Simp[g*u^(m + 1)*(F^(c*v)/(b*c*
e*Log[F])), x] /; EqQ[e*g*(m + 1) - b*c*(e*f - d*g)*Log[F], 0]] /; FreeQ[{F, c, m}, x] && LinearQ[{u, v, w}, 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}& = \int \left (-\frac {32}{x^2}+\frac {2 e^{2 x} (-1+2 x)}{x^2}-\frac {2 e^x \left (-10+10 x+x^2\right )}{x^2}\right ) \, dx \\ & = \frac {32}{x}+2 \int \frac {e^{2 x} (-1+2 x)}{x^2} \, dx-2 \int \frac {e^x \left (-10+10 x+x^2\right )}{x^2} \, dx \\ & = \frac {32}{x}+\frac {2 e^{2 x}}{x}-2 \int \left (e^x-\frac {10 e^x}{x^2}+\frac {10 e^x}{x}\right ) \, dx \\ & = \frac {32}{x}+\frac {2 e^{2 x}}{x}-2 \int e^x \, dx+20 \int \frac {e^x}{x^2} \, dx-20 \int \frac {e^x}{x} \, dx \\ & = -2 e^x+\frac {32}{x}-\frac {20 e^x}{x}+\frac {2 e^{2 x}}{x}-20 \text {Ei}(x)+20 \int \frac {e^x}{x} \, dx \\ & = -2 e^x+\frac {32}{x}-\frac {20 e^x}{x}+\frac {2 e^{2 x}}{x} \\ \end{align*}

Mathematica [A] (verified)

Time = 0.24 (sec) , antiderivative size = 21, normalized size of antiderivative = 1.11 \[ \int \frac {-32+e^{2 x} (-2+4 x)+e^x \left (20-20 x-2 x^2\right )}{x^2} \, dx=-\frac {2 \left (-16-e^{2 x}+e^x (10+x)\right )}{x} \]

[In]

Integrate[(-32 + E^(2*x)*(-2 + 4*x) + E^x*(20 - 20*x - 2*x^2))/x^2,x]

[Out]

(-2*(-16 - E^(2*x) + E^x*(10 + x)))/x

Maple [A] (verified)

Time = 0.04 (sec) , antiderivative size = 22, normalized size of antiderivative = 1.16

method result size
norman \(\frac {32+2 \,{\mathrm e}^{2 x}-2 \,{\mathrm e}^{x} x -20 \,{\mathrm e}^{x}}{x}\) \(22\)
parallelrisch \(-\frac {2 \,{\mathrm e}^{x} x -32-2 \,{\mathrm e}^{2 x}+20 \,{\mathrm e}^{x}}{x}\) \(23\)
risch \(\frac {32}{x}+\frac {2 \,{\mathrm e}^{2 x}}{x}-\frac {2 \left (x +10\right ) {\mathrm e}^{x}}{x}\) \(26\)
default \(\frac {32}{x}-\frac {20 \,{\mathrm e}^{x}}{x}+\frac {2 \,{\mathrm e}^{2 x}}{x}-2 \,{\mathrm e}^{x}\) \(27\)
parts \(\frac {32}{x}-\frac {20 \,{\mathrm e}^{x}}{x}+\frac {2 \,{\mathrm e}^{2 x}}{x}-2 \,{\mathrm e}^{x}\) \(27\)

[In]

int(((4*x-2)*exp(x)^2+(-2*x^2-20*x+20)*exp(x)-32)/x^2,x,method=_RETURNVERBOSE)

[Out]

(32+2*exp(x)^2-2*exp(x)*x-20*exp(x))/x

Fricas [A] (verification not implemented)

none

Time = 0.27 (sec) , antiderivative size = 19, normalized size of antiderivative = 1.00 \[ \int \frac {-32+e^{2 x} (-2+4 x)+e^x \left (20-20 x-2 x^2\right )}{x^2} \, dx=-\frac {2 \, {\left ({\left (x + 10\right )} e^{x} - e^{\left (2 \, x\right )} - 16\right )}}{x} \]

[In]

integrate(((4*x-2)*exp(x)^2+(-2*x^2-20*x+20)*exp(x)-32)/x^2,x, algorithm="fricas")

[Out]

-2*((x + 10)*e^x - e^(2*x) - 16)/x

Sympy [A] (verification not implemented)

Time = 0.06 (sec) , antiderivative size = 27, normalized size of antiderivative = 1.42 \[ \int \frac {-32+e^{2 x} (-2+4 x)+e^x \left (20-20 x-2 x^2\right )}{x^2} \, dx=\frac {32}{x} + \frac {2 x e^{2 x} + \left (- 2 x^{2} - 20 x\right ) e^{x}}{x^{2}} \]

[In]

integrate(((4*x-2)*exp(x)**2+(-2*x**2-20*x+20)*exp(x)-32)/x**2,x)

[Out]

32/x + (2*x*exp(2*x) + (-2*x**2 - 20*x)*exp(x))/x**2

Maxima [C] (verification not implemented)

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

Time = 0.21 (sec) , antiderivative size = 34, normalized size of antiderivative = 1.79 \[ \int \frac {-32+e^{2 x} (-2+4 x)+e^x \left (20-20 x-2 x^2\right )}{x^2} \, dx=\frac {32}{x} + 4 \, {\rm Ei}\left (2 \, x\right ) - 20 \, {\rm Ei}\left (x\right ) - 2 \, e^{x} + 20 \, \Gamma \left (-1, -x\right ) - 4 \, \Gamma \left (-1, -2 \, x\right ) \]

[In]

integrate(((4*x-2)*exp(x)^2+(-2*x^2-20*x+20)*exp(x)-32)/x^2,x, algorithm="maxima")

[Out]

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

Giac [A] (verification not implemented)

none

Time = 0.25 (sec) , antiderivative size = 21, normalized size of antiderivative = 1.11 \[ \int \frac {-32+e^{2 x} (-2+4 x)+e^x \left (20-20 x-2 x^2\right )}{x^2} \, dx=-\frac {2 \, {\left (x e^{x} - e^{\left (2 \, x\right )} + 10 \, e^{x} - 16\right )}}{x} \]

[In]

integrate(((4*x-2)*exp(x)^2+(-2*x^2-20*x+20)*exp(x)-32)/x^2,x, algorithm="giac")

[Out]

-2*(x*e^x - e^(2*x) + 10*e^x - 16)/x

Mupad [B] (verification not implemented)

Time = 0.06 (sec) , antiderivative size = 21, normalized size of antiderivative = 1.11 \[ \int \frac {-32+e^{2 x} (-2+4 x)+e^x \left (20-20 x-2 x^2\right )}{x^2} \, dx=\frac {2\,{\mathrm {e}}^{2\,x}-20\,{\mathrm {e}}^x+32}{x}-2\,{\mathrm {e}}^x \]

[In]

int(-(exp(x)*(20*x + 2*x^2 - 20) - exp(2*x)*(4*x - 2) + 32)/x^2,x)

[Out]

(2*exp(2*x) - 20*exp(x) + 32)/x - 2*exp(x)