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

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

Optimal result

Integrand size = 34, antiderivative size = 26 \[ \int \frac {-x+x^2+e^{-x+x^2} \left (-1-x+2 x^2\right )}{5 x^2} \, dx=4+\frac {1}{5} \left (11+\frac {e^{-x+x^2}}{x}+x-\log (x)\right ) \]

[Out]

31/5-1/5*ln(x)+1/5*x+1/5*exp(x^2-x)/x

Rubi [A] (verified)

Time = 0.06 (sec) , antiderivative size = 28, normalized size of antiderivative = 1.08, number of steps used = 6, number of rules used = 4, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.118, Rules used = {12, 14, 2327, 45} \[ \int \frac {-x+x^2+e^{-x+x^2} \left (-1-x+2 x^2\right )}{5 x^2} \, dx=\frac {e^{x^2-x}}{5 x}+\frac {x}{5}-\frac {\log (x)}{5} \]

[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 45

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 2327

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]]/Coefficient[z, x, Exponent[z, x]])*F^u*v^(n + 1), 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{align*} \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{align*}

Mathematica [A] (verified)

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

[In]

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

[Out]

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

Maple [A] (verified)

Time = 0.08 (sec) , antiderivative size = 20, normalized size of antiderivative = 0.77

method result size
risch \(\frac {x}{5}-\frac {\ln \left (x \right )}{5}+\frac {{\mathrm e}^{x \left (-1+x \right )}}{5 x}\) \(20\)
parts \(\frac {x}{5}-\frac {\ln \left (x \right )}{5}+\frac {{\mathrm e}^{x^{2}-x}}{5 x}\) \(22\)
norman \(\frac {\frac {x^{2}}{5}+\frac {{\mathrm e}^{x^{2}-x}}{5}}{x}-\frac {\ln \left (x \right )}{5}\) \(26\)
parallelrisch \(-\frac {x \ln \left (x \right )-x^{2}-{\mathrm e}^{x^{2}-x}}{5 x}\) \(26\)

[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*(-1+x))/x

Fricas [A] (verification not implemented)

none

Time = 0.36 (sec) , antiderivative size = 22, normalized size of antiderivative = 0.85 \[ \int \frac {-x+x^2+e^{-x+x^2} \left (-1-x+2 x^2\right )}{5 x^2} \, dx=\frac {x^{2} - x \log \left (x\right ) + e^{\left (x^{2} - x\right )}}{5 \, x} \]

[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

Sympy [A] (verification not implemented)

Time = 0.07 (sec) , antiderivative size = 17, normalized size of antiderivative = 0.65 \[ \int \frac {-x+x^2+e^{-x+x^2} \left (-1-x+2 x^2\right )}{5 x^2} \, dx=\frac {x}{5} - \frac {\log {\left (x \right )}}{5} + \frac {e^{x^{2} - x}}{5 x} \]

[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)

Maxima [F]

\[ \int \frac {-x+x^2+e^{-x+x^2} \left (-1-x+2 x^2\right )}{5 x^2} \, dx=\int { \frac {x^{2} + {\left (2 \, x^{2} - x - 1\right )} e^{\left (x^{2} - x\right )} - x}{5 \, x^{2}} \,d x } \]

[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)

Giac [A] (verification not implemented)

none

Time = 0.26 (sec) , antiderivative size = 22, normalized size of antiderivative = 0.85 \[ \int \frac {-x+x^2+e^{-x+x^2} \left (-1-x+2 x^2\right )}{5 x^2} \, dx=\frac {x^{2} - x \log \left (x\right ) + e^{\left (x^{2} - x\right )}}{5 \, x} \]

[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

Mupad [B] (verification not implemented)

Time = 11.15 (sec) , antiderivative size = 22, normalized size of antiderivative = 0.85 \[ \int \frac {-x+x^2+e^{-x+x^2} \left (-1-x+2 x^2\right )}{5 x^2} \, dx=\frac {{\mathrm {e}}^{x^2-x}+x^2}{5\,x}-\frac {\ln \left (x\right )}{5} \]

[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