\(\int \frac {e^{-x} (-12 x^2+7 x^3-x^4+x^5+(-20 x^4+9 x^5-x^6) \log (-4+x))}{-4+x} \, dx\) [5877]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [A] (verified)
   Fricas [A] (verification not implemented)
   Sympy [A] (verification not implemented)
   Maxima [A] (verification not implemented)
   Giac [B] (verification not implemented)
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 51, antiderivative size = 19 \[ \int \frac {e^{-x} \left (-12 x^2+7 x^3-x^4+x^5+\left (-20 x^4+9 x^5-x^6\right ) \log (-4+x)\right )}{-4+x} \, dx=e^{-x} x^2 \left (x+x^3 \log (-4+x)\right ) \]

[Out]

x^2*(x^3*ln(x-4)+x)/exp(x)

Rubi [A] (verified)

Time = 0.50 (sec) , antiderivative size = 23, normalized size of antiderivative = 1.21, number of steps used = 39, number of rules used = 7, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.137, Rules used = {6874, 2230, 2225, 2209, 2207, 2227, 2634} \[ \int \frac {e^{-x} \left (-12 x^2+7 x^3-x^4+x^5+\left (-20 x^4+9 x^5-x^6\right ) \log (-4+x)\right )}{-4+x} \, dx=e^{-x} x^5 \log (x-4)+e^{-x} x^3 \]

[In]

Int[(-12*x^2 + 7*x^3 - x^4 + x^5 + (-20*x^4 + 9*x^5 - x^6)*Log[-4 + x])/(E^x*(-4 + x)),x]

[Out]

x^3/E^x + (x^5*Log[-4 + x])/E^x

Rule 2207

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] &&  !TrueQ[$UseGamma]

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 2227

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

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]

Rule 2634

Int[Log[u_]*(v_), x_Symbol] :> With[{w = IntHide[v, x]}, Dist[Log[u], w, x] - Int[SimplifyIntegrand[w*(D[u, x]
/u), x], x] /; InverseFunctionFreeQ[w, x]] /; InverseFunctionFreeQ[u, x]

Rule 6874

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

Rubi steps \begin{align*} \text {integral}& = \int \left (\frac {e^{-x} x^2 \left (-12+7 x-x^2+x^3\right )}{-4+x}-e^{-x} (-5+x) x^4 \log (-4+x)\right ) \, dx \\ & = \int \frac {e^{-x} x^2 \left (-12+7 x-x^2+x^3\right )}{-4+x} \, dx-\int e^{-x} (-5+x) x^4 \log (-4+x) \, dx \\ & = e^{-x} x^5 \log (-4+x)-\int \frac {e^{-x} x^5}{-4+x} \, dx+\int \left (256 e^{-x}+\frac {1024 e^{-x}}{-4+x}+64 e^{-x} x+19 e^{-x} x^2+3 e^{-x} x^3+e^{-x} x^4\right ) \, dx \\ & = e^{-x} x^5 \log (-4+x)+3 \int e^{-x} x^3 \, dx+19 \int e^{-x} x^2 \, dx+64 \int e^{-x} x \, dx+256 \int e^{-x} \, dx+1024 \int \frac {e^{-x}}{-4+x} \, dx+\int e^{-x} x^4 \, dx-\int \left (256 e^{-x}+\frac {1024 e^{-x}}{-4+x}+64 e^{-x} x+16 e^{-x} x^2+4 e^{-x} x^3+e^{-x} x^4\right ) \, dx \\ & = -256 e^{-x}-64 e^{-x} x-19 e^{-x} x^2-3 e^{-x} x^3-e^{-x} x^4+\frac {1024 \text {Ei}(4-x)}{e^4}+e^{-x} x^5 \log (-4+x)+9 \int e^{-x} x^2 \, dx-16 \int e^{-x} x^2 \, dx+38 \int e^{-x} x \, dx+64 \int e^{-x} \, dx-64 \int e^{-x} x \, dx-256 \int e^{-x} \, dx-1024 \int \frac {e^{-x}}{-4+x} \, dx-\int e^{-x} x^4 \, dx \\ & = -64 e^{-x}-38 e^{-x} x-12 e^{-x} x^2-3 e^{-x} x^3+e^{-x} x^5 \log (-4+x)-4 \int e^{-x} x^3 \, dx+18 \int e^{-x} x \, dx-32 \int e^{-x} x \, dx+38 \int e^{-x} \, dx-64 \int e^{-x} \, dx \\ & = -38 e^{-x}-24 e^{-x} x-12 e^{-x} x^2+e^{-x} x^3+e^{-x} x^5 \log (-4+x)-12 \int e^{-x} x^2 \, dx+18 \int e^{-x} \, dx-32 \int e^{-x} \, dx \\ & = -24 e^{-x}-24 e^{-x} x+e^{-x} x^3+e^{-x} x^5 \log (-4+x)-24 \int e^{-x} x \, dx \\ & = -24 e^{-x}+e^{-x} x^3+e^{-x} x^5 \log (-4+x)-24 \int e^{-x} \, dx \\ & = e^{-x} x^3+e^{-x} x^5 \log (-4+x) \\ \end{align*}

