Optimal. Leaf size=32 \[ x+\frac {2 e^{-2-x}-x^2}{x \left (x+x^2\right )^2}-\log (5) \]
[Out]
________________________________________________________________________________________
Rubi [B] Leaf count is larger than twice the leaf count of optimal. \(81\) vs. \(2(32)=64\).
time = 1.34, antiderivative size = 81, normalized size of antiderivative = 2.53, number of steps
used = 48, number of rules used = 5, integrand size = 68, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.074, Rules used = {6873, 6874,
2208, 2209, 1634} \begin {gather*} \frac {2 e^{-x-2}}{x^3}-\frac {4 e^{-x-2}}{x^2}+x-\frac {6 e^{-x-2}}{x+1}+\frac {1}{x+1}-\frac {2 e^{-x-2}}{(x+1)^2}+\frac {1}{(x+1)^2}+\frac {6 e^{-x-2}}{x}-\frac {1}{x} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 1634
Rule 2208
Rule 2209
Rule 6873
Rule 6874
Rubi steps
\begin {gather*} \begin {aligned} \text {integral} &=\int \frac {e^{-2-x} \left (-6-12 x-2 x^2+e^{2+x} \left (x^2+3 x^3+x^4+3 x^5+3 x^6+x^7\right )\right )}{x^4 (1+x)^3} \, dx\\ &=\int \left (-\frac {6 e^{-2-x}}{x^4 (1+x)^3}-\frac {12 e^{-2-x}}{x^3 (1+x)^3}-\frac {2 e^{-2-x}}{x^2 (1+x)^3}+\frac {1+3 x+x^2+3 x^3+3 x^4+x^5}{x^2 (1+x)^3}\right ) \, dx\\ &=-\left (2 \int \frac {e^{-2-x}}{x^2 (1+x)^3} \, dx\right )-6 \int \frac {e^{-2-x}}{x^4 (1+x)^3} \, dx-12 \int \frac {e^{-2-x}}{x^3 (1+x)^3} \, dx+\int \frac {1+3 x+x^2+3 x^3+3 x^4+x^5}{x^2 (1+x)^3} \, dx\\ &=-\left (2 \int \left (\frac {e^{-2-x}}{x^2}-\frac {3 e^{-2-x}}{x}+\frac {e^{-2-x}}{(1+x)^3}+\frac {2 e^{-2-x}}{(1+x)^2}+\frac {3 e^{-2-x}}{1+x}\right ) \, dx\right )-6 \int \left (\frac {e^{-2-x}}{x^4}-\frac {3 e^{-2-x}}{x^3}+\frac {6 e^{-2-x}}{x^2}-\frac {10 e^{-2-x}}{x}+\frac {e^{-2-x}}{(1+x)^3}+\frac {4 e^{-2-x}}{(1+x)^2}+\frac {10 e^{-2-x}}{1+x}\right ) \, dx-12 \int \left (\frac {e^{-2-x}}{x^3}-\frac {3 e^{-2-x}}{x^2}+\frac {6 e^{-2-x}}{x}-\frac {e^{-2-x}}{(1+x)^3}-\frac {3 e^{-2-x}}{(1+x)^2}-\frac {6 e^{-2-x}}{1+x}\right ) \, dx+\int \left (1+\frac {1}{x^2}-\frac {2}{(1+x)^3}-\frac {1}{(1+x)^2}\right ) \, dx\\ &=-\frac {1}{x}+x+\frac {1}{(1+x)^2}+\frac {1}{1+x}-2 \int \frac {e^{-2-x}}{x^2} \, dx-2 \int \frac {e^{-2-x}}{(1+x)^3} \, dx-4 \int \frac {e^{-2-x}}{(1+x)^2} \, dx-6 \int \frac {e^{-2-x}}{x^4} \, dx+6 \int \frac {e^{-2-x}}{x} \, dx-6 \int \frac {e^{-2-x}}{(1+x)^3} \, dx-6 \int \frac {e^{-2-x}}{1+x} \, dx-12 \int \frac {e^{-2-x}}{x^3} \, dx+12 \int \frac {e^{-2-x}}{(1+x)^3} \, dx+18 \int \frac {e^{-2-x}}{x^3} \, dx-24 \int \frac {e^{-2-x}}{(1+x)^2} \, dx+36 \int \frac {e^{-2-x}}{(1+x)^2} \, dx+60 \int \frac {e^{-2-x}}{x} \, dx-60 \int \frac {e^{-2-x}}{1+x} \, dx-72 \int \frac {e^{-2-x}}{x} \, dx+72 \int \frac {e^{-2-x}}{1+x} \, dx\\ &=\frac {2 e^{-2-x}}{x^3}-\frac {3 e^{-2-x}}{x^2}-\frac {1}{x}+\frac {2 e^{-2-x}}{x}+x+\frac {1}{(1+x)^2}-\frac {2 e^{-2-x}}{(1+x)^2}+\frac {1}{1+x}-\frac {8 e^{-2-x}}{1+x}+\frac {6 \text {Ei}(-1-x)}{e}-\frac {6 \text {Ei}(-x)}{e^2}+2 \int \frac {e^{-2-x}}{x^3} \, dx+2 \int \frac {e^{-2-x}}{x} \, dx+3 \int \frac {e^{-2-x}}{(1+x)^2} \, dx+4 \int \frac {e^{-2-x}}{1+x} \, dx+6 \int \frac {e^{-2-x}}{x^2} \, dx-6 \int \frac {e^{-2-x}}{(1+x)^2} \, dx-9 \int \frac {e^{-2-x}}{x^2} \, dx+24 \int \frac {e^{-2-x}}{1+x} \, dx-36 \int \frac {e^{-2-x}}{1+x} \, dx+\int \frac {e^{-2-x}}{(1+x)^2} \, dx\\ &=\frac {2 e^{-2-x}}{x^3}-\frac {4 e^{-2-x}}{x^2}-\frac {1}{x}+\frac {5 e^{-2-x}}{x}+x+\frac {1}{(1+x)^2}-\frac {2 e^{-2-x}}{(1+x)^2}+\frac {1}{1+x}-\frac {6 e^{-2-x}}{1+x}-\frac {2 \text {Ei}(-1-x)}{e}-\frac {4 \text {Ei}(-x)}{e^2}-3 \int \frac {e^{-2-x}}{1+x} \, dx-6 \int \frac {e^{-2-x}}{x} \, dx+6 \int \frac {e^{-2-x}}{1+x} \, dx+9 \int \frac {e^{-2-x}}{x} \, dx-\int \frac {e^{-2-x}}{x^2} \, dx-\int \frac {e^{-2-x}}{1+x} \, dx\\ &=\frac {2 e^{-2-x}}{x^3}-\frac {4 e^{-2-x}}{x^2}-\frac {1}{x}+\frac {6 e^{-2-x}}{x}+x+\frac {1}{(1+x)^2}-\frac {2 e^{-2-x}}{(1+x)^2}+\frac {1}{1+x}-\frac {6 e^{-2-x}}{1+x}-\frac {\text {Ei}(-x)}{e^2}+\int \frac {e^{-2-x}}{x} \, dx\\ &=\frac {2 e^{-2-x}}{x^3}-\frac {4 e^{-2-x}}{x^2}-\frac {1}{x}+\frac {6 e^{-2-x}}{x}+x+\frac {1}{(1+x)^2}-\frac {2 e^{-2-x}}{(1+x)^2}+\frac {1}{1+x}-\frac {6 e^{-2-x}}{1+x}\\ \end {aligned} \end {gather*}
________________________________________________________________________________________
Mathematica [A]
time = 3.07, size = 35, normalized size = 1.09 \begin {gather*} \frac {2 e^{-2-x}-x^2+x^4+2 x^5+x^6}{x^3 (1+x)^2} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [B] Leaf count of result is larger than twice the leaf count of optimal. \(219\) vs.
\(2(31)=62\).
time = 0.81, size = 220, normalized size = 6.88
method | result | size |
risch | \(x -\frac {1}{x \left (x^{2}+2 x +1\right )}+\frac {2 \,{\mathrm e}^{-x -2}}{x^{3} \left (x +1\right )^{2}}\) | \(34\) |
norman | \(\frac {\left (2+{\mathrm e}^{2+x} x^{6}-3 \,{\mathrm e}^{2+x} x^{4}-2 \,{\mathrm e}^{2+x} x^{3}-x^{2} {\mathrm e}^{2+x}\right ) {\mathrm e}^{-x -2}}{x^{3} \left (x +1\right )^{2}}\) | \(53\) |
derivativedivides | \(2+x -\frac {1}{x}+\frac {1}{\left (x +1\right )^{2}}+\frac {1}{x +1}-\frac {5 \,{\mathrm e}^{-x -2} \left (67 \left (2+x \right )^{4}-430 \left (2+x \right )^{3}+1000 \left (2+x \right )^{2}-1630-990 x \right )}{3 \left (\left (2+x \right )^{5}-8 \left (2+x \right )^{4}+25 \left (2+x \right )^{3}-38 \left (2+x \right )^{2}+48+28 x \right )}+\frac {2 \,{\mathrm e}^{-x -2} \left (98 \left (2+x \right )^{4}-629 \left (2+x \right )^{3}+1463 \left (2+x \right )^{2}-2384-1449 x \right )}{3 \left (\left (2+x \right )^{5}-8 \left (2+x \right )^{4}+25 \left (2+x \right )^{3}-38 \left (2+x \right )^{2}+48+28 x \right )}+\frac {{\mathrm e}^{-x -2} \left (139 \left (2+x \right )^{4}-892 \left (2+x \right )^{3}+2074 \left (2+x \right )^{2}-3376-2052 x \right )}{3 \left (2+x \right )^{5}-24 \left (2+x \right )^{4}+75 \left (2+x \right )^{3}-114 \left (2+x \right )^{2}+144+84 x}\) | \(220\) |
default | \(2+x -\frac {1}{x}+\frac {1}{\left (x +1\right )^{2}}+\frac {1}{x +1}-\frac {5 \,{\mathrm e}^{-x -2} \left (67 \left (2+x \right )^{4}-430 \left (2+x \right )^{3}+1000 \left (2+x \right )^{2}-1630-990 x \right )}{3 \left (\left (2+x \right )^{5}-8 \left (2+x \right )^{4}+25 \left (2+x \right )^{3}-38 \left (2+x \right )^{2}+48+28 x \right )}+\frac {2 \,{\mathrm e}^{-x -2} \left (98 \left (2+x \right )^{4}-629 \left (2+x \right )^{3}+1463 \left (2+x \right )^{2}-2384-1449 x \right )}{3 \left (\left (2+x \right )^{5}-8 \left (2+x \right )^{4}+25 \left (2+x \right )^{3}-38 \left (2+x \right )^{2}+48+28 x \right )}+\frac {{\mathrm e}^{-x -2} \left (139 \left (2+x \right )^{4}-892 \left (2+x \right )^{3}+2074 \left (2+x \right )^{2}-3376-2052 x \right )}{3 \left (2+x \right )^{5}-24 \left (2+x \right )^{4}+75 \left (2+x \right )^{3}-114 \left (2+x \right )^{2}+144+84 x}\) | \(220\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [B] Leaf count of result is larger than twice the leaf count of optimal. 134 vs.
\(2 (30) = 60\).
time = 0.32, size = 134, normalized size = 4.19 \begin {gather*} x - \frac {6 \, x^{2} + 9 \, x + 2}{2 \, {\left (x^{3} + 2 \, x^{2} + x\right )}} - \frac {6 \, x + 5}{2 \, {\left (x^{2} + 2 \, x + 1\right )}} + \frac {3 \, {\left (4 \, x + 3\right )}}{2 \, {\left (x^{2} + 2 \, x + 1\right )}} + \frac {3 \, {\left (2 \, x + 3\right )}}{2 \, {\left (x^{2} + 2 \, x + 1\right )}} - \frac {3 \, {\left (2 \, x + 1\right )}}{2 \, {\left (x^{2} + 2 \, x + 1\right )}} + \frac {2 \, e^{\left (-x\right )}}{x^{5} e^{2} + 2 \, x^{4} e^{2} + x^{3} e^{2}} - \frac {1}{2 \, {\left (x^{2} + 2 \, x + 1\right )}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 0.37, size = 45, normalized size = 1.41 \begin {gather*} \frac {{\left ({\left (x^{6} + 2 \, x^{5} + x^{4} - x^{2}\right )} e^{\left (x + 2\right )} + 2\right )} e^{\left (-x - 2\right )}}{x^{5} + 2 \, x^{4} + x^{3}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [A]
time = 0.08, size = 32, normalized size = 1.00 \begin {gather*} x + \frac {2 e^{- x - 2}}{x^{5} + 2 x^{4} + x^{3}} - \frac {1}{x^{3} + 2 x^{2} + x} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A]
time = 0.41, size = 56, normalized size = 1.75 \begin {gather*} \frac {x^{6} e^{2} + 2 \, x^{5} e^{2} + x^{4} e^{2} - x^{2} e^{2} + 2 \, e^{\left (-x\right )}}{x^{5} e^{2} + 2 \, x^{4} e^{2} + x^{3} e^{2}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 4.43, size = 25, normalized size = 0.78 \begin {gather*} x+\frac {2\,{\mathrm {e}}^{-x-2}-x^2}{x^3\,{\left (x+1\right )}^2} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________