\(\int \frac {e^{-2 x} (e^{2 x}+6 e^{8 x} x^2+162 x^3-162 x^4+e^x (18 x^2-18 x^3))}{x^2} \, dx\) [1459]

   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 = 50, antiderivative size = 24 \[ \int \frac {e^{-2 x} \left (e^{2 x}+6 e^{8 x} x^2+162 x^3-162 x^4+e^x \left (18 x^2-18 x^3\right )\right )}{x^2} \, dx=-7+e^{6 x}-\frac {1}{x}+\left (1+9 e^{-x} x\right )^2 \]

[Out]

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

Rubi [A] (verified)

Time = 0.22 (sec) , antiderivative size = 40, normalized size of antiderivative = 1.67, number of steps used = 12, number of rules used = 4, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.080, Rules used = {6820, 2225, 2207, 2227} \[ \int \frac {e^{-2 x} \left (e^{2 x}+6 e^{8 x} x^2+162 x^3-162 x^4+e^x \left (18 x^2-18 x^3\right )\right )}{x^2} \, dx=81 e^{-2 x} x^2+18 e^{-x}+e^{6 x}-18 e^{-x} (1-x)-\frac {1}{x} \]

[In]

Int[(E^(2*x) + 6*E^(8*x)*x^2 + 162*x^3 - 162*x^4 + E^x*(18*x^2 - 18*x^3))/(E^(2*x)*x^2),x]

[Out]

18/E^x + E^(6*x) - (18*(1 - x))/E^x - x^(-1) + (81*x^2)/E^(2*x)

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

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

Rule 6820

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

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

Mathematica [A] (verified)

Time = 0.06 (sec) , antiderivative size = 29, normalized size of antiderivative = 1.21 \[ \int \frac {e^{-2 x} \left (e^{2 x}+6 e^{8 x} x^2+162 x^3-162 x^4+e^x \left (18 x^2-18 x^3\right )\right )}{x^2} \, dx=e^{6 x}-\frac {1}{x}+18 e^{-x} x+81 e^{-2 x} x^2 \]

[In]

Integrate[(E^(2*x) + 6*E^(8*x)*x^2 + 162*x^3 - 162*x^4 + E^x*(18*x^2 - 18*x^3))/(E^(2*x)*x^2),x]

[Out]

E^(6*x) - x^(-1) + (18*x)/E^x + (81*x^2)/E^(2*x)

Maple [A] (verified)

Time = 0.06 (sec) , antiderivative size = 27, normalized size of antiderivative = 1.12

method result size
default \(-\frac {1}{x}+{\mathrm e}^{6 x}+18 x \,{\mathrm e}^{-x}+81 x^{2} {\mathrm e}^{-2 x}\) \(27\)
risch \(-\frac {1}{x}+{\mathrm e}^{6 x}+18 x \,{\mathrm e}^{-x}+81 x^{2} {\mathrm e}^{-2 x}\) \(27\)
parts \(-\frac {1}{x}+{\mathrm e}^{6 x}+18 x \,{\mathrm e}^{-x}+81 x^{2} {\mathrm e}^{-2 x}\) \(29\)
parallelrisch \(-\frac {\left (-x \,{\mathrm e}^{2 x} {\mathrm e}^{6 x}-81 x^{3}-18 \,{\mathrm e}^{x} x^{2}+{\mathrm e}^{2 x}\right ) {\mathrm e}^{-2 x}}{x}\) \(40\)

[In]

int((6*x^2*exp(x)^2*exp(3*x)^2+exp(x)^2+(-18*x^3+18*x^2)*exp(x)-162*x^4+162*x^3)/exp(x)^2/x^2,x,method=_RETURN
VERBOSE)

[Out]

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

Fricas [A] (verification not implemented)

none

