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

Optimal. Leaf size=16 \[ e^x-\frac {3 e^x}{1-x} \]

[Out]

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

________________________________________________________________________________________

Rubi [A]
time = 0.05, antiderivative size = 16, normalized size of antiderivative = 1.00, number of steps used = 6, number of rules used = 4, integrand size = 15, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.267, Rules used = {2230, 2225, 2208, 2209} \begin {gather*} e^x-\frac {3 e^x}{1-x} \end {gather*}

Antiderivative was successfully verified.

[In]

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

[Out]

E^x - (3*E^x)/(1 - x)

Rule 2208

Int[((b_.)*(F_)^((g_.)*((e_.) + (f_.)*(x_))))^(n_.)*((c_.) + (d_.)*(x_))^(m_), x_Symbol] :> Simp[(c + d*x)^(m
+ 1)*((b*F^(g*(e + f*x)))^n/(d*(m + 1))), x] - Dist[f*g*n*(Log[F]/(d*(m + 1))), Int[(c + d*x)^(m + 1)*(b*F^(g*
(e + f*x)))^n, x], x] /; FreeQ[{F, b, c, d, e, f, g, n}, x] && LtQ[m, -1] && IntegerQ[2*m] &&  !TrueQ[$UseGamm
a]

Rule 2209

Int[(F_)^((g_.)*((e_.) + (f_.)*(x_)))/((c_.) + (d_.)*(x_)), x_Symbol] :> Simp[(F^(g*(e - c*(f/d)))/d)*ExpInteg
ralEi[f*g*(c + d*x)*(Log[F]/d)], x] /; FreeQ[{F, c, d, e, f, g}, x] &&  !TrueQ[$UseGamma]

Rule 2225

Int[((F_)^((c_.)*((a_.) + (b_.)*(x_))))^(n_.), x_Symbol] :> Simp[(F^(c*(a + b*x)))^n/(b*c*n*Log[F]), x] /; Fre
eQ[{F, a, b, c, n}, x]

Rule 2230

Int[(F_)^((c_.)*(v_))*(u_)^(m_.)*(w_), x_Symbol] :> Int[ExpandIntegrand[F^(c*ExpandToSum[v, x]), w*NormalizePo
werOfLinear[u, x]^m, x], x] /; FreeQ[{F, c}, x] && PolynomialQ[w, x] && LinearQ[v, x] && PowerOfLinearQ[u, x]
&& IntegerQ[m] &&  !TrueQ[$UseGamma]

Rubi steps

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

________________________________________________________________________________________

Mathematica [A]
time = 0.04, size = 13, normalized size = 0.81 \begin {gather*} e^x \left (1+\frac {3}{-1+x}\right ) \end {gather*}

Antiderivative was successfully verified.

[In]

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

[Out]

E^x*(1 + 3/(-1 + x))

________________________________________________________________________________________

Maple [A]
time = 0.08, size = 13, normalized size = 0.81

method result size
gosper \(\frac {\left (x +2\right ) {\mathrm e}^{x}}{-1+x}\) \(12\)
risch \(\frac {\left (x +2\right ) {\mathrm e}^{x}}{-1+x}\) \(12\)
default \(\frac {3 \,{\mathrm e}^{x}}{-1+x}+{\mathrm e}^{x}\) \(13\)
norman \(\frac {{\mathrm e}^{x} x +2 \,{\mathrm e}^{x}}{-1+x}\) \(16\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

3*exp(x)/(-1+x)+exp(x)

________________________________________________________________________________________

Maxima [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Failed to integrate} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

(x^2 + x)*e^x/(x^2 - 2*x + 1) + 5*e*exp_integral_e(2, -x + 1)/(x - 1) + integrate((3*x + 1)*e^x/(x^3 - 3*x^2 +
 3*x - 1), x)

________________________________________________________________________________________

Fricas [A]
time = 0.40, size = 11, normalized size = 0.69 \begin {gather*} \frac {{\left (x + 2\right )} e^{x}}{x - 1} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Sympy [A]
time = 0.03, size = 8, normalized size = 0.50 \begin {gather*} \frac {\left (x + 2\right ) e^{x}}{x - 1} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Giac [B] Leaf count of result is larger than twice the leaf count of optimal. 54 vs. \(2 (12) = 24\).
time = 5.56, size = 54, normalized size = 3.38 \begin {gather*} \frac {{\left (x - 1\right )} {\left (\frac {1}{x - 1} + 1\right )} e^{\left ({\left (x - 1\right )} {\left (\frac {1}{x - 1} + 1\right )}\right )} + 2 \, e^{\left ({\left (x - 1\right )} {\left (\frac {1}{x - 1} + 1\right )}\right )}}{{\left (x - 1\right )} {\left (\frac {1}{x - 1} + 1\right )} - 1} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Mupad [B]
time = 0.08, size = 11, normalized size = 0.69 \begin {gather*} \frac {{\mathrm {e}}^x\,\left (x+2\right )}{x-1} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________