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

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

________________________________________________________________________________________

Rubi [A]  time = 0.06, 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, 2209, 2197} \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 2197

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 2209

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.01, 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

________________________________________________________________________________________

fricas [A]  time = 0.62, 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)+(-x+1)*exp(x)+2*x^2)/x^2,x, algorithm="fricas")

[Out]

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

________________________________________________________________________________________

giac [A]  time = 0.18, 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)+(-x+1)*exp(x)+2*x^2)/x^2,x, algorithm="giac")

[Out]

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

________________________________________________________________________________________

maple [A]  time = 0.06, 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]  time = 1.00, size = 17, normalized size = 0.52 \begin {gather*} 2 \, x - {\rm Ei}\relax (x) + 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)+(-x+1)*exp(x)+2*x^2)/x^2,x, algorithm="maxima")

[Out]

2*x - Ei(x) + e^(x^2) + gamma(-1, -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

________________________________________________________________________________________

sympy [A]  time = 0.14, 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)+(-x+1)*exp(x)+2*x**2)/x**2,x)

[Out]

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

________________________________________________________________________________________