Time = 0.25 (sec) , antiderivative size = 33, normalized size of antiderivative = 1.38 \[ \int \frac {e^{-2 x} \left (e^{2 x}+6 e^{8 x} x^2+162 x^3-162 x^4+e^x \left (18 x^2-18 x^3\right )\right )}{x^2} \, dx=\frac {{\left (81 \, x^{3} + 18 \, x^{2} e^{x} + x e^{\left (8 \, x\right )} - e^{\left (2 \, x\right )}\right )} e^{\left (-2 \, x\right )}}{x} \]

[In]

integrate((6*x^2*exp(x)^2*exp(3*x)^2+exp(x)^2+(-18*x^3+18*x^2)*exp(x)-162*x^4+162*x^3)/exp(x)^2/x^2,x, algorit
hm="fricas")

[Out]

(81*x^3 + 18*x^2*e^x + x*e^(8*x) - e^(2*x))*e^(-2*x)/x

Sympy [A] (verification not implemented)

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

[In]

integrate((6*x**2*exp(x)**2*exp(3*x)**2+exp(x)**2+(-18*x**3+18*x**2)*exp(x)-162*x**4+162*x**3)/exp(x)**2/x**2,
x)

[Out]

81*x**2*exp(-2*x) + 18*x*exp(-x) + exp(6*x) - 1/x

Maxima [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 52 vs. \(2 (22) = 44\).

Time = 0.19 (sec) , antiderivative size = 52, normalized size of antiderivative = 2.17 \[ \int \frac {e^{-2 x} \left (e^{2 x}+6 e^{8 x} x^2+162 x^3-162 x^4+e^x \left (18 x^2-18 x^3\right )\right )}{x^2} \, dx=18 \, {\left (x + 1\right )} e^{\left (-x\right )} + \frac {81}{2} \, {\left (2 \, x^{2} + 2 \, x + 1\right )} e^{\left (-2 \, x\right )} - \frac {81}{2} \, {\left (2 \, x + 1\right )} e^{\left (-2 \, x\right )} - \frac {1}{x} + e^{\left (6 \, x\right )} - 18 \, e^{\left (-x\right )} \]

[In]

integrate((6*x^2*exp(x)^2*exp(3*x)^2+exp(x)^2+(-18*x^3+18*x^2)*exp(x)-162*x^4+162*x^3)/exp(x)^2/x^2,x, algorit
hm="maxima")

[Out]

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

Giac [A] (verification not implemented)

none

Time = 0.25 (sec) , antiderivative size = 30, normalized size of antiderivative = 1.25 \[ \int \frac {e^{-2 x} \left (e^{2 x}+6 e^{8 x} x^2+162 x^3-162 x^4+e^x \left (18 x^2-18 x^3\right )\right )}{x^2} \, dx=\frac {81 \, x^{3} e^{\left (-2 \, x\right )} + 18 \, x^{2} e^{\left (-x\right )} + x e^{\left (6 \, x\right )} - 1}{x} \]

[In]

integrate((6*x^2*exp(x)^2*exp(3*x)^2+exp(x)^2+(-18*x^3+18*x^2)*exp(x)-162*x^4+162*x^3)/exp(x)^2/x^2,x, algorit
hm="giac")

[Out]

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

Mupad [B] (verification not implemented)

Time = 7.84 (sec) , antiderivative size = 26, normalized size of antiderivative = 1.08 \[ \int \frac {e^{-2 x} \left (e^{2 x}+6 e^{8 x} x^2+162 x^3-162 x^4+e^x \left (18 x^2-18 x^3\right )\right )}{x^2} \, dx={\mathrm {e}}^{6\,x}+18\,x\,{\mathrm {e}}^{-x}+81\,x^2\,{\mathrm {e}}^{-2\,x}-\frac {1}{x} \]

[In]

int((exp(-2*x)*(exp(2*x) + exp(x)*(18*x^2 - 18*x^3) + 6*x^2*exp(8*x) + 162*x^3 - 162*x^4))/x^2,x)

[Out]

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