Optimal. Leaf size=27 \[ -3-e^4-x-\frac {e^{1-x} x}{2+x}+\log (3) \]
________________________________________________________________________________________
Rubi [A] time = 0.22, antiderivative size = 27, normalized size of antiderivative = 1.00, number of steps used = 9, number of rules used = 6, integrand size = 41, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.146, Rules used = {27, 6688, 2199, 2194, 2177, 2178} \begin {gather*} -x-e^{1-x}+\frac {2 e^{1-x}}{x+2} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 27
Rule 2177
Rule 2178
Rule 2194
Rule 2199
Rule 6688
Rubi steps
\begin {gather*} \begin {aligned} \text {integral} &=\int \frac {e^{-x} \left (e^x \left (-4-4 x-x^2\right )+e \left (-2+2 x+x^2\right )\right )}{(2+x)^2} \, dx\\ &=\int \left (-1+\frac {e^{1-x} \left (-2+2 x+x^2\right )}{(2+x)^2}\right ) \, dx\\ &=-x+\int \frac {e^{1-x} \left (-2+2 x+x^2\right )}{(2+x)^2} \, dx\\ &=-x+\int \left (e^{1-x}-\frac {2 e^{1-x}}{(2+x)^2}-\frac {2 e^{1-x}}{2+x}\right ) \, dx\\ &=-x-2 \int \frac {e^{1-x}}{(2+x)^2} \, dx-2 \int \frac {e^{1-x}}{2+x} \, dx+\int e^{1-x} \, dx\\ &=-e^{1-x}-x+\frac {2 e^{1-x}}{2+x}-2 e^3 \text {Ei}(-2-x)+2 \int \frac {e^{1-x}}{2+x} \, dx\\ &=-e^{1-x}-x+\frac {2 e^{1-x}}{2+x}\\ \end {aligned} \end {gather*}
________________________________________________________________________________________
Mathematica [A] time = 0.03, size = 25, normalized size = 0.93 \begin {gather*} -x-\frac {e^{1-x} \left (2 x+x^2\right )}{(2+x)^2} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
fricas [A] time = 0.68, size = 26, normalized size = 0.96 \begin {gather*} -\frac {{\left (x e + {\left (x^{2} + 2 \, x\right )} e^{x}\right )} e^{\left (-x\right )}}{x + 2} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [A] time = 0.25, size = 22, normalized size = 0.81 \begin {gather*} -\frac {x^{2} + x e^{\left (-x + 1\right )} + 2 \, x}{x + 2} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [A] time = 0.52, size = 19, normalized size = 0.70
method | result | size |
risch | \(-x -\frac {x \,{\mathrm e}^{1-x}}{2+x}\) | \(19\) |
norman | \(\frac {\left (4 \,{\mathrm e}^{x}-x \,{\mathrm e}-{\mathrm e}^{x} x^{2}\right ) {\mathrm e}^{-x}}{2+x}\) | \(28\) |
default | \({\mathrm e} \left (-{\mathrm e}^{-x}-\frac {4 \,{\mathrm e}^{-x}}{2+x}+8 \,{\mathrm e}^{2} \expIntegralEi \left (1, 2+x \right )\right )-x -2 \,{\mathrm e} \left (-\frac {{\mathrm e}^{-x}}{2+x}+{\mathrm e}^{2} \expIntegralEi \left (1, 2+x \right )\right )+2 \,{\mathrm e} \left (\frac {2 \,{\mathrm e}^{-x}}{2+x}-3 \,{\mathrm e}^{2} \expIntegralEi \left (1, 2+x \right )\right )\) | \(84\) |
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 {2 \, e^{3} E_{2}\left (x + 2\right )}{x + 2} - \frac {x^{2} + x e^{\left (-x + 1\right )} + 2 \, x}{x + 2} + 2 \, \int \frac {e^{\left (-x + 1\right )}}{x^{2} + 4 \, x + 4}\,{d x} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [B] time = 0.11, size = 33, normalized size = 1.22 \begin {gather*} -\frac {2\,x}{x+2}-\frac {x^2}{x+2}-\frac {x\,{\mathrm {e}}^{1-x}}{x+2} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
sympy [A] time = 0.14, size = 14, normalized size = 0.52 \begin {gather*} - x - \frac {e x e^{- x}}{x + 2} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________