Optimal. Leaf size=27 \[ -3-e^4-x-\frac {e^{1-x} x}{2+x}+\log (3) \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.23, 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, 6820, 2230,
2225, 2208, 2209} \begin {gather*} -x-e^{1-x}+\frac {2 e^{1-x}}{x+2} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 27
Rule 2208
Rule 2209
Rule 2225
Rule 2230
Rule 6820
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.13, 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]
________________________________________________________________________________________
Maple [C] Result contains higher order function than in optimal. Order 4 vs. order
3.
time = 0.79, size = 84, normalized size = 3.11
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} \expIntegral \left (1, 2+x \right )\right )-x -2 \,{\mathrm e} \left (-\frac {{\mathrm e}^{-x}}{2+x}+{\mathrm e}^{2} \expIntegral \left (1, 2+x \right )\right )+2 \,{\mathrm e} \left (\frac {2 \,{\mathrm e}^{-x}}{2+x}-3 \,{\mathrm e}^{2} \expIntegral \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*} \text {Failed to integrate} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 0.41, 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]
________________________________________________________________________________________
Sympy [A]
time = 0.05, 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]
________________________________________________________________________________________
Giac [A]
time = 0.40, 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]
________________________________________________________________________________________
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]
________________________________________________________________________________________