Optimal. Leaf size=38 \[ e^{-x} \left (x+\log \left (3+e^{-2 e^x-2 x-2 x \left (-\frac {2}{x}+2 x\right )} x^2\right )\right ) \]
________________________________________________________________________________________
Rubi [A] time = 4.76, antiderivative size = 40, normalized size of antiderivative = 1.05, number of steps used = 13, number of rules used = 5, integrand size = 143, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.035, Rules used = {6742, 2194, 2176, 2554, 12} \begin {gather*} e^{-x} \log \left (e^{2 \left (-2 x^2-x-e^x+2\right )} x^2+3\right )+e^{-x} x \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 12
Rule 2176
Rule 2194
Rule 2554
Rule 6742
Rubi steps
\begin {gather*} \begin {aligned} \text {integral} &=\int \left (-\frac {2 e^{4-x} x \left (-1+x+e^x x+4 x^2\right )}{3 e^{2 e^x+2 x+4 x^2}+e^4 x^2}-e^{-x} \left (-1+x+\log \left (3+e^{-2 \left (-2+e^x+x+2 x^2\right )} x^2\right )\right )\right ) \, dx\\ &=-\left (2 \int \frac {e^{4-x} x \left (-1+x+e^x x+4 x^2\right )}{3 e^{2 e^x+2 x+4 x^2}+e^4 x^2} \, dx\right )-\int e^{-x} \left (-1+x+\log \left (3+e^{-2 \left (-2+e^x+x+2 x^2\right )} x^2\right )\right ) \, dx\\ &=-\left (2 \int \left (-\frac {e^{4-x} x}{3 e^{2 e^x+2 x+4 x^2}+e^4 x^2}+\frac {e^4 x^2}{3 e^{2 e^x+2 x+4 x^2}+e^4 x^2}+\frac {e^{4-x} x^2}{3 e^{2 e^x+2 x+4 x^2}+e^4 x^2}+\frac {4 e^{4-x} x^3}{3 e^{2 e^x+2 x+4 x^2}+e^4 x^2}\right ) \, dx\right )-\int \left (-e^{-x}+e^{-x} x+e^{-x} \log \left (3+e^{-2 \left (-2+e^x+x+2 x^2\right )} x^2\right )\right ) \, dx\\ &=2 \int \frac {e^{4-x} x}{3 e^{2 e^x+2 x+4 x^2}+e^4 x^2} \, dx-2 \int \frac {e^{4-x} x^2}{3 e^{2 e^x+2 x+4 x^2}+e^4 x^2} \, dx-8 \int \frac {e^{4-x} x^3}{3 e^{2 e^x+2 x+4 x^2}+e^4 x^2} \, dx-\left (2 e^4\right ) \int \frac {x^2}{3 e^{2 e^x+2 x+4 x^2}+e^4 x^2} \, dx+\int e^{-x} \, dx-\int e^{-x} x \, dx-\int e^{-x} \log \left (3+e^{-2 \left (-2+e^x+x+2 x^2\right )} x^2\right ) \, dx\\ &=-e^{-x}+e^{-x} x+e^{-x} \log \left (3+e^{2 \left (2-e^x-x-2 x^2\right )} x^2\right )+2 \int \frac {e^{4-x} x}{3 e^{2 e^x+2 x+4 x^2}+e^4 x^2} \, dx-2 \int \frac {e^{4-x} x^2}{3 e^{2 e^x+2 x+4 x^2}+e^4 x^2} \, dx-8 \int \frac {e^{4-x} x^3}{3 e^{2 e^x+2 x+4 x^2}+e^4 x^2} \, dx-\left (2 e^4\right ) \int \frac {x^2}{3 e^{2 e^x+2 x+4 x^2}+e^4 x^2} \, dx-\int e^{-x} \, dx+\int \frac {2 e^{4-x} x \left (-1+x+e^x x+4 x^2\right )}{3 e^{2 \left (e^x+x+2 x^2\right )}+e^4 x^2} \, dx\\ &=e^{-x} x+e^{-x} \log \left (3+e^{2 \left (2-e^x-x-2 x^2\right )} x^2\right )+2 \int \frac {e^{4-x} x \left (-1+x+e^x x+4 x^2\right )}{3 e^{2 \left (e^x+x+2 x^2\right )}+e^4 x^2} \, dx+2 \int \frac {e^{4-x} x}{3 e^{2 e^x+2 x+4 x^2}+e^4 x^2} \, dx-2 \int \frac {e^{4-x} x^2}{3 e^{2 e^x+2 x+4 x^2}+e^4 x^2} \, dx-8 \int \frac {e^{4-x} x^3}{3 e^{2 e^x+2 x+4 x^2}+e^4 x^2} \, dx-\left (2 e^4\right ) \int \frac {x^2}{3 e^{2 e^x+2 x+4 x^2}+e^4 x^2} \, dx\\ &=e^{-x} x+e^{-x} \log \left (3+e^{2 \left (2-e^x-x-2 x^2\right )} x^2\right )+2 \int \frac {e^{4-x} x}{3 e^{2 e^x+2 x+4 x^2}+e^4 x^2} \, dx-2 \int \frac {e^{4-x} x^2}{3 e^{2 e^x+2 x+4 x^2}+e^4 x^2} \, dx+2 \int \left (-\frac {e^{4-x} x}{3 e^{2 e^x+2 x+4 x^2}+e^4 x^2}+\frac {e^4 x^2}{3 e^{2 e^x+2 x+4 x^2}+e^4 x^2}+\frac {e^{4-x} x^2}{3 e^{2 e^x+2 x+4 x^2}+e^4 x^2}+\frac {4 e^{4-x} x^3}{3 e^{2 e^x+2 x+4 x^2}+e^4 x^2}\right ) \, dx-8 \int \frac {e^{4-x} x^3}{3 e^{2 e^x+2 x+4 x^2}+e^4 x^2} \, dx-\left (2 e^4\right ) \int \frac {x^2}{3 e^{2 e^x+2 x+4 x^2}+e^4 x^2} \, dx\\ &=e^{-x} x+e^{-x} \log \left (3+e^{2 \left (2-e^x-x-2 x^2\right )} x^2\right )\\ \end {aligned} \end {gather*}
________________________________________________________________________________________
Mathematica [A] time = 0.30, size = 35, normalized size = 0.92 \begin {gather*} e^{-x} \left (2 e^x+x+\log \left (3+e^{-2 \left (-2+e^x+x+2 x^2\right )} x^2\right )\right ) \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
fricas [A] time = 0.67, size = 48, normalized size = 1.26 \begin {gather*} {\left (x + \log \left ({\left (x^{2} e^{x} + 3 \, e^{\left (4 \, x^{2} + 3 \, x + 2 \, e^{x} - 4\right )}\right )} e^{\left (-4 \, x^{2} - 3 \, x - 2 \, e^{x} + 4\right )}\right )\right )} e^{\left (-x\right )} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [A] time = 0.29, size = 39, normalized size = 1.03 \begin {gather*} -{\left (4 \, x^{2} + x - \log \left (x^{2} e^{4} + 3 \, e^{\left (4 \, x^{2} + 2 \, x + 2 \, e^{x}\right )}\right )\right )} e^{\left (-x\right )} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [C] time = 0.23, size = 429, normalized size = 11.29
method | result | size |
risch | \(-2 \,{\mathrm e}^{-x} \ln \left ({\mathrm e}^{{\mathrm e}^{x}+2 x^{2}+x -2}\right )+\frac {\left (-i \pi \,\mathrm {csgn}\left (i \left (3 \,{\mathrm e}^{2 \,{\mathrm e}^{x}+4 x^{2}+2 x -4}+x^{2}\right )\right ) \mathrm {csgn}\left (i {\mathrm e}^{-2 \,{\mathrm e}^{x}-4 x^{2}-2 x +4}\right ) \mathrm {csgn}\left (i {\mathrm e}^{-2 \,{\mathrm e}^{x}-4 x^{2}-2 x +4} \left (3 \,{\mathrm e}^{2 \,{\mathrm e}^{x}+4 x^{2}+2 x -4}+x^{2}\right )\right )+i \pi \,\mathrm {csgn}\left (i \left (3 \,{\mathrm e}^{2 \,{\mathrm e}^{x}+4 x^{2}+2 x -4}+x^{2}\right )\right ) \mathrm {csgn}\left (i {\mathrm e}^{-2 \,{\mathrm e}^{x}-4 x^{2}-2 x +4} \left (3 \,{\mathrm e}^{2 \,{\mathrm e}^{x}+4 x^{2}+2 x -4}+x^{2}\right )\right )^{2}+i \pi \,\mathrm {csgn}\left (i {\mathrm e}^{-2 \,{\mathrm e}^{x}-4 x^{2}-2 x +4}\right ) \mathrm {csgn}\left (i {\mathrm e}^{-2 \,{\mathrm e}^{x}-4 x^{2}-2 x +4} \left (3 \,{\mathrm e}^{2 \,{\mathrm e}^{x}+4 x^{2}+2 x -4}+x^{2}\right )\right )^{2}+i \pi \mathrm {csgn}\left (i {\mathrm e}^{{\mathrm e}^{x}+2 x^{2}+x -2}\right )^{2} \mathrm {csgn}\left (i {\mathrm e}^{2 \,{\mathrm e}^{x}+4 x^{2}+2 x -4}\right )-2 i \pi \,\mathrm {csgn}\left (i {\mathrm e}^{{\mathrm e}^{x}+2 x^{2}+x -2}\right ) \mathrm {csgn}\left (i {\mathrm e}^{2 \,{\mathrm e}^{x}+4 x^{2}+2 x -4}\right )^{2}+i \pi \mathrm {csgn}\left (i {\mathrm e}^{2 \,{\mathrm e}^{x}+4 x^{2}+2 x -4}\right )^{3}-i \pi \mathrm {csgn}\left (i {\mathrm e}^{-2 \,{\mathrm e}^{x}-4 x^{2}-2 x +4} \left (3 \,{\mathrm e}^{2 \,{\mathrm e}^{x}+4 x^{2}+2 x -4}+x^{2}\right )\right )^{3}+2 x +2 \ln \left (3 \,{\mathrm e}^{2 \,{\mathrm e}^{x}+4 x^{2}+2 x -4}+x^{2}\right )\right ) {\mathrm e}^{-x}}{2}\) | \(429\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maxima [A] time = 0.61, size = 39, normalized size = 1.03 \begin {gather*} -{\left (4 \, x^{2} + x - \log \left (x^{2} e^{4} + 3 \, e^{\left (4 \, x^{2} + 2 \, x + 2 \, e^{x}\right )}\right )\right )} e^{\left (-x\right )} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [F] time = 0.00, size = -1, normalized size = -0.03 \begin {gather*} \int -\frac {2\,x^2\,{\mathrm {e}}^x-2\,x+\ln \left ({\mathrm {e}}^{4-2\,{\mathrm {e}}^x-4\,x^2-2\,x}\,\left (3\,{\mathrm {e}}^{2\,x+2\,{\mathrm {e}}^x+4\,x^2-4}+x^2\right )\right )\,\left (3\,{\mathrm {e}}^{2\,x+2\,{\mathrm {e}}^x+4\,x^2-4}+x^2\right )+{\mathrm {e}}^{2\,x+2\,{\mathrm {e}}^x+4\,x^2-4}\,\left (3\,x-3\right )+x^2+9\,x^3}{x^2\,{\mathrm {e}}^x+3\,{\mathrm {e}}^{2\,x+2\,{\mathrm {e}}^x+4\,x^2-4}\,{\mathrm {e}}^x} \,d x \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
sympy [A] time = 0.86, size = 48, normalized size = 1.26 \begin {gather*} x e^{- x} + e^{- x} \log {\left (\left (x^{2} + 3 e^{4 x^{2} + 2 x + 2 e^{x} - 4}\right ) e^{- 4 x^{2} - 2 x - 2 e^{x} + 4} \right )} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________