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

Optimal. Leaf size=33 \[ -e^4+e^{x^2}-x+3 \left (\frac {5}{9}+x\right )-\frac {e^x+3 x}{x} \]

[Out]

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

________________________________________________________________________________________

Rubi [A]
time = 0.04, antiderivative size = 17, normalized size of antiderivative = 0.52, number of steps used = 6, number of rules used = 3, integrand size = 29, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.103, Rules used = {14, 2240, 2228} \begin {gather*} e^{x^2}+2 x-\frac {e^x}{x} \end {gather*}

Antiderivative was successfully verified.

[In]

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

[Out]

E^x^2 - E^x/x + 2*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 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 2240

Int[(F_)^((a_.) + (b_.)*((c_.) + (d_.)*(x_))^(n_))*((e_.) + (f_.)*(x_))^(m_.), x_Symbol] :> Simp[(e + f*x)^n*(
F^(a + b*(c + d*x)^n)/(b*f*n*(c + d*x)^n*Log[F])), x] /; FreeQ[{F, a, b, c, d, e, f, n}, x] && EqQ[m, n - 1] &
& EqQ[d*e - c*f, 0]

Rubi steps

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

________________________________________________________________________________________

Mathematica [A]
time = 0.02, size = 17, normalized size = 0.52 \begin {gather*} e^{x^2}-\frac {e^x}{x}+2 x \end {gather*}

Antiderivative was successfully verified.

[In]

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

[Out]

E^x^2 - E^x/x + 2*x

________________________________________________________________________________________

Maple [A]
time = 0.17, size = 16, normalized size = 0.48

method result size
default \(2 x -\frac {{\mathrm e}^{x}}{x}+{\mathrm e}^{x^{2}}\) \(16\)
risch \(2 x -\frac {{\mathrm e}^{x}}{x}+{\mathrm e}^{x^{2}}\) \(16\)
norman \(\frac {{\mathrm e}^{x^{2}} x +2 x^{2}-{\mathrm e}^{x}}{x}\) \(21\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Maxima [C] Result contains higher order function than in optimal. Order 4 vs. order 3.
time = 0.29, size = 17, normalized size = 0.52 \begin {gather*} 2 \, x - {\rm Ei}\left (x\right ) + e^{\left (x^{2}\right )} + \Gamma \left (-1, -x\right ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Fricas [A]
time = 0.38, size = 20, normalized size = 0.61 \begin {gather*} \frac {2 \, x^{2} + x e^{\left (x^{2}\right )} - e^{x}}{x} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Sympy [A]
time = 0.06, size = 12, normalized size = 0.36 \begin {gather*} 2 x + e^{x^{2}} - \frac {e^{x}}{x} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Giac [A]
time = 0.40, size = 20, normalized size = 0.61 \begin {gather*} \frac {2 \, x^{2} + x e^{\left (x^{2}\right )} - e^{x}}{x} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Mupad [B]
time = 1.21, size = 15, normalized size = 0.45 \begin {gather*} 2\,x+{\mathrm {e}}^{x^2}-\frac {{\mathrm {e}}^x}{x} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________