Optimal. Leaf size=32 \[ 2-e^{\frac {2}{x}-x}+\frac {3}{-3+x}+5 x+e^{-x} x \]
________________________________________________________________________________________
Rubi [A] time = 1.00, antiderivative size = 43, normalized size of antiderivative = 1.34, number of steps used = 9, number of rules used = 7, integrand size = 95, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.074, Rules used = {1594, 27, 6688, 6706, 2176, 2194, 683} \begin {gather*} -e^{-x} (1-x)-e^{\frac {2}{x}-x}+e^{-x}+5 x-\frac {3}{3-x} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 27
Rule 683
Rule 1594
Rule 2176
Rule 2194
Rule 6688
Rule 6706
Rubi steps
\begin {gather*} \begin {aligned} \text {integral} &=\int \frac {e^{-x} \left (9 x^2-15 x^3+7 x^4-x^5+e^x \left (42 x^2-30 x^3+5 x^4+e^{\frac {2-x^2}{x}} \left (18-12 x+11 x^2-6 x^3+x^4\right )\right )\right )}{x^2 \left (9-6 x+x^2\right )} \, dx\\ &=\int \frac {e^{-x} \left (9 x^2-15 x^3+7 x^4-x^5+e^x \left (42 x^2-30 x^3+5 x^4+e^{\frac {2-x^2}{x}} \left (18-12 x+11 x^2-6 x^3+x^4\right )\right )\right )}{(-3+x)^2 x^2} \, dx\\ &=\int \left (e^{\frac {2}{x}-x} \left (1+\frac {2}{x^2}\right )-e^{-x} (-1+x)+\frac {42-30 x+5 x^2}{(-3+x)^2}\right ) \, dx\\ &=\int e^{\frac {2}{x}-x} \left (1+\frac {2}{x^2}\right ) \, dx-\int e^{-x} (-1+x) \, dx+\int \frac {42-30 x+5 x^2}{(-3+x)^2} \, dx\\ &=-e^{\frac {2}{x}-x}-e^{-x} (1-x)-\int e^{-x} \, dx+\int \left (5-\frac {3}{(-3+x)^2}\right ) \, dx\\ &=-e^{\frac {2}{x}-x}+e^{-x}-e^{-x} (1-x)-\frac {3}{3-x}+5 x\\ \end {aligned} \end {gather*}
________________________________________________________________________________________
Mathematica [A] time = 0.09, size = 33, normalized size = 1.03 \begin {gather*} -e^{\frac {2}{x}-x}+\frac {3}{-3+x}+5 (-3+x)+e^{-x} x \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
fricas [A] time = 0.45, size = 46, normalized size = 1.44 \begin {gather*} \frac {{\left (x^{2} + {\left (5 \, x^{2} - {\left (x - 3\right )} e^{\left (-\frac {x^{2} - 2}{x}\right )} - 15 \, x + 3\right )} e^{x} - 3 \, x\right )} e^{\left (-x\right )}}{x - 3} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [A] time = 0.20, size = 58, normalized size = 1.81 \begin {gather*} \frac {x^{2} e^{\left (-x\right )} + 5 \, x^{2} - 3 \, x e^{\left (-x\right )} - x e^{\left (-\frac {x^{2} - 2}{x}\right )} - 15 \, x + 3 \, e^{\left (-\frac {x^{2} - 2}{x}\right )} + 3}{x - 3} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [A] time = 0.22, size = 31, normalized size = 0.97
method | result | size |
risch | \(5 x +\frac {3}{x -3}+x \,{\mathrm e}^{-x}-{\mathrm e}^{-\frac {x^{2}-2}{x}}\) | \(31\) |
norman | \(\frac {\left (x^{3}-42 \,{\mathrm e}^{x} x -3 x^{2}+5 \,{\mathrm e}^{x} x^{3}+3 \,{\mathrm e}^{x} x \,{\mathrm e}^{\frac {-x^{2}+2}{x}}-{\mathrm e}^{x} x^{2} {\mathrm e}^{\frac {-x^{2}+2}{x}}\right ) {\mathrm e}^{-x}}{x \left (x -3\right )}\) | \(71\) |
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 {{\left (x^{2} + {\left (5 \, x^{2} - 15 \, x + 3\right )} e^{x} - {\left (x - 3\right )} e^{\frac {2}{x}} - 3 \, x\right )} e^{\left (-x\right )}}{x - 3} - \frac {9 \, e^{\left (-3\right )} E_{2}\left (x - 3\right )}{x - 3} - 9 \, \int \frac {e^{\left (-x\right )}}{x^{2} - 6 \, x + 9}\,{d x} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [B] time = 2.58, size = 29, normalized size = 0.91 \begin {gather*} 5\,x-{\mathrm {e}}^{\frac {2}{x}-x}+x\,{\mathrm {e}}^{-x}+\frac {3}{x-3} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
sympy [A] time = 0.31, size = 20, normalized size = 0.62 \begin {gather*} 5 x + x e^{- x} - e^{\frac {2 - x^{2}}{x}} + \frac {3}{x - 3} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________