3.50.48 \(\int \frac {e^{-x} (e^x (-8-4 x)+20 x+(-40 x+30 x^2-5 x^3+e^x (8+6 x-2 x^2)) \log (\frac {4-x}{x}))}{-4+x} \, dx\)

Optimal. Leaf size=25 \[ x \left (-2-x+5 e^{-x} x\right ) \log \left (\frac {4-x}{x}\right ) \]

________________________________________________________________________________________

Rubi [A]  time = 1.11, antiderivative size = 44, normalized size of antiderivative = 1.76, number of steps used = 24, number of rules used = 13, integrand size = 63, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.206, Rules used = {6742, 6688, 2199, 2194, 2178, 2196, 2176, 2554, 12, 43, 2463, 514, 72} \begin {gather*} 5 e^{-x} x^2 \log \left (\frac {4}{x}-1\right )-(x+1)^2 \log \left (\frac {4}{x}-1\right )+\log (4-x)-\log (x) \end {gather*}

Antiderivative was successfully verified.

[In]

Int[(E^x*(-8 - 4*x) + 20*x + (-40*x + 30*x^2 - 5*x^3 + E^x*(8 + 6*x - 2*x^2))*Log[(4 - x)/x])/(E^x*(-4 + x)),x
]

[Out]

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

Rule 12

Int[(a_)*(u_), x_Symbol] :> Dist[a, Int[u, x], x] /; FreeQ[a, x] &&  !MatchQ[u, (b_)*(v_) /; FreeQ[b, x]]

Rule 43

Int[((a_.) + (b_.)*(x_))^(m_.)*((c_.) + (d_.)*(x_))^(n_.), x_Symbol] :> Int[ExpandIntegrand[(a + b*x)^m*(c + d
*x)^n, x], x] /; FreeQ[{a, b, c, d, n}, x] && NeQ[b*c - a*d, 0] && IGtQ[m, 0] && ( !IntegerQ[n] || (EqQ[c, 0]
&& LeQ[7*m + 4*n + 4, 0]) || LtQ[9*m + 5*(n + 1), 0] || GtQ[m + n + 2, 0])

Rule 72

Int[((e_.) + (f_.)*(x_))^(p_.)/(((a_.) + (b_.)*(x_))*((c_.) + (d_.)*(x_))), x_Symbol] :> Int[ExpandIntegrand[(
e + f*x)^p/((a + b*x)*(c + d*x)), x], x] /; FreeQ[{a, b, c, d, e, f}, x] && IntegerQ[p]

Rule 514

