Optimal. Leaf size=30 \[ 4-x+\frac {1}{2} e^{-x} \left (-2-e^5+\frac {2+3 x}{x}\right ) \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.21, antiderivative size = 29, normalized size of antiderivative = 0.97, number of steps
used = 10, number of rules used = 7, integrand size = 37, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.189, Rules used = {6, 12, 6874,
2230, 2225, 2208, 2209} \begin {gather*} -x+\frac {1}{2} \left (1-e^5\right ) e^{-x}+\frac {e^{-x}}{x} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 6
Rule 12
Rule 2208
Rule 2209
Rule 2225
Rule 2230
Rule 6874
Rubi steps
\begin {gather*} \begin {aligned} \text {integral} &=\int \frac {e^{-x} \left (-2-2 x-2 e^x x^2+\left (-1+e^5\right ) x^2\right )}{2 x^2} \, dx\\ &=\frac {1}{2} \int \frac {e^{-x} \left (-2-2 x-2 e^x x^2+\left (-1+e^5\right ) x^2\right )}{x^2} \, dx\\ &=\frac {1}{2} \int \left (-2+\frac {e^{-x} \left (-2-2 x-\left (1-e^5\right ) x^2\right )}{x^2}\right ) \, dx\\ &=-x+\frac {1}{2} \int \frac {e^{-x} \left (-2-2 x-\left (1-e^5\right ) x^2\right )}{x^2} \, dx\\ &=-x+\frac {1}{2} \int \left (e^{-x} \left (-1+e^5\right )-\frac {2 e^{-x}}{x^2}-\frac {2 e^{-x}}{x}\right ) \, dx\\ &=-x+\frac {1}{2} \left (-1+e^5\right ) \int e^{-x} \, dx-\int \frac {e^{-x}}{x^2} \, dx-\int \frac {e^{-x}}{x} \, dx\\ &=\frac {1}{2} e^{-x} \left (1-e^5\right )+\frac {e^{-x}}{x}-x-\text {Ei}(-x)+\int \frac {e^{-x}}{x} \, dx\\ &=\frac {1}{2} e^{-x} \left (1-e^5\right )+\frac {e^{-x}}{x}-x\\ \end {aligned} \end {gather*}
________________________________________________________________________________________
Mathematica [A]
time = 0.38, size = 31, normalized size = 1.03 \begin {gather*} \frac {1}{2} \left (-2 x-\frac {e^{-x} \left (-2 x+\left (-1+e^5\right ) x^2\right )}{x^2}\right ) \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.25, size = 45, normalized size = 1.50
method | result | size |
risch | \(-x -\frac {\left (x \,{\mathrm e}^{5}-x -2\right ) {\mathrm e}^{-x}}{2 x}\) | \(23\) |
norman | \(\frac {\left (2+\left (1-{\mathrm e}^{5}\right ) x -x^{2} {\mathrm e}^{\ln \left (2\right )+x}\right ) {\mathrm e}^{-x}}{2 x}\) | \(32\) |
derivativedivides | \(-{\mathrm e}^{5} {\mathrm e}^{-x -\ln \left (2\right )}-\ln \left (2\right )-x +\frac {2 \,{\mathrm e}^{-x -\ln \left (2\right )}}{x}+{\mathrm e}^{-x -\ln \left (2\right )}\) | \(45\) |
default | \(-{\mathrm e}^{5} {\mathrm e}^{-x -\ln \left (2\right )}-\ln \left (2\right )-x +\frac {2 \,{\mathrm e}^{-x -\ln \left (2\right )}}{x}+{\mathrm e}^{-x -\ln \left (2\right )}\) | \(45\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [C] Result contains higher order function than in optimal. Order 4 vs. order
3.
time = 0.28, size = 27, normalized size = 0.90 \begin {gather*} -x - {\rm Ei}\left (-x\right ) + \frac {1}{2} \, e^{\left (-x\right )} - \frac {1}{2} \, e^{\left (-x + 5\right )} + \Gamma \left (-1, x\right ) \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 0.35, size = 32, normalized size = 1.07 \begin {gather*} -\frac {{\left (x^{2} e^{\left (x + \log \left (2\right )\right )} + x e^{5} - x - 2\right )} e^{\left (-x - \log \left (2\right )\right )}}{x} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [A]
time = 0.04, size = 15, normalized size = 0.50 \begin {gather*} - x + \frac {\left (- x e^{5} + x + 2\right ) e^{- x}}{2 x} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [B] Leaf count of result is larger than twice the leaf count of optimal. 87 vs.
\(2 (30) = 60\).
time = 0.38, size = 87, normalized size = 2.90 \begin {gather*} -\frac {{\left (x + \log \left (2\right )\right )}^{2} + {\left (x + \log \left (2\right )\right )} e^{\left (-x - \log \left (2\right ) + 5\right )} - {\left (x + \log \left (2\right )\right )} e^{\left (-x - \log \left (2\right )\right )} - {\left (x + \log \left (2\right )\right )} \log \left (2\right ) - e^{\left (-x - \log \left (2\right ) + 5\right )} \log \left (2\right ) + e^{\left (-x - \log \left (2\right )\right )} \log \left (2\right ) - 2 \, e^{\left (-x - \log \left (2\right )\right )}}{x} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 1.19, size = 24, normalized size = 0.80 \begin {gather*} \frac {{\mathrm {e}}^{-x}}{x}-x-{\mathrm {e}}^{-x}\,\left (\frac {{\mathrm {e}}^5}{2}-\frac {1}{2}\right ) \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________