\(\int \frac {e^{2-2 x+\frac {1-x^2}{x}} (1+2 x+3 x^2)+e^{\frac {1-x^2}{x}} (-12 x^2-12 x^4+e^2 (-3 x^2-3 x^4))}{x^4} \, dx\) [8154]

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

Optimal result

Integrand size = 74, antiderivative size = 32 \[ \int \frac {e^{2-2 x+\frac {1-x^2}{x}} \left (1+2 x+3 x^2\right )+e^{\frac {1-x^2}{x}} \left (-12 x^2-12 x^4+e^2 \left (-3 x^2-3 x^4\right )\right )}{x^4} \, dx=5+e^{\frac {1}{x}-x} \left (3 \left (4+e^2\right )-\frac {e^{2-2 x}}{x^2}\right ) \]

[Out]

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

Rubi [A] (verified)

Time = 0.12 (sec) , antiderivative size = 46, normalized size of antiderivative = 1.44, number of steps used = 4, number of rules used = 3, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.041, Rules used = {14, 6838, 2326} \[ \int \frac {e^{2-2 x+\frac {1-x^2}{x}} \left (1+2 x+3 x^2\right )+e^{\frac {1-x^2}{x}} \left (-12 x^2-12 x^4+e^2 \left (-3 x^2-3 x^4\right )\right )}{x^4} \, dx=3 \left (4+e^2\right ) e^{\frac {1}{x}-x}-\frac {e^{-3 x+\frac {1}{x}+2} \left (3 x^2+1\right )}{\left (\frac {1}{x^2}+3\right ) x^4} \]

[In]

Int[(E^(2 - 2*x + (1 - x^2)/x)*(1 + 2*x + 3*x^2) + E^((1 - x^2)/x)*(-12*x^2 - 12*x^4 + E^2*(-3*x^2 - 3*x^4)))/
x^4,x]

[Out]

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

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 2326

Int[(y_.)*(F_)^(u_)*((v_) + (w_)), x_Symbol] :> With[{z = v*(y/(Log[F]*D[u, x]))}, Simp[F^u*z, x] /; EqQ[D[z,
x], w*y]] /; FreeQ[F, x]

Rule 6838

Int[(F_)^(v_)*(u_), x_Symbol] :> With[{q = DerivativeDivides[v, u, x]}, Simp[q*(F^v/Log[F]), x] /;  !FalseQ[q]
] /; FreeQ[F, x]

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

Mathematica [A] (verified)

Time = 3.88 (sec) , antiderivative size = 32, normalized size of antiderivative = 1.00 \[ \int \frac {e^{2-2 x+\frac {1-x^2}{x}} \left (1+2 x+3 x^2\right )+e^{\frac {1-x^2}{x}} \left (-12 x^2-12 x^4+e^2 \left (-3 x^2-3 x^4\right )\right )}{x^4} \, dx=3 e^{\frac {1}{x}-x} \left (4+e^2\right )-\frac {e^{2+\frac {1}{x}-3 x}}{x^2} \]

[In]

Integrate[(E^(2 - 2*x + (1 - x^2)/x)*(1 + 2*x + 3*x^2) + E^((1 - x^2)/x)*(-12*x^2 - 12*x^4 + E^2*(-3*x^2 - 3*x
^4)))/x^4,x]

[Out]

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

Maple [A] (verified)

Time = 0.60 (sec) , antiderivative size = 38, normalized size of antiderivative = 1.19

method result size
risch \(\frac {\left (3 x^{2} {\mathrm e}^{2}+12 x^{2}-{\mathrm e}^{2-2 x}\right ) {\mathrm e}^{-\frac {\left (-1+x \right ) \left (1+x \right )}{x}}}{x^{2}}\) \(38\)
norman \(\frac {\left (3 \,{\mathrm e}^{2}+12\right ) x^{3} {\mathrm e}^{\frac {-x^{2}+1}{x}}-x \,{\mathrm e}^{2-2 x} {\mathrm e}^{\frac {-x^{2}+1}{x}}}{x^{3}}\) \(51\)
parallelrisch \(\frac {3 \,{\mathrm e}^{2} {\mathrm e}^{-\frac {x^{2}-1}{x}} x^{2}+12 \,{\mathrm e}^{-\frac {x^{2}-1}{x}} x^{2}-{\mathrm e}^{-\frac {x^{2}-1}{x}} {\mathrm e}^{2-2 x}}{x^{2}}\) \(61\)

[In]

int(((3*x^2+2*x+1)*exp((-x^2+1)/x)*exp(1-x)^2+((-3*x^4-3*x^2)*exp(2)-12*x^4-12*x^2)*exp((-x^2+1)/x))/x^4,x,met
hod=_RETURNVERBOSE)

[Out]

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

Fricas [A] (verification not implemented)

none

