Optimal. Leaf size=30 \[ e^x+\frac {1}{x}-x^2 \left (x+\frac {2 x^2}{2 x+x^2}\right )^2 \]
________________________________________________________________________________________
Rubi [A] time = 0.76, antiderivative size = 48, normalized size of antiderivative = 1.60, number of steps used = 17, number of rules used = 6, integrand size = 80, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.075, Rules used = {6741, 6742, 2194, 44, 37, 43} \begin {gather*} -x^4-4 x^3-\frac {x^2}{4 (x+2)^2}+4 x^2+e^x+\frac {63}{x+2}-\frac {63}{(x+2)^2}+\frac {1}{x} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 37
Rule 43
Rule 44
Rule 2194
Rule 6741
Rule 6742
Rubi steps
\begin {gather*} \begin {aligned} \text {integral} &=\int \frac {-8-12 x-6 x^2-x^3-128 x^5-112 x^6-36 x^7-4 x^8+e^x \left (8 x^2+12 x^3+6 x^4+x^5\right )}{x^2 (2+x)^3} \, dx\\ &=\int \left (e^x-\frac {6}{(2+x)^3}-\frac {8}{x^2 (2+x)^3}-\frac {12}{x (2+x)^3}-\frac {x}{(2+x)^3}-\frac {128 x^3}{(2+x)^3}-\frac {112 x^4}{(2+x)^3}-\frac {36 x^5}{(2+x)^3}-\frac {4 x^6}{(2+x)^3}\right ) \, dx\\ &=\frac {3}{(2+x)^2}-4 \int \frac {x^6}{(2+x)^3} \, dx-8 \int \frac {1}{x^2 (2+x)^3} \, dx-12 \int \frac {1}{x (2+x)^3} \, dx-36 \int \frac {x^5}{(2+x)^3} \, dx-112 \int \frac {x^4}{(2+x)^3} \, dx-128 \int \frac {x^3}{(2+x)^3} \, dx+\int e^x \, dx-\int \frac {x}{(2+x)^3} \, dx\\ &=e^x+\frac {3}{(2+x)^2}-\frac {x^2}{4 (2+x)^2}-4 \int \left (-80+24 x-6 x^2+x^3+\frac {64}{(2+x)^3}-\frac {192}{(2+x)^2}+\frac {240}{2+x}\right ) \, dx-8 \int \left (\frac {1}{8 x^2}-\frac {3}{16 x}+\frac {1}{4 (2+x)^3}+\frac {1}{4 (2+x)^2}+\frac {3}{16 (2+x)}\right ) \, dx-12 \int \left (\frac {1}{8 x}-\frac {1}{2 (2+x)^3}-\frac {1}{4 (2+x)^2}-\frac {1}{8 (2+x)}\right ) \, dx-36 \int \left (24-6 x+x^2-\frac {32}{(2+x)^3}+\frac {80}{(2+x)^2}-\frac {80}{2+x}\right ) \, dx-112 \int \left (-6+x+\frac {16}{(2+x)^3}-\frac {32}{(2+x)^2}+\frac {24}{2+x}\right ) \, dx-128 \int \left (1-\frac {8}{(2+x)^3}+\frac {12}{(2+x)^2}-\frac {6}{2+x}\right ) \, dx\\ &=e^x+\frac {1}{x}+4 x^2-4 x^3-x^4-\frac {63}{(2+x)^2}-\frac {x^2}{4 (2+x)^2}+\frac {63}{2+x}\\ \end {aligned} \end {gather*}
________________________________________________________________________________________
Mathematica [A] time = 0.25, size = 48, normalized size = 1.60 \begin {gather*} e^x+\frac {1}{x}+4 x^2-4 x^3-x^4-\frac {63}{(2+x)^2}-\frac {x^2}{4 (2+x)^2}+\frac {63}{2+x} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
fricas [B] time = 1.25, size = 60, normalized size = 2.00 \begin {gather*} -\frac {x^{7} + 8 \, x^{6} + 16 \, x^{5} - 16 \, x^{3} - 65 \, x^{2} - {\left (x^{3} + 4 \, x^{2} + 4 \, x\right )} e^{x} - 68 \, x - 4}{x^{3} + 4 \, x^{2} + 4 \, x} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [B] time = 0.14, size = 63, normalized size = 2.10 \begin {gather*} -\frac {x^{7} + 8 \, x^{6} + 16 \, x^{5} - x^{3} e^{x} - 16 \, x^{3} - 4 \, x^{2} e^{x} - 65 \, x^{2} - 4 \, x e^{x} - 68 \, x - 4}{x^{3} + 4 \, x^{2} + 4 \, x} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [A] time = 0.07, size = 36, normalized size = 1.20
method | result | size |
default | \({\mathrm e}^{x}+\frac {1}{x}-\frac {64}{\left (2+x \right )^{2}}+\frac {64}{2+x}+4 x^{2}-4 x^{3}-x^{4}\) | \(36\) |
risch | \(-x^{4}-4 x^{3}+4 x^{2}+\frac {65 x^{2}+68 x +4}{x \left (x^{2}+4 x +4\right )}+{\mathrm e}^{x}\) | \(43\) |
norman | \(\frac {4+x^{2}+4 x +{\mathrm e}^{x} x^{3}-16 x^{5}-8 x^{6}-x^{7}+4 \,{\mathrm e}^{x} x +4 \,{\mathrm e}^{x} x^{2}}{x \left (2+x \right )^{2}}\) | \(51\) |
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*} -x^{4} - 4 \, x^{3} + 4 \, x^{2} + \frac {{\left (x^{3} + 6 \, x^{2}\right )} e^{x}}{x^{3} + 6 \, x^{2} + 12 \, x + 8} + \frac {3 \, x^{2} + 9 \, x + 4}{x^{3} + 4 \, x^{2} + 4 \, x} - \frac {128 \, {\left (6 \, x + 11\right )}}{x^{2} + 4 \, x + 4} + \frac {576 \, {\left (5 \, x + 9\right )}}{x^{2} + 4 \, x + 4} - \frac {896 \, {\left (4 \, x + 7\right )}}{x^{2} + 4 \, x + 4} + \frac {512 \, {\left (3 \, x + 5\right )}}{x^{2} + 4 \, x + 4} - \frac {3 \, {\left (x + 3\right )}}{x^{2} + 4 \, x + 4} + \frac {x + 1}{x^{2} + 4 \, x + 4} + \frac {12 \, e^{x}}{x^{2} + 4 \, x + 4} - \frac {8 \, e^{\left (-2\right )} E_{3}\left (-x - 2\right )}{{\left (x + 2\right )}^{2}} + \frac {3}{x^{2} + 4 \, x + 4} - 24 \, \int \frac {x e^{x}}{x^{4} + 8 \, x^{3} + 24 \, x^{2} + 32 \, x + 16}\,{d x} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [B] time = 5.74, size = 37, normalized size = 1.23 \begin {gather*} {\mathrm {e}}^x+4\,x^2-4\,x^3-x^4+\frac {65\,x^2+68\,x+4}{x\,{\left (x+2\right )}^2} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
sympy [A] time = 0.17, size = 39, normalized size = 1.30 \begin {gather*} - x^{4} - 4 x^{3} + 4 x^{2} - \frac {- 65 x^{2} - 68 x - 4}{x^{3} + 4 x^{2} + 4 x} + e^{x} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________