Mathematica [A] (verified)

Time = 1.26 (sec) , antiderivative size = 19, normalized size of antiderivative = 1.00 \[ \int \frac {e^{-x} \left (-12 x^2+7 x^3-x^4+x^5+\left (-20 x^4+9 x^5-x^6\right ) \log (-4+x)\right )}{-4+x} \, dx=e^{-x} x^3 \left (1+x^2 \log (-4+x)\right ) \]

[In]

Integrate[(-12*x^2 + 7*x^3 - x^4 + x^5 + (-20*x^4 + 9*x^5 - x^6)*Log[-4 + x])/(E^x*(-4 + x)),x]

[Out]

(x^3*(1 + x^2*Log[-4 + x]))/E^x

Maple [A] (verified)

Time = 0.74 (sec) , antiderivative size = 22, normalized size of antiderivative = 1.16

method result size
risch \(x^{5} {\mathrm e}^{-x} \ln \left (x -4\right )+x^{3} {\mathrm e}^{-x}\) \(22\)
parallelrisch \(-\frac {\left (-8 \ln \left (x -4\right ) x^{5}-8 x^{3}\right ) {\mathrm e}^{-x}}{8}\) \(22\)

[In]

int(((-x^6+9*x^5-20*x^4)*ln(x-4)+x^5-x^4+7*x^3-12*x^2)/(x-4)/exp(x),x,method=_RETURNVERBOSE)

[Out]

x^5*exp(-x)*ln(x-4)+x^3*exp(-x)

Fricas [A] (verification not implemented)

none

Time = 0.24 (sec) , antiderivative size = 21, normalized size of antiderivative = 1.11 \[ \int \frac {e^{-x} \left (-12 x^2+7 x^3-x^4+x^5+\left (-20 x^4+9 x^5-x^6\right ) \log (-4+x)\right )}{-4+x} \, dx=x^{5} e^{\left (-x\right )} \log \left (x - 4\right ) + x^{3} e^{\left (-x\right )} \]

[In]

integrate(((-x^6+9*x^5-20*x^4)*log(x-4)+x^5-x^4+7*x^3-12*x^2)/(x-4)/exp(x),x, algorithm="fricas")

[Out]

x^5*e^(-x)*log(x - 4) + x^3*e^(-x)

Sympy [A] (verification not implemented)

Time = 0.13 (sec) , antiderivative size = 14, normalized size of antiderivative = 0.74 \[ \int \frac {e^{-x} \left (-12 x^2+7 x^3-x^4+x^5+\left (-20 x^4+9 x^5-x^6\right ) \log (-4+x)\right )}{-4+x} \, dx=\left (x^{5} \log {\left (x - 4 \right )} + x^{3}\right ) e^{- x} \]

[In]