Time = 0.25 (sec) , antiderivative size = 48, normalized size of antiderivative = 1.50 \[ \int \frac {e^{2-2 x+\frac {1-x^2}{x}} \left (1+2 x+3 x^2\right )+e^{\frac {1-x^2}{x}} \left (-12 x^2-12 x^4+e^2 \left (-3 x^2-3 x^4\right )\right )}{x^4} \, dx=\frac {3 \, {\left (x^{2} e^{2} + 4 \, x^{2}\right )} e^{\left (-\frac {x^{2} - 1}{x}\right )} - e^{\left (-\frac {3 \, x^{2} - 2 \, x - 1}{x}\right )}}{x^{2}} \]

[In]

integrate(((3*x^2+2*x+1)*exp((-x^2+1)/x)*exp(1-x)^2+((-3*x^4-3*x^2)*exp(2)-12*x^4-12*x^2)*exp((-x^2+1)/x))/x^4
,x, algorithm="fricas")

[Out]

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

Sympy [A] (verification not implemented)

Time = 0.17 (sec) , antiderivative size = 32, normalized size of antiderivative = 1.00 \[ \int \frac {e^{2-2 x+\frac {1-x^2}{x}} \left (1+2 x+3 x^2\right )+e^{\frac {1-x^2}{x}} \left (-12 x^2-12 x^4+e^2 \left (-3 x^2-3 x^4\right )\right )}{x^4} \, dx=\left (12 + 3 e^{2}\right ) e^{\frac {1 - x^{2}}{x}} - \frac {e^{\frac {1 - x^{2}}{x}} e^{2 - 2 x}}{x^{2}} \]

[In]

integrate(((3*x**2+2*x+1)*exp((-x**2+1)/x)*exp(1-x)**2+((-3*x**4-3*x**2)*exp(2)-12*x**4-12*x**2)*exp((-x**2+1)
/x))/x**4,x)

[Out]

(12 + 3*exp(2))*exp((1 - x**2)/x) - exp((1 - x**2)/x)*exp(2 - 2*x)/x**2

Maxima [A] (verification not implemented)

none

Time = 0.25 (sec) , antiderivative size = 30, normalized size of antiderivative = 0.94 \[ \int \frac {e^{2-2 x+\frac {1-x^2}{x}} \left (1+2 x+3 x^2\right )+e^{\frac {1-x^2}{x}} \left (-12 x^2-12 x^4+e^2 \left (-3 x^2-3 x^4\right )\right )}{x^4} \, dx=\frac {{\left (3 \, x^{2} {\left (e^{2} + 4\right )} e^{\left (2 \, x\right )} - e^{2}\right )} e^{\left (-3 \, x + \frac {1}{x}\right )}}{x^{2}} \]

[In]

integrate(((3*x^2+2*x+1)*exp((-x^2+1)/x)*exp(1-x)^2+((-3*x^4-3*x^2)*exp(2)-12*x^4-12*x^2)*exp((-x^2+1)/x))/x^4
,x, algorithm="maxima")

[Out]

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

Giac [B] (verification not implemented)

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

Time = 0.30 (sec) , antiderivative size = 58, normalized size of antiderivative = 1.81 \[ \int \frac {e^{2-2 x+\frac {1-x^2}{x}} \left (1+2 x+3 x^2\right )+e^{\frac {1-x^2}{x}} \left (-12 x^2-12 x^4+e^2 \left (-3 x^2-3 x^4\right )\right )}{x^4} \, dx=\frac {3 \, x^{2} e^{\left (-\frac {x^{2} - 2 \, x - 1}{x}\right )} + 12 \, x^{2} e^{\left (-\frac {x^{2} - 1}{x}\right )} - e^{\left (-\frac {3 \, x^{2} - 2 \, x - 1}{x}\right )}}{x^{2}} \]

[In]

integrate(((3*x^2+2*x+1)*exp((-x^2+1)/x)*exp(1-x)^2+((-3*x^4-3*x^2)*exp(2)-12*x^4-12*x^2)*exp((-x^2+1)/x))/x^4
,x, algorithm="giac")

[Out]

(3*x^2*e^(-(x^2 - 2*x - 1)/x) + 12*x^2*e^(-(x^2 - 1)/x) - e^(-(3*x^2 - 2*x - 1)/x))/x^2

Mupad [B] (verification not implemented)

Time = 12.28 (sec) , antiderivative size = 37, normalized size of antiderivative = 1.16 \[ \int \frac {e^{2-2 x+\frac {1-x^2}{x}} \left (1+2 x+3 x^2\right )+e^{\frac {1-x^2}{x}} \left (-12 x^2-12 x^4+e^2 \left (-3 x^2-3 x^4\right )\right )}{x^4} \, dx=\frac {{\mathrm {e}}^{\frac {1}{x}-3\,x}\,\left (12\,x^2\,{\mathrm {e}}^{2\,x}-{\mathrm {e}}^2+3\,x^2\,{\mathrm {e}}^{2\,x+2}\right )}{x^2} \]

[In]

int(-(exp(-(x^2 - 1)/x)*(exp(2)*(3*x^2 + 3*x^4) + 12*x^2 + 12*x^4) - exp(2 - 2*x)*exp(-(x^2 - 1)/x)*(2*x + 3*x
^2 + 1))/x^4,x)

[Out]

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