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

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

[Out]

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

________________________________________________________________________________________

Rubi [A]  time = 0.07, 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 = {2199, 2194, 2177, 2178} \[ e^x-\frac {3 e^x}{1-x} \]

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 2177

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] &&  !$UseGamma ===
True

Rule 2178

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

Rule 2194

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 2199

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] &&  !$UseGamma === True

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.03, size = 12, normalized size = 0.75 \[ \frac {e^x (x+2)}{x-1} \]

Antiderivative was successfully verified.

[In]

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

[Out]

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

________________________________________________________________________________________

fricas [A]  time = 0.39, size = 11, normalized size = 0.69 \[ \frac {{\left (x + 2\right )} e^{x}}{x - 1} \]

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)

________________________________________________________________________________________

giac [B]  time = 0.22, size = 54, normalized size = 3.38 \[ \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} \]

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)

________________________________________________________________________________________

maple [A]  time = 0.02, size = 12, normalized size = 0.75 \[ \frac {\left (x +2\right ) {\mathrm e}^{x}}{x -1} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

maxima [F]  time = 0.00, size = 0, normalized size = 0.00 \[ \frac {{\left (x^{2} + x\right )} e^{x}}{x^{2} - 2 \, x + 1} + \frac {5 \, e E_{2}\left (-x + 1\right )}{x - 1} + \int \frac {{\left (3 \, x + 1\right )} e^{x}}{x^{3} - 3 \, x^{2} + 3 \, x - 1}\,{d x} \]

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)

________________________________________________________________________________________

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

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)

________________________________________________________________________________________

sympy [A]  time = 0.10, size = 8, normalized size = 0.50 \[ \frac {\left (x + 2\right ) e^{x}}{x - 1} \]

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)

________________________________________________________________________________________