Optimal. Leaf size=34 \[ -5-2 x-x \left (-e^x+\frac {\left (x+\frac {4}{-3+\frac {3}{x}+x}\right )^2}{x}\right ) \]
________________________________________________________________________________________
Rubi [A] time = 0.30, antiderivative size = 55, normalized size of antiderivative = 1.62, number of steps used = 8, number of rules used = 5, integrand size = 103, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.049, Rules used = {6688, 2176, 2194, 1660, 1586} \begin {gather*} -x^2+\frac {8 (1-3 x)}{x^2-3 x+3}+\frac {48 (1-x)}{\left (x^2-3 x+3\right )^2}-2 x-e^x+e^x (x+1) \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 1586
Rule 1660
Rule 2176
Rule 2194
Rule 6688
Rubi steps
\begin {gather*} \begin {aligned} \text {integral} &=\int \left (e^x (1+x)-\frac {2 \left (27+66 x-81 x^2+71 x^3-57 x^4+27 x^5-8 x^6+x^7\right )}{\left (3-3 x+x^2\right )^3}\right ) \, dx\\ &=-\left (2 \int \frac {27+66 x-81 x^2+71 x^3-57 x^4+27 x^5-8 x^6+x^7}{\left (3-3 x+x^2\right )^3} \, dx\right )+\int e^x (1+x) \, dx\\ &=e^x (1+x)+\frac {48 (1-x)}{\left (3-3 x+x^2\right )^2}-\frac {1}{3} \int \frac {198-6 x-90 x^2+54 x^3-30 x^4+6 x^5}{\left (3-3 x+x^2\right )^2} \, dx-\int e^x \, dx\\ &=-e^x+e^x (1+x)+\frac {48 (1-x)}{\left (3-3 x+x^2\right )^2}+\frac {8 (1-3 x)}{3-3 x+x^2}-\frac {1}{9} \int \frac {54-36 x^2+18 x^3}{3-3 x+x^2} \, dx\\ &=-e^x+e^x (1+x)+\frac {48 (1-x)}{\left (3-3 x+x^2\right )^2}+\frac {8 (1-3 x)}{3-3 x+x^2}-\frac {1}{9} \int (18+18 x) \, dx\\ &=-e^x-2 x-x^2+e^x (1+x)+\frac {48 (1-x)}{\left (3-3 x+x^2\right )^2}+\frac {8 (1-3 x)}{3-3 x+x^2}\\ \end {aligned} \end {gather*}
________________________________________________________________________________________
Mathematica [A] time = 0.05, size = 46, normalized size = 1.35 \begin {gather*} -2 x+e^x x-x^2-\frac {48 (-1+x)}{\left (3-3 x+x^2\right )^2}-\frac {8 (-1+3 x)}{3-3 x+x^2} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
fricas [B] time = 0.55, size = 76, normalized size = 2.24 \begin {gather*} -\frac {x^{6} - 4 \, x^{5} + 3 \, x^{4} + 36 \, x^{3} - 107 \, x^{2} - {\left (x^{5} - 6 \, x^{4} + 15 \, x^{3} - 18 \, x^{2} + 9 \, x\right )} e^{x} + 162 \, x - 72}{x^{4} - 6 \, x^{3} + 15 \, x^{2} - 18 \, x + 9} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [B] time = 0.21, size = 83, normalized size = 2.44 \begin {gather*} -\frac {x^{6} - x^{5} e^{x} - 4 \, x^{5} + 6 \, x^{4} e^{x} + 3 \, x^{4} - 15 \, x^{3} e^{x} + 36 \, x^{3} + 18 \, x^{2} e^{x} - 107 \, x^{2} - 9 \, x e^{x} + 162 \, x - 72}{x^{4} - 6 \, x^{3} + 15 \, x^{2} - 18 \, x + 9} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [A] time = 0.18, size = 50, normalized size = 1.47
method | result | size |
risch | \(-x^{2}-2 x +\frac {-24 x^{3}+80 x^{2}-144 x +72}{x^{4}-6 x^{3}+15 x^{2}-18 x +9}+{\mathrm e}^{x} x\) | \(50\) |
norman | \(\frac {x^{5} {\mathrm e}^{x}-54 x -9 x^{4}+17 x^{2}+4 x^{5}-x^{6}+9 \,{\mathrm e}^{x} x -18 \,{\mathrm e}^{x} x^{2}+15 \,{\mathrm e}^{x} x^{3}-6 \,{\mathrm e}^{x} x^{4}+18}{\left (x^{2}-3 x +3\right )^{2}}\) | \(69\) |
default | \(-2 x -\frac {54 \left (6 x^{3}-\frac {75}{2} x^{2}+72 x -54\right )}{\left (x^{2}-3 x +3\right )^{2}}-x^{2}-8 \,{\mathrm e}^{x}-\frac {22 \left (3 x -6\right )}{\left (x^{2}-3 x +3\right )^{2}}-\frac {142 \left (3 x^{3}-14 x^{2}+24 x -\frac {33}{2}\right )}{\left (x^{2}-3 x +3\right )^{2}}+\left (x +8\right ) {\mathrm e}^{x}+\frac {9 \,{\mathrm e}^{x} \left (13 x^{3}-57 x^{2}+96 x -63\right )}{2 \left (x^{4}-6 x^{3}+15 x^{2}-18 x +9\right )}+\frac {270 x^{3}-1215 x^{2}+2106 x -1458}{\left (x^{2}-3 x +3\right )^{2}}-\frac {9 \left (2 x -3\right )}{\left (x^{2}-3 x +3\right )^{2}}-\frac {84 \left (2 x -3\right )}{x^{2}-3 x +3}-\frac {9 \,{\mathrm e}^{x} \left (7 x^{3}-30 x^{2}+51 x -33\right )}{x^{4}-6 x^{3}+15 x^{2}-18 x +9}+\frac {570 x^{3}-2907 x^{2}+5130 x -3591}{\left (x^{2}-3 x +3\right )^{2}}-\frac {18 \left (-3 x^{3}+\frac {15}{2} x^{2}-6 x -\frac {3}{2}\right )}{\left (x^{2}-3 x +3\right )^{2}}+\frac {-432 x^{2}+1152 x -1080}{\left (x^{2}-3 x +3\right )^{2}}+\frac {27 \,{\mathrm e}^{x} \left (8 x^{3}-37 x^{2}+63 x -42\right )}{2 \left (x^{4}-6 x^{3}+15 x^{2}-18 x +9\right )}-\frac {9 \,{\mathrm e}^{x} \left (7 x^{3}-18 x^{2}+15 x +3\right )}{2 \left (x^{4}-6 x^{3}+15 x^{2}-18 x +9\right )}+\frac {81 \,{\mathrm e}^{x} \left (5 x^{3}-31 x^{2}+60 x -45\right )}{2 \left (x^{4}-6 x^{3}+15 x^{2}-18 x +9\right )}-\frac {45 \,{\mathrm e}^{x} \left (13 x^{3}-66 x^{2}+117 x -81\right )}{2 \left (x^{4}-6 x^{3}+15 x^{2}-18 x +9\right )}+\frac {9 \,{\mathrm e}^{x} \left (4 x^{3}-17 x^{2}+29 x -18\right )}{2 \left (x^{4}-6 x^{3}+15 x^{2}-18 x +9\right )}+\frac {36 \,{\mathrm e}^{x} \left (7 x^{2}-19 x +18\right )}{x^{4}-6 x^{3}+15 x^{2}-18 x +9}\) | \(535\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maxima [B] time = 0.47, size = 304, normalized size = 8.94 \begin {gather*} -x^{2} + x e^{x} - 2 \, x + \frac {27 \, {\left (10 \, x^{3} - 45 \, x^{2} + 78 \, x - 54\right )}}{x^{4} - 6 \, x^{3} + 15 \, x^{2} - 18 \, x + 9} + \frac {57 \, {\left (10 \, x^{3} - 51 \, x^{2} + 90 \, x - 63\right )}}{x^{4} - 6 \, x^{3} + 15 \, x^{2} - 18 \, x + 9} - \frac {71 \, {\left (6 \, x^{3} - 28 \, x^{2} + 48 \, x - 33\right )}}{x^{4} - 6 \, x^{3} + 15 \, x^{2} - 18 \, x + 9} - \frac {9 \, {\left (4 \, x^{3} - 18 \, x^{2} + 32 \, x - 21\right )}}{x^{4} - 6 \, x^{3} + 15 \, x^{2} - 18 \, x + 9} - \frac {81 \, {\left (4 \, x^{3} - 25 \, x^{2} + 48 \, x - 36\right )}}{x^{4} - 6 \, x^{3} + 15 \, x^{2} - 18 \, x + 9} + \frac {27 \, {\left (2 \, x^{3} - 5 \, x^{2} + 4 \, x + 1\right )}}{x^{4} - 6 \, x^{3} + 15 \, x^{2} - 18 \, x + 9} - \frac {66 \, {\left (2 \, x^{3} - 9 \, x^{2} + 16 \, x - 11\right )}}{x^{4} - 6 \, x^{3} + 15 \, x^{2} - 18 \, x + 9} - \frac {72 \, {\left (6 \, x^{2} - 16 \, x + 15\right )}}{x^{4} - 6 \, x^{3} + 15 \, x^{2} - 18 \, x + 9} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [B] time = 7.38, size = 50, normalized size = 1.47 \begin {gather*} x\,{\mathrm {e}}^x-2\,x-x^2-\frac {24\,x^3-80\,x^2+144\,x-72}{x^4-6\,x^3+15\,x^2-18\,x+9} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
sympy [A] time = 0.21, size = 44, normalized size = 1.29 \begin {gather*} - x^{2} + x e^{x} - 2 x - \frac {24 x^{3} - 80 x^{2} + 144 x - 72}{x^{4} - 6 x^{3} + 15 x^{2} - 18 x + 9} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________