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

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

Optimal result

Integrand size = 49, antiderivative size = 25 \[ \int \frac {e^{2+x+e x^2-x^3} \left (-1+e^{-2-x-e x^2+x^3}+x+2 e x^2-3 x^3\right )}{x^2} \, dx=\frac {-1+e^{2+e-(e-x) \left (1-x^2\right )}}{x} \]

[Out]

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

Rubi [B] (verified)

Leaf count is larger than twice the leaf count of optimal. \(51\) vs. \(2(25)=50\).

Time = 0.76 (sec) , antiderivative size = 51, normalized size of antiderivative = 2.04, number of steps used = 3, number of rules used = 2, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.041, Rules used = {6874, 2326} \[ \int \frac {e^{2+x+e x^2-x^3} \left (-1+e^{-2-x-e x^2+x^3}+x+2 e x^2-3 x^3\right )}{x^2} \, dx=\frac {e^{-x^3+e x^2+x+2} \left (-3 x^3+2 e x^2+x\right )}{x^2 \left (-3 x^2+2 e x+1\right )}-\frac {1}{x} \]

[In]

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

[Out]

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

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 6874

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

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

Mathematica [A] (verified)

Time = 2.81 (sec) , antiderivative size = 21, normalized size of antiderivative = 0.84 \[ \int \frac {e^{2+x+e x^2-x^3} \left (-1+e^{-2-x-e x^2+x^3}+x+2 e x^2-3 x^3\right )}{x^2} \, dx=\frac {-1+e^{2+x+e x^2-x^3}}{x} \]

[In]

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

[Out]

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

Maple [A] (verified)

Time = 0.34 (sec) , antiderivative size = 26, normalized size of antiderivative = 1.04

method result size
risch \(-\frac {1}{x}+\frac {{\mathrm e}^{x^{2} {\mathrm e}-x^{3}+x +2}}{x}\) \(26\)
parts \(-\frac {1}{x}+\frac {{\mathrm e}^{x^{2} {\mathrm e}-x^{3}+x +2}}{x}\) \(29\)
norman \(\frac {\left (1-{\mathrm e}^{-x^{2} {\mathrm e}+x^{3}-x -2}\right ) {\mathrm e}^{x^{2} {\mathrm e}-x^{3}+x +2}}{x}\) \(43\)
parallelrisch \(\frac {\left (1-{\mathrm e}^{-x^{2} {\mathrm e}+x^{3}-x -2}\right ) {\mathrm e}^{x^{2} {\mathrm e}-x^{3}+x +2}}{x}\) \(43\)

[In]

int((exp(-x^2*exp(1)+x^3-x-2)+2*x^2*exp(1)-3*x^3+x-1)/x^2/exp(-x^2*exp(1)+x^3-x-2),x,method=_RETURNVERBOSE)

[Out]

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

Fricas [A] (verification not implemented)

none

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

[In]

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

[Out]

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

Sympy [A] (verification not implemented)

Time = 0.09 (sec) , antiderivative size = 19, normalized size of antiderivative = 0.76 \[ \int \frac {e^{2+x+e x^2-x^3} \left (-1+e^{-2-x-e x^2+x^3}+x+2 e x^2-3 x^3\right )}{x^2} \, dx=\frac {e^{- x^{3} + e x^{2} + x + 2}}{x} - \frac {1}{x} \]

[In]

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

[Out]

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

Maxima [A] (verification not implemented)

none

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

[In]

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

[Out]

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

Giac [A] (verification not implemented)

none

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

[In]

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

[Out]

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

Mupad [B] (verification not implemented)

Time = 14.08 (sec) , antiderivative size = 27, normalized size of antiderivative = 1.08 \[ \int \frac {e^{2+x+e x^2-x^3} \left (-1+e^{-2-x-e x^2+x^3}+x+2 e x^2-3 x^3\right )}{x^2} \, dx=\frac {{\mathrm {e}}^{x^2\,\mathrm {e}}\,{\mathrm {e}}^2\,{\mathrm {e}}^{-x^3}\,{\mathrm {e}}^x}{x}-\frac {1}{x} \]

[In]

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

[Out]

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