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

   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 = 22, antiderivative size = 17 \[ \int \frac {e^x (1-x)+5 x^2}{5 x^2} \, dx=10-\frac {e^x}{5 x}+x+\log \left (\frac {14}{3}\right ) \]

[Out]

10-1/5*exp(x)/x+ln(14/3)+x

Rubi [A] (verified)

Time = 0.02 (sec) , antiderivative size = 12, normalized size of antiderivative = 0.71, number of steps used = 4, number of rules used = 3, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.136, Rules used = {12, 14, 2228} \[ \int \frac {e^x (1-x)+5 x^2}{5 x^2} \, dx=x-\frac {e^x}{5 x} \]

[In]

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

[Out]

-1/5*E^x/x + x

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

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

Mathematica [A] (verified)

Time = 0.01 (sec) , antiderivative size = 12, normalized size of antiderivative = 0.71 \[ \int \frac {e^x (1-x)+5 x^2}{5 x^2} \, dx=-\frac {e^x}{5 x}+x \]

[In]

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

[Out]

-1/5*E^x/x + x

Maple [A] (verified)

Time = 0.12 (sec) , antiderivative size = 10, normalized size of antiderivative = 0.59

method result size
default \(x -\frac {{\mathrm e}^{x}}{5 x}\) \(10\)
risch \(x -\frac {{\mathrm e}^{x}}{5 x}\) \(10\)
parts \(x -\frac {{\mathrm e}^{x}}{5 x}\) \(10\)
norman \(\frac {x^{2}-\frac {{\mathrm e}^{x}}{5}}{x}\) \(13\)
parallelrisch \(\frac {5 x^{2}-{\mathrm e}^{x}}{5 x}\) \(16\)

[In]

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

[Out]

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

Fricas [A] (verification not implemented)

none

Time = 0.24 (sec) , antiderivative size = 15, normalized size of antiderivative = 0.88 \[ \int \frac {e^x (1-x)+5 x^2}{5 x^2} \, dx=\frac {5 \, x^{2} - e^{x}}{5 \, x} \]

[In]

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

[Out]

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

Sympy [A] (verification not implemented)

Time = 0.04 (sec) , antiderivative size = 7, normalized size of antiderivative = 0.41 \[ \int \frac {e^x (1-x)+5 x^2}{5 x^2} \, dx=x - \frac {e^{x}}{5 x} \]

[In]

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

[Out]

x - exp(x)/(5*x)

Maxima [C] (verification not implemented)

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

Time = 0.22 (sec) , antiderivative size = 13, normalized size of antiderivative = 0.76 \[ \int \frac {e^x (1-x)+5 x^2}{5 x^2} \, dx=x - \frac {1}{5} \, {\rm Ei}\left (x\right ) + \frac {1}{5} \, \Gamma \left (-1, -x\right ) \]

[In]

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

[Out]

x - 1/5*Ei(x) + 1/5*gamma(-1, -x)

Giac [A] (verification not implemented)

none

Time = 0.26 (sec) , antiderivative size = 15, normalized size of antiderivative = 0.88 \[ \int \frac {e^x (1-x)+5 x^2}{5 x^2} \, dx=\frac {5 \, x^{2} - e^{x}}{5 \, x} \]

[In]

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

[Out]

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

Mupad [B] (verification not implemented)

Time = 0.05 (sec) , antiderivative size = 9, normalized size of antiderivative = 0.53 \[ \int \frac {e^x (1-x)+5 x^2}{5 x^2} \, dx=x-\frac {{\mathrm {e}}^x}{5\,x} \]

[In]

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

[Out]

x - exp(x)/(5*x)