Optimal. Leaf size=31 \[ -4-3 e^{-2/x}+\frac {2 e^x \left (-\frac {e^2}{4 x}+x\right )}{x} \]
________________________________________________________________________________________
Rubi [A] time = 0.37, antiderivative size = 27, normalized size of antiderivative = 0.87, number of steps used = 12, number of rules used = 7, integrand size = 43, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.163, Rules used = {12, 6742, 2209, 2199, 2194, 2177, 2178} \begin {gather*} -\frac {e^{x+2}}{2 x^2}-3 e^{-2/x}+2 e^x \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 12
Rule 2177
Rule 2178
Rule 2194
Rule 2199
Rule 2209
Rule 6742
Rubi steps
\begin {gather*} \begin {aligned} \text {integral} &=\frac {1}{2} \int \frac {e^{-2/x} \left (-12 x+e^{\frac {2}{x}+x} \left (e^2 (2-x)+4 x^3\right )\right )}{x^3} \, dx\\ &=\frac {1}{2} \int \left (-\frac {12 e^{-2/x}}{x^2}+\frac {e^x \left (2 e^2-e^2 x+4 x^3\right )}{x^3}\right ) \, dx\\ &=\frac {1}{2} \int \frac {e^x \left (2 e^2-e^2 x+4 x^3\right )}{x^3} \, dx-6 \int \frac {e^{-2/x}}{x^2} \, dx\\ &=-3 e^{-2/x}+\frac {1}{2} \int \left (4 e^x+\frac {2 e^{2+x}}{x^3}-\frac {e^{2+x}}{x^2}\right ) \, dx\\ &=-3 e^{-2/x}-\frac {1}{2} \int \frac {e^{2+x}}{x^2} \, dx+2 \int e^x \, dx+\int \frac {e^{2+x}}{x^3} \, dx\\ &=-3 e^{-2/x}+2 e^x-\frac {e^{2+x}}{2 x^2}+\frac {e^{2+x}}{2 x}+\frac {1}{2} \int \frac {e^{2+x}}{x^2} \, dx-\frac {1}{2} \int \frac {e^{2+x}}{x} \, dx\\ &=-3 e^{-2/x}+2 e^x-\frac {e^{2+x}}{2 x^2}-\frac {e^2 \text {Ei}(x)}{2}+\frac {1}{2} \int \frac {e^{2+x}}{x} \, dx\\ &=-3 e^{-2/x}+2 e^x-\frac {e^{2+x}}{2 x^2}\\ \end {aligned} \end {gather*}
________________________________________________________________________________________
Mathematica [A] time = 0.03, size = 27, normalized size = 0.87 \begin {gather*} -3 e^{-2/x}+2 e^x-\frac {e^{2+x}}{2 x^2} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
fricas [A] time = 0.92, size = 45, normalized size = 1.45 \begin {gather*} -\frac {6 \, x^{2} e^{\left (-\frac {2}{x}\right )} - {\left (4 \, x^{2} - e^{2}\right )} e^{\left (\frac {x^{2} + 2}{x} - \frac {2}{x}\right )}}{2 \, x^{2}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [A] time = 0.15, size = 28, normalized size = 0.90 \begin {gather*} \frac {4 \, x^{2} e^{x} - e^{\left (x + 2\right )}}{2 \, x^{2}} - 3 \, e^{\left (-\frac {2}{x}\right )} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [A] time = 0.10, size = 25, normalized size = 0.81
method | result | size |
risch | \(-\frac {\left (-4 x^{2}+{\mathrm e}^{2}\right ) {\mathrm e}^{x}}{2 x^{2}}-3 \,{\mathrm e}^{-\frac {2}{x}}\) | \(25\) |
norman | \(\frac {\left (-3 x^{2}-\frac {{\mathrm e}^{2} {\mathrm e}^{x} {\mathrm e}^{\frac {2}{x}}}{2}+2 \,{\mathrm e}^{x} x^{2} {\mathrm e}^{\frac {2}{x}}\right ) {\mathrm e}^{-\frac {2}{x}}}{x^{2}}\) | \(44\) |
default | \(-3 \,{\mathrm e}^{-\frac {2}{x}}+{\mathrm e}^{2} \left (-\frac {{\mathrm e}^{x}}{2 x^{2}}-\frac {{\mathrm e}^{x}}{2 x}-\frac {\expIntegralEi \left (1, -x \right )}{2}\right )-\frac {{\mathrm e}^{2} \left (-\frac {{\mathrm e}^{x}}{x}-\expIntegralEi \left (1, -x \right )\right )}{2}+2 \,{\mathrm e}^{x}\) | \(58\) |
meijerg | \({\mathrm e}^{2} \left (-\frac {1}{2 x^{2}}-\frac {1}{x}-\frac {3}{4}+\frac {\ln \relax (x )}{2}+\frac {i \pi }{2}+\frac {9 x^{2}+12 x +6}{12 x^{2}}-\frac {\left (3 x +3\right ) {\mathrm e}^{x}}{6 x^{2}}-\frac {\ln \left (-x \right )}{2}-\frac {\expIntegralEi \left (1, -x \right )}{2}\right )+\frac {{\mathrm e}^{2} \left (\frac {1}{x}+1-\ln \relax (x )-i \pi -\frac {2 x +2}{2 x}+\frac {{\mathrm e}^{x}}{x}+\ln \left (-x \right )+\expIntegralEi \left (1, -x \right )\right )}{2}+2 \,{\mathrm e}^{x}+1-3 \,{\mathrm e}^{-\frac {2}{x}}\) | \(120\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maxima [C] time = 0.39, size = 31, normalized size = 1.00 \begin {gather*} -\frac {1}{2} \, e^{2} \Gamma \left (-1, -x\right ) - e^{2} \Gamma \left (-2, -x\right ) + 2 \, e^{x} - 3 \, e^{\left (-\frac {2}{x}\right )} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [B] time = 5.36, size = 22, normalized size = 0.71 \begin {gather*} 2\,{\mathrm {e}}^x-3\,{\mathrm {e}}^{-\frac {2}{x}}-\frac {{\mathrm {e}}^2\,{\mathrm {e}}^x}{2\,x^2} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
sympy [A] time = 47.12, size = 22, normalized size = 0.71 \begin {gather*} 2 e^{x} - 3 e^{- \frac {2}{x}} - \frac {e^{2} e^{x}}{2 x^{2}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________