Int[(x_)^(m_.)*((c_) + (d_.)*(x_)^(mn_.))^(q_.)*((a_) + (b_.)*(x_)^(n_.))^(p_.), x_Symbol] :> Int[x^(m - n*q)*
(a + b*x^n)^p*(d + c*x^n)^q, x] /; FreeQ[{a, b, c, d, m, n, p}, x] && EqQ[mn, -n] && IntegerQ[q] && (PosQ[n] |
|  !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 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 2196

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

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 2463

Int[((a_.) + Log[(c_.)*((d_) + (e_.)*(x_)^(n_))^(p_.)]*(b_.))*((f_.) + (g_.)*(x_))^(r_.), x_Symbol] :> Simp[((
f + g*x)^(r + 1)*(a + b*Log[c*(d + e*x^n)^p]))/(g*(r + 1)), x] - Dist[(b*e*n*p)/(g*(r + 1)), Int[(x^(n - 1)*(f
 + g*x)^(r + 1))/(d + e*x^n), x], x] /; FreeQ[{a, b, c, d, e, f, g, n, p, r}, x] && (IGtQ[r, 0] || RationalQ[n
]) && NeQ[r, -1]

Rule 2554

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 6688

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

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 \left (-\frac {5 e^{-x} x \left (-4+8 \log \left (-1+\frac {4}{x}\right )-6 x \log \left (-1+\frac {4}{x}\right )+x^2 \log \left (-1+\frac {4}{x}\right )\right )}{-4+x}-\frac {2 \left (4+2 x-4 \log \left (-1+\frac {4}{x}\right )-3 x \log \left (-1+\frac {4}{x}\right )+x^2 \log \left (-1+\frac {4}{x}\right )\right )}{-4+x}\right ) \, dx\\ &=-\left (2 \int \frac {4+2 x-4 \log \left (-1+\frac {4}{x}\right )-3 x \log \left (-1+\frac {4}{x}\right )+x^2 \log \left (-1+\frac {4}{x}\right )}{-4+x} \, dx\right )-5 \int \frac {e^{-x} x \left (-4+8 \log \left (-1+\frac {4}{x}\right )-6 x \log \left (-1+\frac {4}{x}\right )+x^2 \log \left (-1+\frac {4}{x}\right )\right )}{-4+x} \, dx\\ &=-\left (2 \int \frac {-2 (2+x)-\left (-4-3 x+x^2\right ) \log \left (-1+\frac {4}{x}\right )}{4-x} \, dx\right )-5 \int \frac {e^{-x} x \left (4-\left (8-6 x+x^2\right ) \log \left (-1+\frac {4}{x}\right )\right )}{4-x} \, dx\\ &=-\left (2 \int \left (\frac {2 (2+x)}{-4+x}+(1+x) \log \left (-1+\frac {4}{x}\right )\right ) \, dx\right )-5 \int \left (-\frac {4 e^{-x} x}{-4+x}+e^{-x} (-2+x) x \log \left (-1+\frac {4}{x}\right )\right ) \, dx\\ &=-\left (2 \int (1+x) \log \left (-1+\frac {4}{x}\right ) \, dx\right )-4 \int \frac {2+x}{-4+x} \, dx-5 \int e^{-x} (-2+x) x \log \left (-1+\frac {4}{x}\right ) \, dx+20 \int \frac {e^{-x} x}{-4+x} \, dx\\ &=5 e^{-x} x^2 \log \left (-1+\frac {4}{x}\right )-(1+x)^2 \log \left (-1+\frac {4}{x}\right )-4 \int \left (1+\frac {6}{-4+x}\right ) \, dx-4 \int \frac {(1+x)^2}{\left (-1+\frac {4}{x}\right ) x^2} \, dx+5 \int \frac {4 e^{-x} x}{4-x} \, dx+20 \int \left (e^{-x}+\frac {4 e^{-x}}{-4+x}\right ) \, dx\\ &=-4 x+5 e^{-x} x^2 \log \left (-1+\frac {4}{x}\right )-(1+x)^2 \log \left (-1+\frac {4}{x}\right )-24 \log (4-x)-4 \int \frac {(1+x)^2}{(4-x) x} \, dx+20 \int e^{-x} \, dx+20 \int \frac {e^{-x} x}{4-x} \, dx+80 \int \frac {e^{-x}}{-4+x} \, dx\\ &=-20 e^{-x}-4 x+\frac {80 \text {Ei}(4-x)}{e^4}+5 e^{-x} x^2 \log \left (-1+\frac {4}{x}\right )-(1+x)^2 \log \left (-1+\frac {4}{x}\right )-24 \log (4-x)-4 \int \left (-1-\frac {25}{4 (-4+x)}+\frac {1}{4 x}\right ) \, dx+20 \int \left (-e^{-x}-\frac {4 e^{-x}}{-4+x}\right ) \, dx\\ &=-20 e^{-x}+\frac {80 \text {Ei}(4-x)}{e^4}+5 e^{-x} x^2 \log \left (-1+\frac {4}{x}\right )-(1+x)^2 \log \left (-1+\frac {4}{x}\right )+\log (4-x)-\log (x)-20 \int e^{-x} \, dx-80 \int \frac {e^{-x}}{-4+x} \, dx\\ &=5 e^{-x} x^2 \log \left (-1+\frac {4}{x}\right )-(1+x)^2 \log \left (-1+\frac {4}{x}\right )+\log (4-x)-\log (x)\\ \end {aligned} \end {gather*}

________________________________________________________________________________________

Mathematica [A]  time = 5.06, size = 23, normalized size = 0.92 \begin {gather*} x \left (-2-x+5 e^{-x} x\right ) \log \left (-1+\frac {4}{x}\right ) \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[(E^x*(-8 - 4*x) + 20*x + (-40*x + 30*x^2 - 5*x^3 + E^x*(8 + 6*x - 2*x^2))*Log[(4 - x)/x])/(E^x*(-4 +
 x)),x]

[Out]

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

________________________________________________________________________________________

fricas [A]  time = 0.67, size = 31, normalized size = 1.24 \begin {gather*} {\left (5 \, x^{2} - {\left (x^{2} + 2 \, x\right )} e^{x}\right )} e^{\left (-x\right )} \log \left (-\frac {x - 4}{x}\right ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((((-2*x^2+6*x+8)*exp(x)-5*x^3+30*x^2-40*x)*log((-x+4)/x)+(-4*x-8)*exp(x)+20*x)/(x-4)/exp(x),x, algor
ithm="fricas")

[Out]

(5*x^2 - (x^2 + 2*x)*e^x)*e^(-x)*log(-(x - 4)/x)

________________________________________________________________________________________

giac [A]  time = 0.25, size = 45, normalized size = 1.80 \begin {gather*} 5 \, x^{2} e^{\left (-x\right )} \log \left (-\frac {x - 4}{x}\right ) - x^{2} \log \left (-\frac {x - 4}{x}\right ) - 2 \, x \log \left (-\frac {x - 4}{x}\right ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((((-2*x^2+6*x+8)*exp(x)-5*x^3+30*x^2-40*x)*log((-x+4)/x)+(-4*x-8)*exp(x)+20*x)/(x-4)/exp(x),x, algor
ithm="giac")

[Out]

5*x^2*e^(-x)*log(-(x - 4)/x) - x^2*log(-(x - 4)/x) - 2*x*log(-(x - 4)/x)

________________________________________________________________________________________

maple [B]  time = 0.25, size = 54, normalized size = 2.16




method result size



norman \(\left (5 x^{2} \ln \left (\frac {-x +4}{x}\right )-2 \,{\mathrm e}^{x} x \ln \left (\frac {-x +4}{x}\right )-{\mathrm e}^{x} x^{2} \ln \left (\frac {-x +4}{x}\right )\right ) {\mathrm e}^{-x}\) \(54\)
default \(-24 \ln \left (\frac {4}{x}\right )+2 \ln \left (-1+\frac {4}{x}\right ) \left (-1+\frac {4}{x}\right ) x +\ln \left (-1+\frac {4}{x}\right ) \left (-1+\frac {4}{x}\right ) \left (\frac {4}{x}+1\right ) x^{2}+5 x^{2} \ln \left (\frac {-x +4}{x}\right ) {\mathrm e}^{-x}-24 \ln \left (x -4\right )\) \(79\)
risch \(-x \left ({\mathrm e}^{x} x -5 x +2 \,{\mathrm e}^{x}\right ) {\mathrm e}^{-x} \ln \left (x -4\right )+\frac {x \left (2 x \,{\mathrm e}^{x} \ln \relax (x )+4 \,{\mathrm e}^{x} \ln \relax (x )-10 x \ln \relax (x )-5 i \pi x \,\mathrm {csgn}\left (\frac {i}{x}\right ) \mathrm {csgn}\left (i \left (x -4\right )\right ) \mathrm {csgn}\left (\frac {i \left (x -4\right )}{x}\right )+2 i \pi \,\mathrm {csgn}\left (\frac {i}{x}\right ) \mathrm {csgn}\left (i \left (x -4\right )\right ) \mathrm {csgn}\left (\frac {i \left (x -4\right )}{x}\right ) {\mathrm e}^{x}-2 i \pi \,\mathrm {csgn}\left (i \left (x -4\right )\right ) \mathrm {csgn}\left (\frac {i \left (x -4\right )}{x}\right )^{2} {\mathrm e}^{x}-2 i \pi \,\mathrm {csgn}\left (\frac {i}{x}\right ) \mathrm {csgn}\left (\frac {i \left (x -4\right )}{x}\right )^{2} {\mathrm e}^{x}-i \pi x \,\mathrm {csgn}\left (i \left (x -4\right )\right ) \mathrm {csgn}\left (\frac {i \left (x -4\right )}{x}\right )^{2} {\mathrm e}^{x}+5 i \pi x \,\mathrm {csgn}\left (i \left (x -4\right )\right ) \mathrm {csgn}\left (\frac {i \left (x -4\right )}{x}\right )^{2}+5 i \pi x \,\mathrm {csgn}\left (\frac {i}{x}\right ) \mathrm {csgn}\left (\frac {i \left (x -4\right )}{x}\right )^{2}+i \pi x \,\mathrm {csgn}\left (\frac {i}{x}\right ) \mathrm {csgn}\left (i \left (x -4\right )\right ) \mathrm {csgn}\left (\frac {i \left (x -4\right )}{x}\right ) {\mathrm e}^{x}+10 i x \pi +2 i \pi x \mathrm {csgn}\left (\frac {i \left (x -4\right )}{x}\right )^{2} {\mathrm e}^{x}-i \pi x \mathrm {csgn}\left (\frac {i \left (x -4\right )}{x}\right )^{3} {\mathrm e}^{x}-2 i \pi x \,{\mathrm e}^{x}-4 i \pi \,{\mathrm e}^{x}+4 i \pi \mathrm {csgn}\left (\frac {i \left (x -4\right )}{x}\right )^{2} {\mathrm e}^{x}-2 i \pi \mathrm {csgn}\left (\frac {i \left (x -4\right )}{x}\right )^{3} {\mathrm e}^{x}+5 i \pi x \mathrm {csgn}\left (\frac {i \left (x -4\right )}{x}\right )^{3}-10 i \pi x \mathrm {csgn}\left (\frac {i \left (x -4\right )}{x}\right )^{2}-i \pi x \,\mathrm {csgn}\left (\frac {i}{x}\right ) \mathrm {csgn}\left (\frac {i \left (x -4\right )}{x}\right )^{2} {\mathrm e}^{x}\right ) {\mathrm e}^{-x}}{2}\) \(417\)



Verification of antiderivative is not currently implemented for this CAS.

[In]

int((((-2*x^2+6*x+8)*exp(x)-5*x^3+30*x^2-40*x)*ln((-x+4)/x)+(-4*x-8)*exp(x)+20*x)/(x-4)/exp(x),x,method=_RETUR
NVERBOSE)

[Out]

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

________________________________________________________________________________________

maxima [B]  time = 0.40, size = 47, normalized size = 1.88 \begin {gather*} -5 \, x^{2} e^{\left (-x\right )} \log \relax (x) + {\left (x^{2} + 2 \, x\right )} \log \relax (x) + {\left (5 \, x^{2} e^{\left (-x\right )} - x^{2} - 2 \, x\right )} \log \left (-x + 4\right ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((((-2*x^2+6*x+8)*exp(x)-5*x^3+30*x^2-40*x)*log((-x+4)/x)+(-4*x-8)*exp(x)+20*x)/(x-4)/exp(x),x, algor
ithm="maxima")

[Out]

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

________________________________________________________________________________________

mupad [F]  time = 0.00, size = -1, normalized size = -0.04 \begin {gather*} \int -\frac {{\mathrm {e}}^{-x}\,\left (\ln \left (-\frac {x-4}{x}\right )\,\left (40\,x-{\mathrm {e}}^x\,\left (-2\,x^2+6\,x+8\right )-30\,x^2+5\,x^3\right )-20\,x+{\mathrm {e}}^x\,\left (4\,x+8\right )\right )}{x-4} \,d x \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(-(exp(-x)*(log(-(x - 4)/x)*(40*x - exp(x)*(6*x - 2*x^2 + 8) - 30*x^2 + 5*x^3) - 20*x + exp(x)*(4*x + 8)))/
(x - 4),x)

[Out]

int(-(exp(-x)*(log(-(x - 4)/x)*(40*x - exp(x)*(6*x - 2*x^2 + 8) - 30*x^2 + 5*x^3) - 20*x + exp(x)*(4*x + 8)))/
(x - 4), x)

________________________________________________________________________________________

sympy [A]  time = 0.49, size = 29, normalized size = 1.16 \begin {gather*} 5 x^{2} e^{- x} \log {\left (\frac {4 - x}{x} \right )} + \left (- x^{2} - 2 x\right ) \log {\left (\frac {4 - x}{x} \right )} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((((-2*x**2+6*x+8)*exp(x)-5*x**3+30*x**2-40*x)*ln((-x+4)/x)+(-4*x-8)*exp(x)+20*x)/(x-4)/exp(x),x)

[Out]

5*x**2*exp(-x)*log((4 - x)/x) + (-x**2 - 2*x)*log((4 - x)/x)

________________________________________________________________________________________