3.83.43 \(\int \frac {e^{-x} (1+e^{2 x} (2-x)+11 x-x^2+x^3)}{1-2 x+x^2} \, dx\)

Optimal. Leaf size=28 \[ 3-\frac {10+e^{2 x}+x+x^2}{-e^x+e^x x} \]

________________________________________________________________________________________

Rubi [A]  time = 0.58, antiderivative size = 41, normalized size of antiderivative = 1.46, number of steps used = 21, number of rules used = 8, integrand size = 40, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.200, Rules used = {27, 6742, 2177, 2178, 2197, 2199, 2194, 2176} \begin {gather*} -e^{-x} x-2 e^{-x}+\frac {12 e^{-x}}{1-x}+\frac {e^x}{1-x} \end {gather*}

Antiderivative was successfully verified.

[In]

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

[Out]

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

Rule 27

Int[(u_.)*((a_) + (b_.)*(x_) + (c_.)*(x_)^2)^(p_.), x_Symbol] :> Int[u*Cancel[(b/2 + c*x)^(2*p)/c^p], x] /; Fr
eeQ[{a, b, c}, x] && EqQ[b^2 - 4*a*c, 0] && IntegerQ[p]

Rule 2176

Int[((b_.)*(F_)^((g_.)*((e_.) + (f_.)*(x_))))^(n_.)*((c_.) + (d_.)*(x_))^(m_.), x_Symbol] :> Simp[((c + d*x)^m
*(b*F^(g*(e + f*x)))^n)/(f*g*n*Log[F]), x] - Dist[(d*m)/(f*g*n*Log[F]), 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] && GtQ[m, 0] && IntegerQ[2*m] &&  !$UseGamma === True

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 2197

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
]

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 6742

Int[u_, x_Symbol] :> With[{v = ExpandIntegrand[u, x]}, Int[v, x] /; SumQ[v]]

Rubi steps

\begin {gather*} \begin {aligned} \text {integral} &=\int \frac {e^{-x} \left (1+e^{2 x} (2-x)+11 x-x^2+x^3\right )}{(-1+x)^2} \, dx\\ &=\int \left (\frac {e^{-x}}{(-1+x)^2}-\frac {e^x (-2+x)}{(-1+x)^2}+\frac {11 e^{-x} x}{(-1+x)^2}-\frac {e^{-x} x^2}{(-1+x)^2}+\frac {e^{-x} x^3}{(-1+x)^2}\right ) \, dx\\ &=11 \int \frac {e^{-x} x}{(-1+x)^2} \, dx+\int \frac {e^{-x}}{(-1+x)^2} \, dx-\int \frac {e^x (-2+x)}{(-1+x)^2} \, dx-\int \frac {e^{-x} x^2}{(-1+x)^2} \, dx+\int \frac {e^{-x} x^3}{(-1+x)^2} \, dx\\ &=\frac {12 e^{-x}}{1-x}+\frac {e^x}{1-x}-\int \left (e^{-x}+\frac {e^{-x}}{(-1+x)^2}+\frac {2 e^{-x}}{-1+x}\right ) \, dx-\int \frac {e^{-x}}{-1+x} \, dx+\int \left (2 e^{-x}+\frac {e^{-x}}{(-1+x)^2}+\frac {3 e^{-x}}{-1+x}+e^{-x} x\right ) \, dx\\ &=\frac {12 e^{-x}}{1-x}+\frac {e^x}{1-x}-\frac {\text {Ei}(1-x)}{e}+2 \int e^{-x} \, dx-2 \int \frac {e^{-x}}{-1+x} \, dx+3 \int \frac {e^{-x}}{-1+x} \, dx-\int e^{-x} \, dx+\int e^{-x} x \, dx\\ &=-e^{-x}+\frac {12 e^{-x}}{1-x}+\frac {e^x}{1-x}-e^{-x} x+\int e^{-x} \, dx\\ &=-2 e^{-x}+\frac {12 e^{-x}}{1-x}+\frac {e^x}{1-x}-e^{-x} x\\ \end {aligned} \end {gather*}

________________________________________________________________________________________

Mathematica [A]  time = 0.45, size = 23, normalized size = 0.82 \begin {gather*} -\frac {e^{-x} \left (10+e^{2 x}+x+x^2\right )}{-1+x} \end {gather*}

Antiderivative was successfully verified.

[In]

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

[Out]

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

________________________________________________________________________________________

fricas [A]  time = 0.54, size = 22, normalized size = 0.79 \begin {gather*} -\frac {{\left ({\left (x^{2} + x + 10\right )} e^{\left (-2 \, x\right )} + 1\right )} e^{x}}{x - 1} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

giac [A]  time = 0.14, size = 30, normalized size = 1.07 \begin {gather*} -\frac {x^{2} e^{\left (-x\right )} + x e^{\left (-x\right )} + 10 \, e^{\left (-x\right )} + e^{x}}{x - 1} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

maple [A]  time = 0.41, size = 27, normalized size = 0.96




method result size



norman \(\frac {\left (-10-x -x^{2}-{\mathrm e}^{2 x}\right ) {\mathrm e}^{-x}}{x -1}\) \(27\)
risch \(-\frac {{\mathrm e}^{x}}{x -1}-\frac {\left (x^{2}+x +10\right ) {\mathrm e}^{-x}}{x -1}\) \(28\)
default \(-\frac {12 \,{\mathrm e}^{-x}}{x -1}-\left (3+x \right ) {\mathrm e}^{-x}-\frac {{\mathrm e}^{x}}{x -1}+{\mathrm e}^{-x}\) \(35\)



Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

(-10-x-x^2-exp(x)^2)/(x-1)/exp(x)

________________________________________________________________________________________

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

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

mupad [B]  time = 0.12, size = 27, normalized size = 0.96 \begin {gather*} -{\mathrm {e}}^{-x}\,\left (x+2\right )-\frac {{\mathrm {e}}^{-x}\,\left ({\mathrm {e}}^{2\,x}+12\right )}{x-1} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

sympy [A]  time = 0.14, size = 26, normalized size = 0.93 \begin {gather*} \frac {\left (1 - x\right ) e^{x} + \left (- x^{3} - 9 x + 10\right ) e^{- x}}{x^{2} - 2 x + 1} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

((1 - x)*exp(x) + (-x**3 - 9*x + 10)*exp(-x))/(x**2 - 2*x + 1)

________________________________________________________________________________________