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

   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 = 45, antiderivative size = 32 \[ \int \frac {e^x (1-x)-x^2+20 x^3+2 e^{e^{x^2}+x^2} x^3+12 x^4}{x^2} \, dx=e^{e^{x^2}}-x+\frac {-e^x+x}{x}+2 x^2 (5+2 x) \]

[Out]

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

Rubi [A] (verified)

Time = 0.07 (sec) , antiderivative size = 29, normalized size of antiderivative = 0.91, number of steps used = 8, number of rules used = 5, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.111, Rules used = {14, 6847, 2320, 2225, 2228} \[ \int \frac {e^x (1-x)-x^2+20 x^3+2 e^{e^{x^2}+x^2} x^3+12 x^4}{x^2} \, dx=4 x^3+10 x^2+e^{e^{x^2}}-x-\frac {e^x}{x} \]

[In]

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

[Out]

E^E^x^2 - E^x/x - x + 10*x^2 + 4*x^3

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

Int[u_, x_Symbol] :> With[{v = FunctionOfExponential[u, x]}, Dist[v/D[v, x], Subst[Int[FunctionOfExponentialFu
nction[u, x]/x, x], x, v], x]] /; FunctionOfExponentialQ[u, x] &&  !MatchQ[u, (w_)*((a_.)*(v_)^(n_))^(m_) /; F
reeQ[{a, m, n}, x] && IntegerQ[m*n]] &&  !MatchQ[u, E^((c_.)*((a_.) + (b_.)*x))*(F_)[v_] /; FreeQ[{a, b, c}, x
] && InverseFunctionQ[F[x]]]

Rule 6847

Int[(u_)*(x_)^(m_.), x_Symbol] :> Dist[1/(m + 1), Subst[Int[SubstFor[x^(m + 1), u, x], x], x, x^(m + 1)], x] /
; FreeQ[m, x] && NeQ[m, -1] && FunctionOfQ[x^(m + 1), u, x]

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

Mathematica [A] (verified)

Time = 0.04 (sec) , antiderivative size = 29, normalized size of antiderivative = 0.91 \[ \int \frac {e^x (1-x)-x^2+20 x^3+2 e^{e^{x^2}+x^2} x^3+12 x^4}{x^2} \, dx=e^{e^{x^2}}-\frac {e^x}{x}-x+10 x^2+4 x^3 \]

[In]

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

[Out]

E^E^x^2 - E^x/x - x + 10*x^2 + 4*x^3

Maple [A] (verified)

Time = 0.08 (sec) , antiderivative size = 27, normalized size of antiderivative = 0.84

method result size
default \(-x -\frac {{\mathrm e}^{x}}{x}+10 x^{2}+4 x^{3}+{\mathrm e}^{{\mathrm e}^{x^{2}}}\) \(27\)
risch \(-x -\frac {{\mathrm e}^{x}}{x}+10 x^{2}+4 x^{3}+{\mathrm e}^{{\mathrm e}^{x^{2}}}\) \(27\)
parts \(-x -\frac {{\mathrm e}^{x}}{x}+10 x^{2}+4 x^{3}+{\mathrm e}^{{\mathrm e}^{x^{2}}}\) \(27\)
parallelrisch \(\frac {4 x^{4}+10 x^{3}-x^{2}+{\mathrm e}^{{\mathrm e}^{x^{2}}} x -{\mathrm e}^{x}}{x}\) \(32\)

[In]

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

[Out]

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

Fricas [A] (verification not implemented)

none

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

[In]

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

[Out]

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

Sympy [A] (verification not implemented)

Time = 0.15 (sec) , antiderivative size = 22, normalized size of antiderivative = 0.69 \[ \int \frac {e^x (1-x)-x^2+20 x^3+2 e^{e^{x^2}+x^2} x^3+12 x^4}{x^2} \, dx=4 x^{3} + 10 x^{2} - x + e^{e^{x^{2}}} - \frac {e^{x}}{x} \]

[In]

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

[Out]

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

Maxima [C] (verification not implemented)

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

Time = 0.24 (sec) , antiderivative size = 28, normalized size of antiderivative = 0.88 \[ \int \frac {e^x (1-x)-x^2+20 x^3+2 e^{e^{x^2}+x^2} x^3+12 x^4}{x^2} \, dx=4 \, x^{3} + 10 \, x^{2} - x - {\rm Ei}\left (x\right ) + e^{\left (e^{\left (x^{2}\right )}\right )} + \Gamma \left (-1, -x\right ) \]

[In]

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

[Out]

4*x^3 + 10*x^2 - x - Ei(x) + e^(e^(x^2)) + gamma(-1, -x)

Giac [A] (verification not implemented)

none

Time = 0.26 (sec) , antiderivative size = 57, normalized size of antiderivative = 1.78 \[ \int \frac {e^x (1-x)-x^2+20 x^3+2 e^{e^{x^2}+x^2} x^3+12 x^4}{x^2} \, dx=\frac {{\left (4 \, x^{4} e^{\left (x^{2}\right )} + 10 \, x^{3} e^{\left (x^{2}\right )} - x^{2} e^{\left (x^{2}\right )} + x e^{\left (x^{2} + e^{\left (x^{2}\right )}\right )} - e^{\left (x^{2} + x\right )}\right )} e^{\left (-x^{2}\right )}}{x} \]

[In]

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

[Out]

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

Mupad [B] (verification not implemented)

Time = 17.13 (sec) , antiderivative size = 26, normalized size of antiderivative = 0.81 \[ \int \frac {e^x (1-x)-x^2+20 x^3+2 e^{e^{x^2}+x^2} x^3+12 x^4}{x^2} \, dx={\mathrm {e}}^{{\mathrm {e}}^{x^2}}-x-\frac {{\mathrm {e}}^x}{x}+10\,x^2+4\,x^3 \]

[In]

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

[Out]

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