Optimal. Leaf size=25 \[ x^2 \left (1+x-\frac {1}{4} e^{-x} \left (\frac {1}{-1+e^x}+x\right )\right ) \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 1.35, antiderivative size = 47, normalized size of antiderivative = 1.88, number of steps
used = 56, number of rules used = 17, integrand size = 86, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.198, Rules used = {6873, 12,
6874, 2286, 2207, 2225, 2215, 2221, 2317, 2438, 2611, 2320, 6724, 2216, 2222, 2227, 45}
\begin {gather*} -\frac {1}{4} e^{-x} x^3+x^3+\frac {1}{4} e^{-x} x^2+\frac {x^2}{4 \left (1-e^x\right )}+x^2 \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 12
Rule 45
Rule 2207
Rule 2215
Rule 2216
Rule 2221
Rule 2222
Rule 2225
Rule 2227
Rule 2286
Rule 2317
Rule 2320
Rule 2438
Rule 2611
Rule 6724
Rule 6873
Rule 6874
Rubi steps
\begin {gather*} \begin {aligned} \text {integral} &=\int \frac {e^{-x} \left (2 x-4 x^2+x^3+e^{3 x} \left (8 x+12 x^2\right )+e^x \left (6 x+20 x^2-2 x^3\right )+e^{2 x} \left (-16 x-27 x^2+x^3\right )\right )}{4 \left (1-e^x\right )^2} \, dx\\ &=\frac {1}{4} \int \frac {e^{-x} \left (2 x-4 x^2+x^3+e^{3 x} \left (8 x+12 x^2\right )+e^x \left (6 x+20 x^2-2 x^3\right )+e^{2 x} \left (-16 x-27 x^2+x^3\right )\right )}{\left (1-e^x\right )^2} \, dx\\ &=\frac {1}{4} \int \left (\frac {2 e^{-x} (-1+x) x}{-1+e^x}+\frac {e^{-x} x^2}{\left (-1+e^x\right )^2}+e^{-x} (-3+x) x^2+4 x (2+3 x)\right ) \, dx\\ &=\frac {1}{4} \int \frac {e^{-x} x^2}{\left (-1+e^x\right )^2} \, dx+\frac {1}{4} \int e^{-x} (-3+x) x^2 \, dx+\frac {1}{2} \int \frac {e^{-x} (-1+x) x}{-1+e^x} \, dx+\int x (2+3 x) \, dx\\ &=\frac {1}{4} \int \left (e^{-x} x^2+\frac {x^2}{1-e^x}+\frac {x^2}{\left (-1+e^x\right )^2}\right ) \, dx+\frac {1}{4} \int \left (-3 e^{-x} x^2+e^{-x} x^3\right ) \, dx+\frac {1}{2} \int \left (-\frac {e^{-x} x}{-1+e^x}+\frac {e^{-x} x^2}{-1+e^x}\right ) \, dx+\int \left (2 x+3 x^2\right ) \, dx\\ &=x^2+x^3+\frac {1}{4} \int e^{-x} x^2 \, dx+\frac {1}{4} \int \frac {x^2}{1-e^x} \, dx+\frac {1}{4} \int \frac {x^2}{\left (-1+e^x\right )^2} \, dx+\frac {1}{4} \int e^{-x} x^3 \, dx-\frac {1}{2} \int \frac {e^{-x} x}{-1+e^x} \, dx+\frac {1}{2} \int \frac {e^{-x} x^2}{-1+e^x} \, dx-\frac {3}{4} \int e^{-x} x^2 \, dx\\ &=x^2+\frac {1}{2} e^{-x} x^2+\frac {13 x^3}{12}-\frac {1}{4} e^{-x} x^3+\frac {1}{4} \int \frac {e^x x^2}{1-e^x} \, dx+\frac {1}{4} \int \frac {e^x x^2}{\left (-1+e^x\right )^2} \, dx-\frac {1}{4} \int \frac {x^2}{-1+e^x} \, dx+\frac {1}{2} \int e^{-x} x \, dx-\frac {1}{2} \int \left (-e^{-x} x+\frac {x}{-1+e^x}\right ) \, dx+\frac {1}{2} \int \left (-e^{-x} x^2+\frac {x^2}{-1+e^x}\right ) \, dx+\frac {3}{4} \int e^{-x} x^2 \, dx-\frac {3}{2} \int e^{-x} x \, dx\\ &=e^{-x} x+x^2-\frac {1}{4} e^{-x} x^2+\frac {x^2}{4 \left (1-e^x\right )}+\frac {7 x^3}{6}-\frac {1}{4} e^{-x} x^3-\frac {1}{4} x^2 \log \left (1-e^x\right )-\frac {1}{4} \int \frac {e^x x^2}{-1+e^x} \, dx+\frac {1}{2} \int e^{-x} \, dx+\frac {1}{2} \int e^{-x} x \, dx-\frac {1}{2} \int e^{-x} x^2 \, dx+\frac {1}{2} \int \frac {x^2}{-1+e^x} \, dx+\frac {1}{2} \int x \log \left (1-e^x\right ) \, dx-\frac {3}{2} \int e^{-x} \, dx+\frac {3}{2} \int e^{-x} x \, dx\\ &=e^{-x}-e^{-x} x+x^2+\frac {1}{4} e^{-x} x^2+\frac {x^2}{4 \left (1-e^x\right )}+x^3-\frac {1}{4} e^{-x} x^3-\frac {1}{2} x^2 \log \left (1-e^x\right )-\frac {x \text {Li}_2\left (e^x\right )}{2}+\frac {1}{2} \int e^{-x} \, dx+\frac {1}{2} \int \frac {e^x x^2}{-1+e^x} \, dx+\frac {1}{2} \int x \log \left (1-e^x\right ) \, dx+\frac {1}{2} \int \text {Li}_2\left (e^x\right ) \, dx+\frac {3}{2} \int e^{-x} \, dx-\int e^{-x} x \, dx\\ &=-e^{-x}+x^2+\frac {1}{4} e^{-x} x^2+\frac {x^2}{4 \left (1-e^x\right )}+x^3-\frac {1}{4} e^{-x} x^3-x \text {Li}_2\left (e^x\right )+\frac {1}{2} \int \text {Li}_2\left (e^x\right ) \, dx+\frac {1}{2} \text {Subst}\left (\int \frac {\text {Li}_2(x)}{x} \, dx,x,e^x\right )-\int e^{-x} \, dx-\int x \log \left (1-e^x\right ) \, dx\\ &=x^2+\frac {1}{4} e^{-x} x^2+\frac {x^2}{4 \left (1-e^x\right )}+x^3-\frac {1}{4} e^{-x} x^3+\frac {\text {Li}_3\left (e^x\right )}{2}+\frac {1}{2} \text {Subst}\left (\int \frac {\text {Li}_2(x)}{x} \, dx,x,e^x\right )-\int \text {Li}_2\left (e^x\right ) \, dx\\ &=x^2+\frac {1}{4} e^{-x} x^2+\frac {x^2}{4 \left (1-e^x\right )}+x^3-\frac {1}{4} e^{-x} x^3+\text {Li}_3\left (e^x\right )-\text {Subst}\left (\int \frac {\text {Li}_2(x)}{x} \, dx,x,e^x\right )\\ &=x^2+\frac {1}{4} e^{-x} x^2+\frac {x^2}{4 \left (1-e^x\right )}+x^3-\frac {1}{4} e^{-x} x^3\\ \end {aligned} \end {gather*}
________________________________________________________________________________________
Mathematica [A]
time = 2.11, size = 31, normalized size = 1.24 \begin {gather*} \frac {1}{4} x^2 \left (5+\frac {1}{-1+e^{-x}}-e^{-x} (-1+x)+4 x\right ) \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.25, size = 35, normalized size = 1.40
method | result | size |
risch | \(x^{3}+x^{2}+\left (\frac {1}{4} x^{2}-\frac {1}{4} x^{3}\right ) {\mathrm e}^{-x}-\frac {x^{2}}{4 \left ({\mathrm e}^{x}-1\right )}\) | \(35\) |
norman | \(\frac {\left ({\mathrm e}^{2 x} x^{2}+{\mathrm e}^{2 x} x^{3}-\frac {x^{2}}{4}+\frac {x^{3}}{4}-{\mathrm e}^{x} x^{2}-\frac {5 \,{\mathrm e}^{x} x^{3}}{4}\right ) {\mathrm e}^{-x}}{{\mathrm e}^{x}-1}\) | \(53\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A]
time = 0.30, size = 30, normalized size = 1.20 \begin {gather*} -\frac {5 \, x^{3} + 4 \, x^{2} - 4 \, {\left (x^{3} + x^{2}\right )} e^{x}}{4 \, {\left (e^{x} - 1\right )}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [B] Leaf count of result is larger than twice the leaf count of optimal. 50 vs.
\(2 (23) = 46\).
time = 0.34, size = 50, normalized size = 2.00 \begin {gather*} \frac {x^{3} - x^{2} + 4 \, {\left (x^{3} + x^{2}\right )} e^{\left (2 \, x\right )} - {\left (5 \, x^{3} + 4 \, x^{2}\right )} e^{x}}{4 \, {\left (e^{\left (2 \, x\right )} - e^{x}\right )}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [A]
time = 0.06, size = 27, normalized size = 1.08 \begin {gather*} x^{3} + x^{2} - \frac {x^{2}}{4 e^{x} - 4} + \frac {\left (- x^{3} + x^{2}\right ) e^{- x}}{4} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [B] Leaf count of result is larger than twice the leaf count of optimal. 54 vs.
\(2 (23) = 46\).
time = 0.40, size = 54, normalized size = 2.16 \begin {gather*} \frac {4 \, x^{3} e^{\left (2 \, x\right )} - 5 \, x^{3} e^{x} + x^{3} + 4 \, x^{2} e^{\left (2 \, x\right )} - 4 \, x^{2} e^{x} - x^{2}}{4 \, {\left (e^{\left (2 \, x\right )} - e^{x}\right )}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 1.53, size = 56, normalized size = 2.24 \begin {gather*} -\frac {4\,x^2\,{\mathrm {e}}^x+5\,x^3\,{\mathrm {e}}^x-4\,x^2\,{\mathrm {e}}^{2\,x}-4\,x^3\,{\mathrm {e}}^{2\,x}+x^2-x^3}{4\,{\mathrm {e}}^{2\,x}-4\,{\mathrm {e}}^x} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________