Optimal. Leaf size=29 \[ 4+x+(5-x) \left (e^{-2+x^2}-\frac {x}{-x+x^2}\right ) \]
________________________________________________________________________________________
Rubi [A] time = 0.22, antiderivative size = 30, normalized size of antiderivative = 1.03, number of steps used = 11, number of rules used = 7, integrand size = 47, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.149, Rules used = {27, 6742, 683, 2226, 2204, 2209, 2212} \begin {gather*} -e^{x^2-2} x+5 e^{x^2-2}+x+\frac {4}{1-x} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 27
Rule 683
Rule 2204
Rule 2209
Rule 2212
Rule 2226
Rule 6742
Rubi steps
\begin {gather*} \begin {aligned} \text {integral} &=\int \frac {5-2 x+x^2+e^{-2+x^2} \left (-1+12 x-23 x^2+14 x^3-2 x^4\right )}{(-1+x)^2} \, dx\\ &=\int \left (\frac {5-2 x+x^2}{(-1+x)^2}-e^{-2+x^2} \left (1-10 x+2 x^2\right )\right ) \, dx\\ &=\int \frac {5-2 x+x^2}{(-1+x)^2} \, dx-\int e^{-2+x^2} \left (1-10 x+2 x^2\right ) \, dx\\ &=\int \left (1+\frac {4}{(-1+x)^2}\right ) \, dx-\int \left (e^{-2+x^2}-10 e^{-2+x^2} x+2 e^{-2+x^2} x^2\right ) \, dx\\ &=\frac {4}{1-x}+x-2 \int e^{-2+x^2} x^2 \, dx+10 \int e^{-2+x^2} x \, dx-\int e^{-2+x^2} \, dx\\ &=5 e^{-2+x^2}+\frac {4}{1-x}+x-e^{-2+x^2} x-\frac {\sqrt {\pi } \text {erfi}(x)}{2 e^2}+\int e^{-2+x^2} \, dx\\ &=5 e^{-2+x^2}+\frac {4}{1-x}+x-e^{-2+x^2} x\\ \end {aligned} \end {gather*}
________________________________________________________________________________________
Mathematica [A] time = 0.04, size = 28, normalized size = 0.97 \begin {gather*} 5 e^{-2+x^2}-\frac {4}{-1+x}+x-e^{-2+x^2} x \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
fricas [A] time = 0.55, size = 30, normalized size = 1.03 \begin {gather*} \frac {x^{2} - {\left (x^{2} - 6 \, x + 5\right )} e^{\left (x^{2} - 2\right )} - x - 4}{x - 1} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [A] time = 0.24, size = 50, normalized size = 1.72 \begin {gather*} \frac {x^{2} e^{2} - x^{2} e^{\left (x^{2}\right )} - x e^{2} + 6 \, x e^{\left (x^{2}\right )} - 4 \, e^{2} - 5 \, e^{\left (x^{2}\right )}}{x e^{2} - e^{2}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [A] time = 0.56, size = 22, normalized size = 0.76
method | result | size |
risch | \(x -\frac {4}{x -1}+\left (5-x \right ) {\mathrm e}^{x^{2}-2}\) | \(22\) |
default | \(-{\mathrm e}^{x^{2}} {\mathrm e}^{-2} x +5 \,{\mathrm e}^{x^{2}} {\mathrm e}^{-2}+x -\frac {4}{x -1}\) | \(27\) |
norman | \(\frac {x^{2}+6 x \,{\mathrm e}^{x^{2}-2}-{\mathrm e}^{x^{2}-2} x^{2}-5 \,{\mathrm e}^{x^{2}-2}-5}{x -1}\) | \(40\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maxima [A] time = 0.45, size = 20, normalized size = 0.69 \begin {gather*} -{\left (x - 5\right )} e^{\left (x^{2} - 2\right )} + x - \frac {4}{x - 1} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [B] time = 0.11, size = 26, normalized size = 0.90 \begin {gather*} \frac {\left (x-5\right )\,\left (x+{\mathrm {e}}^{x^2-2}-x\,{\mathrm {e}}^{x^2-2}\right )}{x-1} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
sympy [A] time = 0.14, size = 15, normalized size = 0.52 \begin {gather*} x + \left (5 - x\right ) e^{x^{2} - 2} - \frac {4}{x - 1} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________