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]
[Out]
Rule 12
Rule 43
Rule 72
Rule 514
Rule 2176
Rule 2178
Rule 2194
Rule 2196
Rule 2199
Rule 2463
Rule 2554
Rule 6688
Rule 6742
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]
[Out]
________________________________________________________________________________________
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]
[Out]
________________________________________________________________________________________
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]
[Out]
________________________________________________________________________________________
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]
[Out]
________________________________________________________________________________________
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]
[Out]
________________________________________________________________________________________
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]
[Out]
________________________________________________________________________________________
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]
[Out]
________________________________________________________________________________________