Optimal. Leaf size=29 \[ x+\frac {x}{(4+x)^2}+\frac {1}{3} \left (e^x+x\right )^2 \left (\frac {3}{x}+x^2\right ) \]
________________________________________________________________________________________
Rubi [B] time = 2.15, antiderivative size = 59, normalized size of antiderivative = 2.03, number of steps used = 25, number of rules used = 9, integrand size = 141, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.064, Rules used = {6688, 12, 2196, 2194, 2176, 2199, 2177, 2178, 1850} \begin {gather*} \frac {x^4}{3}+\frac {2 e^x x^3}{3}+\frac {1}{3} e^{2 x} x^2+2 x+2 e^x+\frac {1}{x+4}-\frac {4}{(x+4)^2}+\frac {e^{2 x}}{x} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 12
Rule 1850
Rule 2176
Rule 2177
Rule 2178
Rule 2194
Rule 2196
Rule 2199
Rule 6688
Rubi steps
\begin {gather*} \begin {aligned} \text {integral} &=\int \frac {1}{3} \left (2 e^x \left (3+3 x^2+x^3\right )+\frac {e^{2 x} \left (-3+6 x+2 x^3+2 x^4\right )}{x^2}+\frac {396+285 x+72 x^2+262 x^3+192 x^4+48 x^5+4 x^6}{(4+x)^3}\right ) \, dx\\ &=\frac {1}{3} \int \left (2 e^x \left (3+3 x^2+x^3\right )+\frac {e^{2 x} \left (-3+6 x+2 x^3+2 x^4\right )}{x^2}+\frac {396+285 x+72 x^2+262 x^3+192 x^4+48 x^5+4 x^6}{(4+x)^3}\right ) \, dx\\ &=\frac {1}{3} \int \frac {e^{2 x} \left (-3+6 x+2 x^3+2 x^4\right )}{x^2} \, dx+\frac {1}{3} \int \frac {396+285 x+72 x^2+262 x^3+192 x^4+48 x^5+4 x^6}{(4+x)^3} \, dx+\frac {2}{3} \int e^x \left (3+3 x^2+x^3\right ) \, dx\\ &=\frac {1}{3} \int \left (-\frac {3 e^{2 x}}{x^2}+\frac {6 e^{2 x}}{x}+2 e^{2 x} x+2 e^{2 x} x^2\right ) \, dx+\frac {1}{3} \int \left (6+4 x^3+\frac {24}{(4+x)^3}-\frac {3}{(4+x)^2}\right ) \, dx+\frac {2}{3} \int \left (3 e^x+3 e^x x^2+e^x x^3\right ) \, dx\\ &=2 x+\frac {x^4}{3}-\frac {4}{(4+x)^2}+\frac {1}{4+x}+\frac {2}{3} \int e^{2 x} x \, dx+\frac {2}{3} \int e^{2 x} x^2 \, dx+\frac {2}{3} \int e^x x^3 \, dx+2 \int e^x \, dx+2 \int \frac {e^{2 x}}{x} \, dx+2 \int e^x x^2 \, dx-\int \frac {e^{2 x}}{x^2} \, dx\\ &=2 e^x+\frac {e^{2 x}}{x}+2 x+\frac {1}{3} e^{2 x} x+2 e^x x^2+\frac {1}{3} e^{2 x} x^2+\frac {2 e^x x^3}{3}+\frac {x^4}{3}-\frac {4}{(4+x)^2}+\frac {1}{4+x}+2 \text {Ei}(2 x)-\frac {1}{3} \int e^{2 x} \, dx-\frac {2}{3} \int e^{2 x} x \, dx-2 \int \frac {e^{2 x}}{x} \, dx-2 \int e^x x^2 \, dx-4 \int e^x x \, dx\\ &=2 e^x-\frac {e^{2 x}}{6}+\frac {e^{2 x}}{x}+2 x-4 e^x x+\frac {1}{3} e^{2 x} x^2+\frac {2 e^x x^3}{3}+\frac {x^4}{3}-\frac {4}{(4+x)^2}+\frac {1}{4+x}+\frac {1}{3} \int e^{2 x} \, dx+4 \int e^x \, dx+4 \int e^x x \, dx\\ &=6 e^x+\frac {e^{2 x}}{x}+2 x+\frac {1}{3} e^{2 x} x^2+\frac {2 e^x x^3}{3}+\frac {x^4}{3}-\frac {4}{(4+x)^2}+\frac {1}{4+x}-4 \int e^x \, dx\\ &=2 e^x+\frac {e^{2 x}}{x}+2 x+\frac {1}{3} e^{2 x} x^2+\frac {2 e^x x^3}{3}+\frac {x^4}{3}-\frac {4}{(4+x)^2}+\frac {1}{4+x}\\ \end {aligned} \end {gather*}
________________________________________________________________________________________
Mathematica [A] time = 0.06, size = 50, normalized size = 1.72 \begin {gather*} \frac {1}{3} \left (-232+6 x+x^4-\frac {12}{(4+x)^2}+\frac {3}{4+x}+2 e^x \left (3+x^3\right )+\frac {e^{2 x} \left (3+x^3\right )}{x}\right ) \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
fricas [B] time = 0.75, size = 104, normalized size = 3.59 \begin {gather*} \frac {x^{7} + 8 \, x^{6} + 16 \, x^{5} + 6 \, x^{4} + 48 \, x^{3} + 99 \, x^{2} + {\left (x^{5} + 8 \, x^{4} + 16 \, x^{3} + 3 \, x^{2} + 24 \, x + 48\right )} e^{\left (2 \, x\right )} + 2 \, {\left (x^{6} + 8 \, x^{5} + 16 \, x^{4} + 3 \, x^{3} + 24 \, x^{2} + 48 \, x\right )} e^{x}}{3 \, {\left (x^{3} + 8 \, x^{2} + 16 \, x\right )}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [B] time = 0.19, size = 133, normalized size = 4.59 \begin {gather*} \frac {x^{7} + 2 \, x^{6} e^{x} + 8 \, x^{6} + x^{5} e^{\left (2 \, x\right )} + 16 \, x^{5} e^{x} + 16 \, x^{5} + 8 \, x^{4} e^{\left (2 \, x\right )} + 32 \, x^{4} e^{x} + 6 \, x^{4} + 16 \, x^{3} e^{\left (2 \, x\right )} + 6 \, x^{3} e^{x} + 48 \, x^{3} + 3 \, x^{2} e^{\left (2 \, x\right )} + 48 \, x^{2} e^{x} + 99 \, x^{2} + 24 \, x e^{\left (2 \, x\right )} + 96 \, x e^{x} + 48 \, e^{\left (2 \, x\right )}}{3 \, {\left (x^{3} + 8 \, x^{2} + 16 \, x\right )}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [A] time = 0.10, size = 46, normalized size = 1.59
method | result | size |
risch | \(\frac {x^{4}}{3}+2 x +\frac {x}{x^{2}+8 x +16}+\frac {\left (x^{3}+3\right ) {\mathrm e}^{2 x}}{3 x}+\left (2+\frac {2 x^{3}}{3}\right ) {\mathrm e}^{x}\) | \(46\) |
default | \(-\frac {4}{\left (4+x \right )^{2}}+\frac {1}{4+x}+2 x +\frac {x^{4}}{3}+\frac {{\mathrm e}^{2 x}}{x}+2 \,{\mathrm e}^{x}+\frac {2 \,{\mathrm e}^{x} x^{3}}{3}+\frac {{\mathrm e}^{2 x} x^{2}}{3}\) | \(50\) |
norman | \(\frac {-256 x -95 x^{2}+{\mathrm e}^{2 x} x^{2}+2 x^{4}+\frac {16 x^{5}}{3}+\frac {8 x^{6}}{3}+\frac {x^{7}}{3}+16 \,{\mathrm e}^{2 x}+8 x \,{\mathrm e}^{2 x}+\frac {16 x^{5} {\mathrm e}^{x}}{3}+\frac {x^{5} {\mathrm e}^{2 x}}{3}+\frac {2 x^{6} {\mathrm e}^{x}}{3}+32 \,{\mathrm e}^{x} x +16 \,{\mathrm e}^{x} x^{2}+2 \,{\mathrm e}^{x} x^{3}+\frac {32 \,{\mathrm e}^{x} x^{4}}{3}+\frac {16 \,{\mathrm e}^{2 x} x^{3}}{3}+\frac {8 \,{\mathrm e}^{2 x} x^{4}}{3}}{\left (4+x \right )^{2} x}\) | \(127\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maxima [F] time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \frac {1}{3} \, x^{4} + 2 \, x + \frac {{\left (x^{6} + 12 \, x^{5} + 48 \, x^{4} + 67 \, x^{3} + 36 \, x^{2} + 144 \, x + 192\right )} e^{\left (2 \, x\right )} + 2 \, {\left (x^{7} + 12 \, x^{6} + 48 \, x^{5} + 67 \, x^{4} + 36 \, x^{3} + 144 \, x^{2}\right )} e^{x}}{3 \, {\left (x^{4} + 12 \, x^{3} + 48 \, x^{2} + 64 \, x\right )}} - \frac {4096 \, {\left (5 \, x + 18\right )}}{x^{2} + 8 \, x + 16} + \frac {8192 \, {\left (3 \, x + 11\right )}}{3 \, {\left (x^{2} + 8 \, x + 16\right )}} - \frac {4192 \, {\left (3 \, x + 10\right )}}{3 \, {\left (x^{2} + 8 \, x + 16\right )}} + \frac {8192 \, {\left (2 \, x + 7\right )}}{x^{2} + 8 \, x + 16} + \frac {192 \, {\left (x + 3\right )}}{x^{2} + 8 \, x + 16} - \frac {95 \, {\left (x + 2\right )}}{x^{2} + 8 \, x + 16} - \frac {128 \, e^{\left (-4\right )} E_{3}\left (-x - 4\right )}{{\left (x + 4\right )}^{2}} - \frac {66}{x^{2} + 8 \, x + 16} - 384 \, \int \frac {e^{x}}{x^{4} + 16 \, x^{3} + 96 \, x^{2} + 256 \, x + 256}\,{d x} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [B] time = 1.04, size = 72, normalized size = 2.48 \begin {gather*} 2\,x+2\,{\mathrm {e}}^x+\frac {2\,x^3\,{\mathrm {e}}^x}{3}+\frac {x^2\,{\mathrm {e}}^{2\,x}}{3}+\frac {48\,{\mathrm {e}}^{2\,x}+24\,x\,{\mathrm {e}}^{2\,x}+x^2\,\left (3\,{\mathrm {e}}^{2\,x}+3\right )}{3\,x^3+24\,x^2+48\,x}+\frac {x^4}{3} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
sympy [A] time = 0.22, size = 44, normalized size = 1.52 \begin {gather*} \frac {x^{4}}{3} + 2 x + \frac {x}{x^{2} + 8 x + 16} + \frac {\left (3 x^{3} + 9\right ) e^{2 x} + \left (6 x^{4} + 18 x\right ) e^{x}}{9 x} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________