Optimal. Leaf size=25 \[ \frac {e^{x+x^2} x \left (-2 x+e^x x+\log (4)\right )}{-1+x} \]
________________________________________________________________________________________
Rubi [B] time = 1.85, antiderivative size = 109, normalized size of antiderivative = 4.36, number of steps used = 51, number of rules used = 8, integrand size = 68, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.118, Rules used = {27, 6742, 2242, 2234, 2204, 2240, 2241, 2288} \begin {gather*} -2 e^{x^2+x} x+e^{x^2+2 x} x-2 e^{x^2+x}+e^{x^2+2 x}+\frac {2 e^{x^2+x}}{1-x}-\frac {e^{x^2+2 x}}{1-x}-\frac {e^{x^2+x} \left (-2 x^3+x^2+x\right ) \log (4)}{(1-x)^2 (2 x+1)} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 27
Rule 2204
Rule 2234
Rule 2240
Rule 2241
Rule 2242
Rule 2288
Rule 6742
Rubi steps
\begin {gather*} \begin {aligned} \text {integral} &=\int \frac {e^{x+x^2} \left (4 x+2 x^3-4 x^4+e^x \left (-2 x-x^2+2 x^4\right )+\left (-1-x-x^2+2 x^3\right ) \log (4)\right )}{(-1+x)^2} \, dx\\ &=\int \left (\frac {4 e^{x+x^2} x}{(-1+x)^2}+\frac {2 e^{x+x^2} x^3}{(-1+x)^2}-\frac {4 e^{x+x^2} x^4}{(-1+x)^2}+\frac {e^{2 x+x^2} x \left (-2-x+2 x^3\right )}{(-1+x)^2}+\frac {e^{x+x^2} \left (-1-x-x^2+2 x^3\right ) \log (4)}{(-1+x)^2}\right ) \, dx\\ &=2 \int \frac {e^{x+x^2} x^3}{(-1+x)^2} \, dx+4 \int \frac {e^{x+x^2} x}{(-1+x)^2} \, dx-4 \int \frac {e^{x+x^2} x^4}{(-1+x)^2} \, dx+\log (4) \int \frac {e^{x+x^2} \left (-1-x-x^2+2 x^3\right )}{(-1+x)^2} \, dx+\int \frac {e^{2 x+x^2} x \left (-2-x+2 x^3\right )}{(-1+x)^2} \, dx\\ &=-\frac {e^{x+x^2} \left (x+x^2-2 x^3\right ) \log (4)}{(1-x)^2 (1+2 x)}+2 \int \left (2 e^{x+x^2}+\frac {e^{x+x^2}}{(-1+x)^2}+\frac {3 e^{x+x^2}}{-1+x}+e^{x+x^2} x\right ) \, dx+4 \int \left (\frac {e^{x+x^2}}{(-1+x)^2}+\frac {e^{x+x^2}}{-1+x}\right ) \, dx-4 \int \left (3 e^{x+x^2}+\frac {e^{x+x^2}}{(-1+x)^2}+\frac {4 e^{x+x^2}}{-1+x}+2 e^{x+x^2} x+e^{x+x^2} x^2\right ) \, dx+\int \left (5 e^{2 x+x^2}-\frac {e^{2 x+x^2}}{(-1+x)^2}+\frac {4 e^{2 x+x^2}}{-1+x}+4 e^{2 x+x^2} x+2 e^{2 x+x^2} x^2\right ) \, dx\\ &=-\frac {e^{x+x^2} \left (x+x^2-2 x^3\right ) \log (4)}{(1-x)^2 (1+2 x)}+2 \int \frac {e^{x+x^2}}{(-1+x)^2} \, dx+2 \int e^{x+x^2} x \, dx+2 \int e^{2 x+x^2} x^2 \, dx+4 \int e^{x+x^2} \, dx+4 \int \frac {e^{x+x^2}}{-1+x} \, dx+4 \int \frac {e^{2 x+x^2}}{-1+x} \, dx+4 \int e^{2 x+x^2} x \, dx-4 \int e^{x+x^2} x^2 \, dx+5 \int e^{2 x+x^2} \, dx+6 \int \frac {e^{x+x^2}}{-1+x} \, dx-8 \int e^{x+x^2} x \, dx-12 \int e^{x+x^2} \, dx-16 \int \frac {e^{x+x^2}}{-1+x} \, dx-\int \frac {e^{2 x+x^2}}{(-1+x)^2} \, dx\\ &=-3 e^{x+x^2}+2 e^{2 x+x^2}+\frac {2 e^{x+x^2}}{1-x}-\frac {e^{2 x+x^2}}{1-x}-2 e^{x+x^2} x+e^{2 x+x^2} x-\frac {e^{x+x^2} \left (x+x^2-2 x^3\right ) \log (4)}{(1-x)^2 (1+2 x)}+2 \int e^{x+x^2} \, dx-2 \int e^{2 x+x^2} \, dx+2 \int e^{x+x^2} x \, dx-2 \int e^{2 x+x^2} x \, dx+2 \left (4 \int e^{x+x^2} \, dx\right )-4 \int e^{2 x+x^2} \, dx+4 \int \frac {e^{x+x^2}}{-1+x} \, dx+2 \left (6 \int \frac {e^{x+x^2}}{-1+x} \, dx\right )-16 \int \frac {e^{x+x^2}}{-1+x} \, dx+\frac {5 \int e^{\frac {1}{4} (2+2 x)^2} \, dx}{e}+\frac {4 \int e^{\frac {1}{4} (1+2 x)^2} \, dx}{\sqrt [4]{e}}-\frac {12 \int e^{\frac {1}{4} (1+2 x)^2} \, dx}{\sqrt [4]{e}}-\int e^{x+x^2} \, dx-\int e^{2 x+x^2} \, dx\\ &=-2 e^{x+x^2}+e^{2 x+x^2}+\frac {2 e^{x+x^2}}{1-x}-\frac {e^{2 x+x^2}}{1-x}-2 e^{x+x^2} x+e^{2 x+x^2} x+\frac {5 \sqrt {\pi } \text {erfi}(1+x)}{2 e}-\frac {4 \sqrt {\pi } \text {erfi}\left (\frac {1}{2} (1+2 x)\right )}{\sqrt [4]{e}}-\frac {e^{x+x^2} \left (x+x^2-2 x^3\right ) \log (4)}{(1-x)^2 (1+2 x)}+2 \int e^{2 x+x^2} \, dx+4 \int \frac {e^{x+x^2}}{-1+x} \, dx+2 \left (6 \int \frac {e^{x+x^2}}{-1+x} \, dx\right )-16 \int \frac {e^{x+x^2}}{-1+x} \, dx-\frac {\int e^{\frac {1}{4} (2+2 x)^2} \, dx}{e}-\frac {2 \int e^{\frac {1}{4} (2+2 x)^2} \, dx}{e}-\frac {4 \int e^{\frac {1}{4} (2+2 x)^2} \, dx}{e}-\frac {\int e^{\frac {1}{4} (1+2 x)^2} \, dx}{\sqrt [4]{e}}+\frac {2 \int e^{\frac {1}{4} (1+2 x)^2} \, dx}{\sqrt [4]{e}}+2 \frac {4 \int e^{\frac {1}{4} (1+2 x)^2} \, dx}{\sqrt [4]{e}}-\int e^{x+x^2} \, dx\\ &=-2 e^{x+x^2}+e^{2 x+x^2}+\frac {2 e^{x+x^2}}{1-x}-\frac {e^{2 x+x^2}}{1-x}-2 e^{x+x^2} x+e^{2 x+x^2} x-\frac {\sqrt {\pi } \text {erfi}(1+x)}{e}+\frac {\sqrt {\pi } \text {erfi}\left (\frac {1}{2} (1+2 x)\right )}{2 \sqrt [4]{e}}-\frac {e^{x+x^2} \left (x+x^2-2 x^3\right ) \log (4)}{(1-x)^2 (1+2 x)}+4 \int \frac {e^{x+x^2}}{-1+x} \, dx+2 \left (6 \int \frac {e^{x+x^2}}{-1+x} \, dx\right )-16 \int \frac {e^{x+x^2}}{-1+x} \, dx+\frac {2 \int e^{\frac {1}{4} (2+2 x)^2} \, dx}{e}-\frac {\int e^{\frac {1}{4} (1+2 x)^2} \, dx}{\sqrt [4]{e}}\\ &=-2 e^{x+x^2}+e^{2 x+x^2}+\frac {2 e^{x+x^2}}{1-x}-\frac {e^{2 x+x^2}}{1-x}-2 e^{x+x^2} x+e^{2 x+x^2} x-\frac {e^{x+x^2} \left (x+x^2-2 x^3\right ) \log (4)}{(1-x)^2 (1+2 x)}+4 \int \frac {e^{x+x^2}}{-1+x} \, dx+2 \left (6 \int \frac {e^{x+x^2}}{-1+x} \, dx\right )-16 \int \frac {e^{x+x^2}}{-1+x} \, dx\\ \end {aligned} \end {gather*}
________________________________________________________________________________________
Mathematica [A] time = 0.82, size = 24, normalized size = 0.96 \begin {gather*} \frac {e^{x+x^2} x \left (\left (-2+e^x\right ) x+\log (4)\right )}{-1+x} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
fricas [A] time = 0.76, size = 29, normalized size = 1.16 \begin {gather*} \frac {{\left (x^{2} e^{x} - 2 \, x^{2} + 2 \, x \log \relax (2)\right )} e^{\left (x^{2} + x\right )}}{x - 1} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [A] time = 0.31, size = 41, normalized size = 1.64 \begin {gather*} \frac {x^{2} e^{\left (x^{2} + 2 \, x\right )} - 2 \, x^{2} e^{\left (x^{2} + x\right )} + 2 \, x e^{\left (x^{2} + x\right )} \log \relax (2)}{x - 1} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [A] time = 0.12, size = 26, normalized size = 1.04
method | result | size |
risch | \(\frac {\left (2 \ln \relax (2)-2 x +{\mathrm e}^{x} x \right ) {\mathrm e}^{\left (x +1\right ) x} x}{x -1}\) | \(26\) |
norman | \(\frac {{\mathrm e}^{x} x^{2} {\mathrm e}^{x^{2}+x}-2 x^{2} {\mathrm e}^{x^{2}+x}+2 x \ln \relax (2) {\mathrm e}^{x^{2}+x}}{x -1}\) | \(42\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maxima [A] time = 0.62, size = 32, normalized size = 1.28 \begin {gather*} \frac {{\left (x^{2} e^{\left (2 \, x\right )} - 2 \, {\left (x^{2} - x \log \relax (2)\right )} e^{x}\right )} e^{\left (x^{2}\right )}}{x - 1} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [B] time = 0.44, size = 40, normalized size = 1.60 \begin {gather*} \frac {x^2\,{\mathrm {e}}^{x^2+2\,x}-2\,x^2\,{\mathrm {e}}^{x^2+x}+x\,{\mathrm {e}}^{x^2+x}\,\ln \relax (4)}{x-1} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
sympy [A] time = 0.23, size = 27, normalized size = 1.08 \begin {gather*} \frac {\left (x^{2} e^{x} - 2 x^{2} + 2 x \log {\relax (2 )}\right ) e^{x^{2} + x}}{x - 1} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________