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

Optimal. Leaf size=26 \[ 4+\frac {1}{5} \left (11+\frac {e^{-x+x^2}}{x}+x-\log (x)\right ) \]

________________________________________________________________________________________

Rubi [A]  time = 0.10, antiderivative size = 28, normalized size of antiderivative = 1.08, number of steps used = 6, number of rules used = 4, integrand size = 34, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.118, Rules used = {12, 14, 2289, 43} \begin {gather*} \frac {e^{x^2-x}}{5 x}+\frac {x}{5}-\frac {\log (x)}{5} \end {gather*}

Antiderivative was successfully verified.

[In]

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

[Out]

E^(-x + x^2)/(5*x) + x/5 - Log[x]/5

Rule 12

Int[(a_)*(u_), x_Symbol] :> Dist[a, Int[u, x], x] /; FreeQ[a, x] &&  !MatchQ[u, (b_)*(v_) /; FreeQ[b, 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 43

Int[((a_.) + (b_.)*(x_))^(m_.)*((c_.) + (d_.)*(x_))^(n_.), x_Symbol] :> Int[ExpandIntegrand[(a + b*x)^m*(c + d
*x)^n, x], x] /; FreeQ[{a, b, c, d, n}, x] && NeQ[b*c - a*d, 0] && IGtQ[m, 0] && ( !IntegerQ[n] || (EqQ[c, 0]
&& LeQ[7*m + 4*n + 4, 0]) || LtQ[9*m + 5*(n + 1), 0] || GtQ[m + n + 2, 0])

Rule 2289

Int[(F_)^(u_)*(v_)^(n_.)*(w_), x_Symbol] :> With[{z = Log[F]*v*D[u, x] + (n + 1)*D[v, x]}, Simp[(Coefficient[w
, x, Exponent[w, x]]*F^u*v^(n + 1))/Coefficient[z, x, Exponent[z, x]], x] /; EqQ[Exponent[w, x], Exponent[z, x
]] && EqQ[w*Coefficient[z, x, Exponent[z, x]], z*Coefficient[w, x, Exponent[w, x]]]] /; FreeQ[{F, n}, x] && Po
lynomialQ[u, x] && PolynomialQ[v, x] && PolynomialQ[w, x]

Rubi steps

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

________________________________________________________________________________________

Mathematica [A]  time = 0.11, size = 23, normalized size = 0.88 \begin {gather*} \frac {1}{5} \left (\frac {e^{-x+x^2}}{x}+x-\log (x)\right ) \end {gather*}

Antiderivative was successfully verified.

[In]

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

[Out]

(E^(-x + x^2)/x + x - Log[x])/5

________________________________________________________________________________________

fricas [A]  time = 0.51, size = 22, normalized size = 0.85 \begin {gather*} \frac {x^{2} - x \log \relax (x) + e^{\left (x^{2} - x\right )}}{5 \, x} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

1/5*(x^2 - x*log(x) + e^(x^2 - x))/x

________________________________________________________________________________________

giac [A]  time = 0.20, size = 22, normalized size = 0.85 \begin {gather*} \frac {x^{2} - x \log \relax (x) + e^{\left (x^{2} - x\right )}}{5 \, x} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

1/5*(x^2 - x*log(x) + e^(x^2 - x))/x

________________________________________________________________________________________

maple [A]  time = 0.06, size = 20, normalized size = 0.77




method result size



risch \(\frac {x}{5}-\frac {\ln \relax (x )}{5}+\frac {{\mathrm e}^{x \left (x -1\right )}}{5 x}\) \(20\)
norman \(\frac {\frac {x^{2}}{5}+\frac {{\mathrm e}^{x^{2}-x}}{5}}{x}-\frac {\ln \relax (x )}{5}\) \(26\)



Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

1/5*x-1/5*ln(x)+1/5*exp(x*(x-1))/x

________________________________________________________________________________________

maxima [F]  time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} -\frac {1}{5} i \, \sqrt {\pi } \operatorname {erf}\left (i \, x - \frac {1}{2} i\right ) e^{\left (-\frac {1}{4}\right )} + \frac {1}{5} \, x - \frac {1}{5} \, \int \frac {{\left (x + 1\right )} e^{\left (x^{2} - x\right )}}{x^{2}}\,{d x} - \frac {1}{5} \, \log \relax (x) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

-1/5*I*sqrt(pi)*erf(I*x - 1/2*I)*e^(-1/4) + 1/5*x - 1/5*integrate((x + 1)*e^(x^2 - x)/x^2, x) - 1/5*log(x)

________________________________________________________________________________________

mupad [B]  time = 0.08, size = 22, normalized size = 0.85 \begin {gather*} \frac {{\mathrm {e}}^{x^2-x}+x^2}{5\,x}-\frac {\ln \relax (x)}{5} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

sympy [A]  time = 0.11, size = 17, normalized size = 0.65 \begin {gather*} \frac {x}{5} - \frac {\log {\relax (x )}}{5} + \frac {e^{x^{2} - x}}{5 x} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________