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]

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

________________________________________________________________________________________

Rubi [A]  time = 0.0742178, antiderivative size = 16, normalized size of antiderivative = 1., 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 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

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

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.0329099, 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)

________________________________________________________________________________________

Maple [A]  time = 0.019, size = 12, normalized size = 0.8 \begin{align*}{\frac{ \left ( 2+x \right ){{\rm e}^{x}}}{x-1}} \end{align*}

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)*(2+x)*exp(x)

________________________________________________________________________________________

Maxima [F]  time = 0., size = 0, normalized size = 0. \begin{align*} \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} \end{align*}

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.788438, size = 28, normalized size = 1.75 \begin{align*} \frac{{\left (x + 2\right )} e^{x}}{x - 1} \end{align*}

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.094451, size = 8, normalized size = 0.5 \begin{align*} \frac{\left (x + 2\right ) e^{x}}{x - 1} \end{align*}

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]  time = 1.24843, size = 43, normalized size = 2.69 \begin{align*} \frac{3 \, e^{\left ({\left (x - 1\right )}{\left (\frac{1}{x - 1} + 1\right )}\right )}}{x - 1} + e^{\left ({\left (x - 1\right )}{\left (\frac{1}{x - 1} + 1\right )}\right )} \end{align*}

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]

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