Optimal. Leaf size=29 \[ 4+x+(5-x) \left (e^{-2+x^2}-\frac {x}{-x+x^2}\right ) \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.24, 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, 6874, 697,
2258, 2235, 2240, 2243} \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 697
Rule 2235
Rule 2240
Rule 2243
Rule 2258
Rule 6874
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.12, 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]
________________________________________________________________________________________
Maple [A]
time = 1.46, size = 27, normalized size = 0.93
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.30, 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]
________________________________________________________________________________________
Fricas [A]
time = 0.45, 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]
________________________________________________________________________________________
Sympy [A]
time = 0.06, 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]
________________________________________________________________________________________
Giac [A]
time = 0.41, 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]
________________________________________________________________________________________
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]
________________________________________________________________________________________