Optimal. Leaf size=24 \[ \frac {\left (e^{(-4+x)^2}+x\right )^2 \left (16+\frac {x}{e^4}\right )^2}{x^2} \]
________________________________________________________________________________________
Rubi [C] time = 0.84, antiderivative size = 209, normalized size of antiderivative = 8.71, number of steps used = 23, number of rules used = 11, integrand size = 137, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.080, Rules used = {12, 14, 2288, 6742, 2227, 2204, 2242, 2234, 2226, 2209, 2212} \begin {gather*} -\frac {\left (1-256 e^4+512 e^8\right ) \sqrt {\pi } \text {erfi}(4-x)}{e^8}+\frac {32 \left (1-8 e^4\right ) \sqrt {\pi } \text {erfi}(4-x)}{e^8}-\frac {31 \sqrt {\pi } \text {erfi}(4-x)}{e^8}+512 \sqrt {\pi } \text {erfi}(4-x)+\frac {512 e^{x^2-8 x+16}}{x}+\frac {e^{2 (4-x)^2-8} \left (-x^3+4 \left (1-4 e^4\right ) x^2+64 e^4 x\right ) \left (x+16 e^4\right )}{(4-x) x^3}+\frac {\left (x+16 e^4\right )^2}{e^8}+16 e^{(x-4)^2-8}-2 e^{(x-4)^2-8} (4-x)-8 \left (1-8 e^4\right ) e^{(x-4)^2-8} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 12
Rule 14
Rule 2204
Rule 2209
Rule 2212
Rule 2226
Rule 2227
Rule 2234
Rule 2242
Rule 2288
Rule 6742
Rubi steps
\begin {gather*} \begin {aligned} \text {integral} &=\frac {\int \frac {32 e^4 x^3+2 x^4+e^{32-16 x+2 x^2} \left (-16 x^3+4 x^4+e^8 \left (-512-4096 x+1024 x^2\right )+e^4 \left (-32 x-512 x^2+128 x^3\right )\right )+e^{16-8 x+x^2} \left (2 x^3-16 x^4+4 x^5+e^8 \left (-512 x-4096 x^2+1024 x^3\right )+e^4 \left (-512 x^3+128 x^4\right )\right )}{x^3} \, dx}{e^8}\\ &=\frac {\int \left (2 \left (16 e^4+x\right )+\frac {4 e^{2 (-4+x)^2} \left (16 e^4+x\right ) \left (-8 e^4-64 e^4 x-4 \left (1-4 e^4\right ) x^2+x^3\right )}{x^3}+\frac {2 e^{16-8 x+x^2} \left (16 e^4+x\right ) \left (-16 e^4+\left (1-128 e^4\right ) x-8 \left (1-4 e^4\right ) x^2+2 x^3\right )}{x^2}\right ) \, dx}{e^8}\\ &=\frac {\left (16 e^4+x\right )^2}{e^8}+\frac {2 \int \frac {e^{16-8 x+x^2} \left (16 e^4+x\right ) \left (-16 e^4+\left (1-128 e^4\right ) x-8 \left (1-4 e^4\right ) x^2+2 x^3\right )}{x^2} \, dx}{e^8}+\frac {4 \int \frac {e^{2 (-4+x)^2} \left (16 e^4+x\right ) \left (-8 e^4-64 e^4 x-4 \left (1-4 e^4\right ) x^2+x^3\right )}{x^3} \, dx}{e^8}\\ &=\frac {\left (16 e^4+x\right )^2}{e^8}+\frac {e^{-8+2 (4-x)^2} \left (16 e^4+x\right ) \left (64 e^4 x+4 \left (1-4 e^4\right ) x^2-x^3\right )}{(4-x) x^3}+\frac {2 \int \left (e^{16-8 x+x^2} \left (1+256 e^4 \left (-1+2 e^4\right )\right )-\frac {256 e^{24-8 x+x^2}}{x^2}-\frac {2048 e^{24-8 x+x^2}}{x}+8 e^{16-8 x+x^2} \left (-1+8 e^4\right ) x+2 e^{16-8 x+x^2} x^2\right ) \, dx}{e^8}\\ &=\frac {\left (16 e^4+x\right )^2}{e^8}+\frac {e^{-8+2 (4-x)^2} \left (16 e^4+x\right ) \left (64 e^4 x+4 \left (1-4 e^4\right ) x^2-x^3\right )}{(4-x) x^3}+\frac {4 \int e^{16-8 x+x^2} x^2 \, dx}{e^8}-\frac {512 \int \frac {e^{24-8 x+x^2}}{x^2} \, dx}{e^8}-\frac {4096 \int \frac {e^{24-8 x+x^2}}{x} \, dx}{e^8}-\frac {\left (16 \left (1-8 e^4\right )\right ) \int e^{16-8 x+x^2} x \, dx}{e^8}+\frac {\left (2 \left (1-256 e^4+512 e^8\right )\right ) \int e^{16-8 x+x^2} \, dx}{e^8}\\ &=\frac {512 e^{16-8 x+x^2}}{x}+\frac {\left (16 e^4+x\right )^2}{e^8}+\frac {e^{-8+2 (4-x)^2} \left (16 e^4+x\right ) \left (64 e^4 x+4 \left (1-4 e^4\right ) x^2-x^3\right )}{(4-x) x^3}+\frac {4 \int e^{(-4+x)^2} x^2 \, dx}{e^8}-\frac {1024 \int e^{24-8 x+x^2} \, dx}{e^8}-\frac {\left (16 \left (1-8 e^4\right )\right ) \int e^{(-4+x)^2} x \, dx}{e^8}+\frac {\left (2 \left (1-256 e^4+512 e^8\right )\right ) \int e^{(-4+x)^2} \, dx}{e^8}\\ &=\frac {512 e^{16-8 x+x^2}}{x}+\frac {\left (16 e^4+x\right )^2}{e^8}+\frac {e^{-8+2 (4-x)^2} \left (16 e^4+x\right ) \left (64 e^4 x+4 \left (1-4 e^4\right ) x^2-x^3\right )}{(4-x) x^3}-\frac {\left (1-256 e^4+512 e^8\right ) \sqrt {\pi } \text {erfi}(4-x)}{e^8}-1024 \int e^{\frac {1}{4} (-8+2 x)^2} \, dx+\frac {4 \int \left (16 e^{(-4+x)^2}+8 e^{(-4+x)^2} (-4+x)+e^{(-4+x)^2} (-4+x)^2\right ) \, dx}{e^8}-\frac {\left (16 \left (1-8 e^4\right )\right ) \int \left (4 e^{(-4+x)^2}+e^{(-4+x)^2} (-4+x)\right ) \, dx}{e^8}\\ &=\frac {512 e^{16-8 x+x^2}}{x}+\frac {\left (16 e^4+x\right )^2}{e^8}+\frac {e^{-8+2 (4-x)^2} \left (16 e^4+x\right ) \left (64 e^4 x+4 \left (1-4 e^4\right ) x^2-x^3\right )}{(4-x) x^3}+512 \sqrt {\pi } \text {erfi}(4-x)-\frac {\left (1-256 e^4+512 e^8\right ) \sqrt {\pi } \text {erfi}(4-x)}{e^8}+\frac {4 \int e^{(-4+x)^2} (-4+x)^2 \, dx}{e^8}+\frac {32 \int e^{(-4+x)^2} (-4+x) \, dx}{e^8}+\frac {64 \int e^{(-4+x)^2} \, dx}{e^8}-\frac {\left (16 \left (1-8 e^4\right )\right ) \int e^{(-4+x)^2} (-4+x) \, dx}{e^8}-\frac {\left (64 \left (1-8 e^4\right )\right ) \int e^{(-4+x)^2} \, dx}{e^8}\\ &=16 e^{-8+(-4+x)^2}-8 e^{-8+(-4+x)^2} \left (1-8 e^4\right )-2 e^{-8+(-4+x)^2} (4-x)+\frac {512 e^{16-8 x+x^2}}{x}+\frac {\left (16 e^4+x\right )^2}{e^8}+\frac {e^{-8+2 (4-x)^2} \left (16 e^4+x\right ) \left (64 e^4 x+4 \left (1-4 e^4\right ) x^2-x^3\right )}{(4-x) x^3}+512 \sqrt {\pi } \text {erfi}(4-x)-\frac {32 \sqrt {\pi } \text {erfi}(4-x)}{e^8}+\frac {32 \left (1-8 e^4\right ) \sqrt {\pi } \text {erfi}(4-x)}{e^8}-\frac {\left (1-256 e^4+512 e^8\right ) \sqrt {\pi } \text {erfi}(4-x)}{e^8}-\frac {2 \int e^{(-4+x)^2} \, dx}{e^8}\\ &=16 e^{-8+(-4+x)^2}-8 e^{-8+(-4+x)^2} \left (1-8 e^4\right )-2 e^{-8+(-4+x)^2} (4-x)+\frac {512 e^{16-8 x+x^2}}{x}+\frac {\left (16 e^4+x\right )^2}{e^8}+\frac {e^{-8+2 (4-x)^2} \left (16 e^4+x\right ) \left (64 e^4 x+4 \left (1-4 e^4\right ) x^2-x^3\right )}{(4-x) x^3}+512 \sqrt {\pi } \text {erfi}(4-x)-\frac {31 \sqrt {\pi } \text {erfi}(4-x)}{e^8}+\frac {32 \left (1-8 e^4\right ) \sqrt {\pi } \text {erfi}(4-x)}{e^8}-\frac {\left (1-256 e^4+512 e^8\right ) \sqrt {\pi } \text {erfi}(4-x)}{e^8}\\ \end {aligned} \end {gather*}
________________________________________________________________________________________
Mathematica [B] time = 0.20, size = 57, normalized size = 2.38 \begin {gather*} \frac {32 e^4 x^3+x^4+e^{2 (-4+x)^2} \left (16 e^4+x\right )^2+2 e^{(-4+x)^2} x \left (16 e^4+x\right )^2}{e^8 x^2} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
fricas [B] time = 1.21, size = 69, normalized size = 2.88 \begin {gather*} \frac {{\left (x^{4} + 32 \, x^{3} e^{4} + {\left (x^{2} + 32 \, x e^{4} + 256 \, e^{8}\right )} e^{\left (2 \, x^{2} - 16 \, x + 32\right )} + 2 \, {\left (x^{3} + 32 \, x^{2} e^{4} + 256 \, x e^{8}\right )} e^{\left (x^{2} - 8 \, x + 16\right )}\right )} e^{\left (-8\right )}}{x^{2}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [B] time = 0.48, size = 99, normalized size = 4.12 \begin {gather*} \frac {{\left (x^{4} + 32 \, x^{3} e^{4} + 2 \, x^{3} e^{\left (x^{2} - 8 \, x + 16\right )} + x^{2} e^{\left (2 \, x^{2} - 16 \, x + 32\right )} + 64 \, x^{2} e^{\left (x^{2} - 8 \, x + 20\right )} + 32 \, x e^{\left (2 \, x^{2} - 16 \, x + 36\right )} + 512 \, x e^{\left (x^{2} - 8 \, x + 24\right )} + 256 \, e^{\left (2 \, x^{2} - 16 \, x + 40\right )}\right )} e^{\left (-8\right )}}{x^{2}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [B] time = 0.17, size = 66, normalized size = 2.75
method | result | size |
risch | \(32 x \,{\mathrm e}^{-4}+{\mathrm e}^{-8} x^{2}+\frac {\left (256 \,{\mathrm e}^{8}+32 x \,{\mathrm e}^{4}+x^{2}\right ) {\mathrm e}^{2 \left (x -2\right ) \left (x -6\right )}}{x^{2}}+\frac {2 \left (256 \,{\mathrm e}^{8}+32 x \,{\mathrm e}^{4}+x^{2}\right ) {\mathrm e}^{x^{2}-8 x +8}}{x}\) | \(66\) |
norman | \(\frac {\left ({\mathrm e}^{-2} x^{4}+x^{2} {\mathrm e}^{-2} {\mathrm e}^{2 x^{2}-16 x +32}+32 x^{3} {\mathrm e}^{2}+256 \,{\mathrm e}^{6} {\mathrm e}^{2 x^{2}-16 x +32}+512 x \,{\mathrm e}^{6} {\mathrm e}^{x^{2}-8 x +16}+64 x^{2} {\mathrm e}^{2} {\mathrm e}^{x^{2}-8 x +16}+2 \,{\mathrm e}^{-2} x^{3} {\mathrm e}^{x^{2}-8 x +16}+32 \,{\mathrm e}^{2} x \,{\mathrm e}^{2 x^{2}-16 x +32}\right ) {\mathrm e}^{-6}}{x^{2}}\) | \(127\) |
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*} -{\left (512 i \, \sqrt {\pi } \operatorname {erf}\left (i \, x - 4 i\right ) e^{8} - 256 i \, \sqrt {\pi } \operatorname {erf}\left (i \, x - 4 i\right ) e^{4} + \frac {2 \, {\left (x - 4\right )}^{3} \Gamma \left (\frac {3}{2}, -{\left (x - 4\right )}^{2}\right )}{\left (-{\left (x - 4\right )}^{2}\right )^{\frac {3}{2}}} - x^{2} - 64 \, {\left (\frac {4 \, \sqrt {\pi } {\left (x - 4\right )} {\left (\operatorname {erf}\left (\sqrt {-{\left (x - 4\right )}^{2}}\right ) - 1\right )}}{\sqrt {-{\left (x - 4\right )}^{2}}} + e^{\left ({\left (x - 4\right )}^{2}\right )}\right )} e^{4} - 32 \, x e^{4} + i \, \sqrt {\pi } \operatorname {erf}\left (i \, x - 4 i\right ) - \frac {{\left (x^{2} e^{32} + 32 \, x e^{36} + 256 \, e^{40}\right )} e^{\left (2 \, x^{2} - 16 \, x\right )}}{x^{2}} - 8 \, e^{\left ({\left (x - 4\right )}^{2}\right )} + 2 \, \int \frac {256 \, {\left (8 \, x e^{24} + e^{24}\right )} e^{\left (x^{2} - 8 \, x\right )}}{x^{2}}\,{d x}\right )} e^{\left (-8\right )} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [B] time = 0.53, size = 110, normalized size = 4.58 \begin {gather*} {\mathrm {e}}^{-16\,x-8}\,\left (64\,{\mathrm {e}}^{x^2+8\,x+20}+{\mathrm {e}}^{2\,x^2+32}\right )+x^2\,{\mathrm {e}}^{-8}+\frac {256\,{\mathrm {e}}^{2\,x^2-16\,x+32}+x\,{\mathrm {e}}^{-16\,x-8}\,\left (512\,{\mathrm {e}}^{x^2+8\,x+24}+32\,{\mathrm {e}}^{2\,x^2+36}\right )}{x^2}+x\,{\mathrm {e}}^{-16\,x-8}\,\left (2\,{\mathrm {e}}^{x^2+8\,x+16}+32\,{\mathrm {e}}^{16\,x+4}\right ) \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
sympy [B] time = 0.27, size = 88, normalized size = 3.67 \begin {gather*} \frac {x^{2}}{e^{8}} + \frac {32 x}{e^{4}} + \frac {\left (x^{3} e^{8} + 32 x^{2} e^{12} + 256 x e^{16}\right ) e^{2 x^{2} - 16 x + 32} + \left (2 x^{4} e^{8} + 64 x^{3} e^{12} + 512 x^{2} e^{16}\right ) e^{x^{2} - 8 x + 16}}{x^{3} e^{16}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________