Optimal. Leaf size=20 \[ e^{-4+x^2} \left (1-x+\frac {1}{\frac {1}{x}+x}\right ) \]
________________________________________________________________________________________
Rubi [C] time = 0.77, antiderivative size = 56, normalized size of antiderivative = 2.80, number of steps used = 18, number of rules used = 8, integrand size = 49, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.163, Rules used = {28, 6741, 6742, 2204, 2209, 2212, 2220, 6725} \begin {gather*} -e^{x^2-4} x+e^{x^2-4}-\frac {e^{x^2-4}}{2 (-x+i)}+\frac {e^{x^2-4}}{2 (x+i)} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 28
Rule 2204
Rule 2209
Rule 2212
Rule 2220
Rule 6725
Rule 6741
Rule 6742
Rubi steps
\begin {gather*} \begin {aligned} \text {integral} &=\int \frac {e^{-4+x^2} \left (2 x-3 x^2+4 x^3-3 x^4+2 x^5-2 x^6\right )}{\left (1+x^2\right )^2} \, dx\\ &=\int \frac {e^{-4+x^2} x \left (2-3 x+4 x^2-3 x^3+2 x^4-2 x^5\right )}{\left (1+x^2\right )^2} \, dx\\ &=\int \left (e^{-4+x^2}+2 e^{-4+x^2} x-2 e^{-4+x^2} x^2+\frac {2 e^{-4+x^2}}{\left (1+x^2\right )^2}-\frac {3 e^{-4+x^2}}{1+x^2}\right ) \, dx\\ &=2 \int e^{-4+x^2} x \, dx-2 \int e^{-4+x^2} x^2 \, dx+2 \int \frac {e^{-4+x^2}}{\left (1+x^2\right )^2} \, dx-3 \int \frac {e^{-4+x^2}}{1+x^2} \, dx+\int e^{-4+x^2} \, dx\\ &=e^{-4+x^2}-e^{-4+x^2} x+\frac {\sqrt {\pi } \text {erfi}(x)}{2 e^4}+2 \int \left (-\frac {e^{-4+x^2}}{4 (i-x)^2}-\frac {e^{-4+x^2}}{4 (i+x)^2}-\frac {e^{-4+x^2}}{2 \left (-1-x^2\right )}\right ) \, dx-3 \int \left (\frac {i e^{-4+x^2}}{2 (i-x)}+\frac {i e^{-4+x^2}}{2 (i+x)}\right ) \, dx+\int e^{-4+x^2} \, dx\\ &=e^{-4+x^2}-e^{-4+x^2} x+\frac {\sqrt {\pi } \text {erfi}(x)}{e^4}-\frac {3}{2} i \int \frac {e^{-4+x^2}}{i-x} \, dx-\frac {3}{2} i \int \frac {e^{-4+x^2}}{i+x} \, dx-\frac {1}{2} \int \frac {e^{-4+x^2}}{(i-x)^2} \, dx-\frac {1}{2} \int \frac {e^{-4+x^2}}{(i+x)^2} \, dx-\int \frac {e^{-4+x^2}}{-1-x^2} \, dx\\ &=e^{-4+x^2}-\frac {e^{-4+x^2}}{2 (i-x)}-e^{-4+x^2} x+\frac {e^{-4+x^2}}{2 (i+x)}+\frac {\sqrt {\pi } \text {erfi}(x)}{e^4}+i \int \frac {e^{-4+x^2}}{i-x} \, dx+i \int \frac {e^{-4+x^2}}{i+x} \, dx-\frac {3}{2} i \int \frac {e^{-4+x^2}}{i-x} \, dx-\frac {3}{2} i \int \frac {e^{-4+x^2}}{i+x} \, dx-2 \int e^{-4+x^2} \, dx-\int \left (-\frac {i e^{-4+x^2}}{2 (i-x)}-\frac {i e^{-4+x^2}}{2 (i+x)}\right ) \, dx\\ &=e^{-4+x^2}-\frac {e^{-4+x^2}}{2 (i-x)}-e^{-4+x^2} x+\frac {e^{-4+x^2}}{2 (i+x)}+\frac {1}{2} i \int \frac {e^{-4+x^2}}{i-x} \, dx+\frac {1}{2} i \int \frac {e^{-4+x^2}}{i+x} \, dx+i \int \frac {e^{-4+x^2}}{i-x} \, dx+i \int \frac {e^{-4+x^2}}{i+x} \, dx-\frac {3}{2} i \int \frac {e^{-4+x^2}}{i-x} \, dx-\frac {3}{2} i \int \frac {e^{-4+x^2}}{i+x} \, dx\\ \end {aligned} \end {gather*}
________________________________________________________________________________________
Mathematica [A] time = 0.18, size = 26, normalized size = 1.30 \begin {gather*} -\frac {e^{-4+x^2} \left (-1-x^2+x^3\right )}{1+x^2} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
fricas [A] time = 0.64, size = 25, normalized size = 1.25 \begin {gather*} -\frac {{\left (x^{3} - x^{2} - 1\right )} e^{\left (x^{2} - 4\right )}}{x^{2} + 1} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [A] time = 0.16, size = 37, normalized size = 1.85 \begin {gather*} -\frac {x^{3} e^{\left (x^{2}\right )} - x^{2} e^{\left (x^{2}\right )} - e^{\left (x^{2}\right )}}{x^{2} e^{4} + e^{4}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [A] time = 0.14, size = 26, normalized size = 1.30
method | result | size |
gosper | \(-\frac {\left (x^{3}-x^{2}-1\right ) {\mathrm e}^{x^{2}-4}}{x^{2}+1}\) | \(26\) |
risch | \(-\frac {\left (x^{3}-x^{2}-1\right ) {\mathrm e}^{\left (x -2\right ) \left (2+x \right )}}{x^{2}+1}\) | \(28\) |
norman | \(\frac {{\mathrm e}^{x^{2}-4} x^{2}-x^{3} {\mathrm e}^{x^{2}-4}+{\mathrm e}^{x^{2}-4}}{x^{2}+1}\) | \(37\) |
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^{5} - x^{4} + x^{3} - 2 \, x^{2}\right )} e^{\left (x^{2}\right )}}{x^{4} e^{4} + 2 \, x^{2} e^{4} + e^{4}} - \frac {e^{\left (-5\right )} E_{2}\left (-x^{2} - 1\right )}{x^{2} + 1} - 4 \, \int \frac {x e^{\left (x^{2}\right )}}{x^{6} e^{4} + 3 \, x^{4} e^{4} + 3 \, x^{2} e^{4} + e^{4}}\,{d x} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [B] time = 0.15, size = 24, normalized size = 1.20 \begin {gather*} \frac {{\mathrm {e}}^{x^2-4}\,\left (-x^3+x^2+1\right )}{x^2+1} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
sympy [A] time = 0.11, size = 19, normalized size = 0.95 \begin {gather*} \frac {\left (- x^{3} + x^{2} + 1\right ) e^{x^{2} - 4}}{x^{2} + 1} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________