Optimal. Leaf size=32 \[ x+\frac {2 e^{-2-x}-x^2}{x \left (x+x^2\right )^2}-\log (5) \]
________________________________________________________________________________________
Rubi [B] time = 2.00, 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 = {6741, 6742, 2177, 2178, 1620} \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 1620
Rule 2177
Rule 2178
Rule 6741
Rule 6742
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 = 0.44, 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]
________________________________________________________________________________________
fricas [A] time = 0.64, 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]
________________________________________________________________________________________
giac [A] time = 0.14, 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]
________________________________________________________________________________________
maple [A] time = 0.14, size = 34, normalized size = 1.06
method | result | size |
risch | \(x -\frac {1}{x \left (x^{2}+2 x +1\right )}+\frac {2 \,{\mathrm e}^{-x -2}}{\left (x +1\right )^{2} x^{3}}\) | \(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}{\left (x +1\right )^{2}}+\frac {1}{x +1}-\frac {1}{x}-\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}{\left (x +1\right )^{2}}+\frac {1}{x +1}-\frac {1}{x}-\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] time = 0.41, 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]
________________________________________________________________________________________
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]
________________________________________________________________________________________
sympy [A] time = 0.19, 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]
________________________________________________________________________________________