integrate(((-x**6+9*x**5-20*x**4)*ln(x-4)+x**5-x**4+7*x**3-12*x**2)/(x-4)/exp(x),x)

[Out]

(x**5*log(x - 4) + x**3)*exp(-x)

Maxima [A] (verification not implemented)

none

Time = 0.23 (sec) , antiderivative size = 21, normalized size of antiderivative = 1.11 \[ \int \frac {e^{-x} \left (-12 x^2+7 x^3-x^4+x^5+\left (-20 x^4+9 x^5-x^6\right ) \log (-4+x)\right )}{-4+x} \, dx=x^{5} e^{\left (-x\right )} \log \left (x - 4\right ) + x^{3} e^{\left (-x\right )} \]

[In]

integrate(((-x^6+9*x^5-20*x^4)*log(x-4)+x^5-x^4+7*x^3-12*x^2)/(x-4)/exp(x),x, algorithm="maxima")

[Out]

x^5*e^(-x)*log(x - 4) + x^3*e^(-x)

Giac [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 142 vs. \(2 (18) = 36\).

Time = 0.28 (sec) , antiderivative size = 142, normalized size of antiderivative = 7.47 \[ \int \frac {e^{-x} \left (-12 x^2+7 x^3-x^4+x^5+\left (-20 x^4+9 x^5-x^6\right ) \log (-4+x)\right )}{-4+x} \, dx={\left ({\left (x - 4\right )}^{5} e^{\left (-x + 4\right )} \log \left (x - 4\right ) + 20 \, {\left (x - 4\right )}^{4} e^{\left (-x + 4\right )} \log \left (x - 4\right ) + 160 \, {\left (x - 4\right )}^{3} e^{\left (-x + 4\right )} \log \left (x - 4\right ) + {\left (x - 4\right )}^{3} e^{\left (-x + 4\right )} + 640 \, {\left (x - 4\right )}^{2} e^{\left (-x + 4\right )} \log \left (x - 4\right ) + 12 \, {\left (x - 4\right )}^{2} e^{\left (-x + 4\right )} + 1280 \, {\left (x - 4\right )} e^{\left (-x + 4\right )} \log \left (x - 4\right ) + 48 \, {\left (x - 4\right )} e^{\left (-x + 4\right )} + 1024 \, e^{\left (-x + 4\right )} \log \left (x - 4\right ) + 64 \, e^{\left (-x + 4\right )}\right )} e^{\left (-4\right )} \]

[In]

integrate(((-x^6+9*x^5-20*x^4)*log(x-4)+x^5-x^4+7*x^3-12*x^2)/(x-4)/exp(x),x, algorithm="giac")

[Out]

((x - 4)^5*e^(-x + 4)*log(x - 4) + 20*(x - 4)^4*e^(-x + 4)*log(x - 4) + 160*(x - 4)^3*e^(-x + 4)*log(x - 4) +
(x - 4)^3*e^(-x + 4) + 640*(x - 4)^2*e^(-x + 4)*log(x - 4) + 12*(x - 4)^2*e^(-x + 4) + 1280*(x - 4)*e^(-x + 4)
*log(x - 4) + 48*(x - 4)*e^(-x + 4) + 1024*e^(-x + 4)*log(x - 4) + 64*e^(-x + 4))*e^(-4)

Mupad [B] (verification not implemented)

Time = 12.68 (sec) , antiderivative size = 18, normalized size of antiderivative = 0.95 \[ \int \frac {e^{-x} \left (-12 x^2+7 x^3-x^4+x^5+\left (-20 x^4+9 x^5-x^6\right ) \log (-4+x)\right )}{-4+x} \, dx=x^3\,{\mathrm {e}}^{-x}\,\left (x^2\,\ln \left (x-4\right )+1\right ) \]

[In]

int(-(exp(-x)*(log(x - 4)*(20*x^4 - 9*x^5 + x^6) + 12*x^2 - 7*x^3 + x^4 - x^5))/(x - 4),x)

[Out]

x^3*exp(-x)*(x^2*log(x - 4) + 1)