Optimal. Leaf size=30 \[ \frac {2 \left (e^x-x\right )^2 (4-\log (16 (3+3 (1-x))))}{x^2} \]
________________________________________________________________________________________
Rubi [A] time = 3.58, antiderivative size = 57, normalized size of antiderivative = 1.90, number of steps used = 37, number of rules used = 8, integrand size = 94, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.085, Rules used = {1593, 6688, 12, 6742, 2178, 2177, 2197, 2554} \begin {gather*} \frac {8 e^{2 x}}{x^2}-\frac {2 e^{2 x} \log (96-48 x)}{x^2}-\frac {16 e^x}{x}+\frac {4 e^x \log (96-48 x)}{x}-2 \log (2-x) \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 12
Rule 1593
Rule 2177
Rule 2178
Rule 2197
Rule 2554
Rule 6688
Rule 6742
Rubi steps
\begin {gather*} \begin {aligned} \text {integral} &=\int \frac {-2 x^3+e^{2 x} \left (32-50 x+16 x^2\right )+e^x \left (-32 x+52 x^2-16 x^3\right )+\left (e^{2 x} \left (-8+12 x-4 x^2\right )+e^x \left (8 x-12 x^2+4 x^3\right )\right ) \log (96-48 x)}{(-2+x) x^3} \, dx\\ &=\int \frac {2 \left (e^x-x\right ) \left (-x^2+e^x \left (-16+25 x-8 x^2\right )+2 e^x \left (2-3 x+x^2\right ) \log (-48 (-2+x))\right )}{(2-x) x^3} \, dx\\ &=2 \int \frac {\left (e^x-x\right ) \left (-x^2+e^x \left (-16+25 x-8 x^2\right )+2 e^x \left (2-3 x+x^2\right ) \log (-48 (-2+x))\right )}{(2-x) x^3} \, dx\\ &=2 \int \left (\frac {1}{2-x}+\frac {2 e^x \left (-8+13 x-4 x^2+2 \log (-48 (-2+x))-3 x \log (-48 (-2+x))+x^2 \log (-48 (-2+x))\right )}{(-2+x) x^2}-\frac {e^{2 x} \left (-16+25 x-8 x^2+4 \log (-48 (-2+x))-6 x \log (-48 (-2+x))+2 x^2 \log (-48 (-2+x))\right )}{(-2+x) x^3}\right ) \, dx\\ &=-2 \log (2-x)-2 \int \frac {e^{2 x} \left (-16+25 x-8 x^2+4 \log (-48 (-2+x))-6 x \log (-48 (-2+x))+2 x^2 \log (-48 (-2+x))\right )}{(-2+x) x^3} \, dx+4 \int \frac {e^x \left (-8+13 x-4 x^2+2 \log (-48 (-2+x))-3 x \log (-48 (-2+x))+x^2 \log (-48 (-2+x))\right )}{(-2+x) x^2} \, dx\\ &=-2 \log (2-x)-2 \int \left (\frac {e^{2 x} \left (-16+25 x-8 x^2\right )}{(-2+x) x^3}+\frac {2 e^{2 x} (-1+x) \log (96-48 x)}{x^3}\right ) \, dx+4 \int \left (\frac {e^x \left (-8+13 x-4 x^2\right )}{(-2+x) x^2}+\frac {e^x (-1+x) \log (96-48 x)}{x^2}\right ) \, dx\\ &=-2 \log (2-x)-2 \int \frac {e^{2 x} \left (-16+25 x-8 x^2\right )}{(-2+x) x^3} \, dx+4 \int \frac {e^x \left (-8+13 x-4 x^2\right )}{(-2+x) x^2} \, dx-4 \int \frac {e^{2 x} (-1+x) \log (96-48 x)}{x^3} \, dx+4 \int \frac {e^x (-1+x) \log (96-48 x)}{x^2} \, dx\\ &=-\frac {2 e^{2 x} \log (96-48 x)}{x^2}+\frac {4 e^x \log (96-48 x)}{x}-2 \log (2-x)-2 \int \left (\frac {e^{2 x}}{4 (-2+x)}+\frac {8 e^{2 x}}{x^3}-\frac {17 e^{2 x}}{2 x^2}-\frac {e^{2 x}}{4 x}\right ) \, dx+4 \int \left (\frac {e^x}{2 (-2+x)}+\frac {4 e^x}{x^2}-\frac {9 e^x}{2 x}\right ) \, dx+4 \int \frac {e^{2 x}}{2 (-2+x) x^2} \, dx-4 \int \frac {e^x}{(-2+x) x} \, dx\\ &=-\frac {2 e^{2 x} \log (96-48 x)}{x^2}+\frac {4 e^x \log (96-48 x)}{x}-2 \log (2-x)-\frac {1}{2} \int \frac {e^{2 x}}{-2+x} \, dx+\frac {1}{2} \int \frac {e^{2 x}}{x} \, dx+2 \int \frac {e^x}{-2+x} \, dx+2 \int \frac {e^{2 x}}{(-2+x) x^2} \, dx-4 \int \left (\frac {e^x}{2 (-2+x)}-\frac {e^x}{2 x}\right ) \, dx-16 \int \frac {e^{2 x}}{x^3} \, dx+16 \int \frac {e^x}{x^2} \, dx+17 \int \frac {e^{2 x}}{x^2} \, dx-18 \int \frac {e^x}{x} \, dx\\ &=\frac {8 e^{2 x}}{x^2}-\frac {16 e^x}{x}-\frac {17 e^{2 x}}{x}-\frac {1}{2} e^4 \text {Ei}(-2 (2-x))+2 e^2 \text {Ei}(-2+x)-18 \text {Ei}(x)+\frac {\text {Ei}(2 x)}{2}-\frac {2 e^{2 x} \log (96-48 x)}{x^2}+\frac {4 e^x \log (96-48 x)}{x}-2 \log (2-x)+2 \int \left (\frac {e^{2 x}}{4 (-2+x)}-\frac {e^{2 x}}{2 x^2}-\frac {e^{2 x}}{4 x}\right ) \, dx-2 \int \frac {e^x}{-2+x} \, dx+2 \int \frac {e^x}{x} \, dx-16 \int \frac {e^{2 x}}{x^2} \, dx+16 \int \frac {e^x}{x} \, dx+34 \int \frac {e^{2 x}}{x} \, dx\\ &=\frac {8 e^{2 x}}{x^2}-\frac {16 e^x}{x}-\frac {e^{2 x}}{x}-\frac {1}{2} e^4 \text {Ei}(-2 (2-x))+\frac {69 \text {Ei}(2 x)}{2}-\frac {2 e^{2 x} \log (96-48 x)}{x^2}+\frac {4 e^x \log (96-48 x)}{x}-2 \log (2-x)+\frac {1}{2} \int \frac {e^{2 x}}{-2+x} \, dx-\frac {1}{2} \int \frac {e^{2 x}}{x} \, dx-32 \int \frac {e^{2 x}}{x} \, dx-\int \frac {e^{2 x}}{x^2} \, dx\\ &=\frac {8 e^{2 x}}{x^2}-\frac {16 e^x}{x}+2 \text {Ei}(2 x)-\frac {2 e^{2 x} \log (96-48 x)}{x^2}+\frac {4 e^x \log (96-48 x)}{x}-2 \log (2-x)-2 \int \frac {e^{2 x}}{x} \, dx\\ &=\frac {8 e^{2 x}}{x^2}-\frac {16 e^x}{x}-\frac {2 e^{2 x} \log (96-48 x)}{x^2}+\frac {4 e^x \log (96-48 x)}{x}-2 \log (2-x)\\ \end {aligned} \end {gather*}
________________________________________________________________________________________
Mathematica [A] time = 1.21, size = 34, normalized size = 1.13 \begin {gather*} 2 \left (-\log (2-x)-\frac {e^x \left (e^x-2 x\right ) (-4+\log (-48 (-2+x)))}{x^2}\right ) \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
fricas [A] time = 0.89, size = 37, normalized size = 1.23 \begin {gather*} -\frac {2 \, {\left (8 \, x e^{x} + {\left (x^{2} - 2 \, x e^{x} + e^{\left (2 \, x\right )}\right )} \log \left (-48 \, x + 96\right ) - 4 \, e^{\left (2 \, x\right )}\right )}}{x^{2}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [B] time = 0.19, size = 47, normalized size = 1.57 \begin {gather*} -\frac {2 \, {\left (x^{2} \log \left (x - 2\right ) - 2 \, x e^{x} \log \left (-48 \, x + 96\right ) + 8 \, x e^{x} + e^{\left (2 \, x\right )} \log \left (-48 \, x + 96\right ) - 4 \, e^{\left (2 \, x\right )}\right )}}{x^{2}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [B] time = 0.22, size = 48, normalized size = 1.60
method | result | size |
risch | \(\frac {2 \,{\mathrm e}^{x} \left (2 x -{\mathrm e}^{x}\right ) \ln \left (-48 x +96\right )}{x^{2}}-\frac {2 \left (x^{2} \ln \left (x -2\right )+8 \,{\mathrm e}^{x} x -4 \,{\mathrm e}^{2 x}\right )}{x^{2}}\) | \(48\) |
default | \(\frac {\left (4 \ln \left (48\right )-16\right ) {\mathrm e}^{x}+4 \ln \left (2-x \right ) {\mathrm e}^{x}}{x}+\frac {\left (-2 \ln \left (48\right )+8\right ) {\mathrm e}^{2 x}-2 \,{\mathrm e}^{2 x} \ln \left (2-x \right )}{x^{2}}-2 \ln \left (x -2\right )\) | \(60\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maxima [C] time = 0.48, size = 63, normalized size = 2.10 \begin {gather*} \frac {2 \, {\left (2 \, {\left (i \, \pi + \log \relax (3) + 4 \, \log \relax (2) - 4\right )} x e^{x} - {\left (i \, \pi + \log \relax (3) + 4 \, \log \relax (2) - 4\right )} e^{\left (2 \, x\right )} + {\left (2 \, x e^{x} - e^{\left (2 \, x\right )}\right )} \log \left (x - 2\right )\right )}}{x^{2}} - 2 \, \log \left (x - 2\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.03 \begin {gather*} \int \frac {\ln \left (96-48\,x\right )\,\left ({\mathrm {e}}^{2\,x}\,\left (4\,x^2-12\,x+8\right )-{\mathrm {e}}^x\,\left (4\,x^3-12\,x^2+8\,x\right )\right )-{\mathrm {e}}^{2\,x}\,\left (16\,x^2-50\,x+32\right )+2\,x^3+{\mathrm {e}}^x\,\left (16\,x^3-52\,x^2+32\,x\right )}{2\,x^3-x^4} \,d x \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
sympy [B] time = 0.44, size = 48, normalized size = 1.60 \begin {gather*} - 2 \log {\left (x - 2 \right )} + \frac {\left (- 2 x \log {\left (96 - 48 x \right )} + 8 x\right ) e^{2 x} + \left (4 x^{2} \log {\left (96 - 48 x \right )} - 16 x^{2}\right ) e^{x}}{x^{3}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________