Optimal. Leaf size=30 \[ 2 x-\left (x+e^x x-\log (x)\right )^2-4 x^2 \log ^2\left (x^2\right ) \]
________________________________________________________________________________________
Rubi [A] time = 0.17, antiderivative size = 55, normalized size of antiderivative = 1.83, number of steps used = 20, number of rules used = 10, integrand size = 89, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.112, Rules used = {14, 2196, 2176, 2194, 2288, 2346, 2301, 2295, 2304, 2305} \begin {gather*} -e^{2 x} x^2-x^2-4 x^2 \log ^2\left (x^2\right )-2 e^x \left (x^2-x \log (x)\right )+2 x-\log ^2(x)+2 x \log (x) \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 14
Rule 2176
Rule 2194
Rule 2196
Rule 2288
Rule 2295
Rule 2301
Rule 2304
Rule 2305
Rule 2346
Rubi steps
\begin {gather*} \begin {aligned} \text {integral} &=\int \left (-2 e^{2 x} x (1+x)-2 e^x \left (-1+2 x+x^2-\log (x)-x \log (x)\right )-\frac {2 \left (-2 x+x^2+\log (x)-x \log (x)+8 x^2 \log \left (x^2\right )+4 x^2 \log ^2\left (x^2\right )\right )}{x}\right ) \, dx\\ &=-\left (2 \int e^{2 x} x (1+x) \, dx\right )-2 \int e^x \left (-1+2 x+x^2-\log (x)-x \log (x)\right ) \, dx-2 \int \frac {-2 x+x^2+\log (x)-x \log (x)+8 x^2 \log \left (x^2\right )+4 x^2 \log ^2\left (x^2\right )}{x} \, dx\\ &=-2 e^x \left (x^2-x \log (x)\right )-2 \int \left (e^{2 x} x+e^{2 x} x^2\right ) \, dx-2 \int \left (\frac {-2 x+x^2+\log (x)-x \log (x)}{x}+8 x \log \left (x^2\right )+4 x \log ^2\left (x^2\right )\right ) \, dx\\ &=-2 e^x \left (x^2-x \log (x)\right )-2 \int e^{2 x} x \, dx-2 \int e^{2 x} x^2 \, dx-2 \int \frac {-2 x+x^2+\log (x)-x \log (x)}{x} \, dx-8 \int x \log ^2\left (x^2\right ) \, dx-16 \int x \log \left (x^2\right ) \, dx\\ &=-e^{2 x} x+8 x^2-e^{2 x} x^2-2 e^x \left (x^2-x \log (x)\right )-8 x^2 \log \left (x^2\right )-4 x^2 \log ^2\left (x^2\right )+2 \int e^{2 x} x \, dx-2 \int \left (-2+x-\frac {(-1+x) \log (x)}{x}\right ) \, dx+16 \int x \log \left (x^2\right ) \, dx+\int e^{2 x} \, dx\\ &=\frac {e^{2 x}}{2}+4 x-x^2-e^{2 x} x^2-2 e^x \left (x^2-x \log (x)\right )-4 x^2 \log ^2\left (x^2\right )+2 \int \frac {(-1+x) \log (x)}{x} \, dx-\int e^{2 x} \, dx\\ &=4 x-x^2-e^{2 x} x^2-2 e^x \left (x^2-x \log (x)\right )-4 x^2 \log ^2\left (x^2\right )+2 \int \log (x) \, dx-2 \int \frac {\log (x)}{x} \, dx\\ &=2 x-x^2-e^{2 x} x^2+2 x \log (x)-\log ^2(x)-2 e^x \left (x^2-x \log (x)\right )-4 x^2 \log ^2\left (x^2\right )\\ \end {aligned} \end {gather*}
________________________________________________________________________________________
Mathematica [A] time = 0.16, size = 40, normalized size = 1.33 \begin {gather*} 2 \left (1+e^x\right ) x \log (x)-\log ^2(x)-x \left (-2+\left (1+e^x\right )^2 x+4 x \log ^2\left (x^2\right )\right ) \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
fricas [A] time = 0.73, size = 48, normalized size = 1.60 \begin {gather*} -x^{2} e^{\left (2 \, x\right )} - 2 \, x^{2} e^{x} - {\left (16 \, x^{2} + 1\right )} \log \relax (x)^{2} - x^{2} + 2 \, {\left (x e^{x} + x\right )} \log \relax (x) + 2 \, x \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [A] time = 0.17, size = 52, normalized size = 1.73 \begin {gather*} -16 \, x^{2} \log \relax (x)^{2} - x^{2} e^{\left (2 \, x\right )} - 2 \, x^{2} e^{x} + 2 \, x e^{x} \log \relax (x) - x^{2} + 2 \, x \log \relax (x) - \log \relax (x)^{2} + 2 \, x \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [A] time = 0.08, size = 55, normalized size = 1.83
method | result | size |
default | \(2 x -2 \,{\mathrm e}^{x} x^{2}+2 x \,{\mathrm e}^{x} \ln \relax (x )-x^{2}-4 x^{2} \ln \left (x^{2}\right )^{2}+2 x \ln \relax (x )-\ln \relax (x )^{2}-{\mathrm e}^{2 x} x^{2}\) | \(55\) |
risch | \(\left (-16 x^{2}-1\right ) \ln \relax (x )^{2}+\left (8 i x^{2} \pi \mathrm {csgn}\left (i x \right )^{2} \mathrm {csgn}\left (i x^{2}\right )-16 i x^{2} \pi \,\mathrm {csgn}\left (i x \right ) \mathrm {csgn}\left (i x^{2}\right )^{2}+8 i x^{2} \pi \mathrm {csgn}\left (i x^{2}\right )^{3}+2 x +2 \,{\mathrm e}^{x} x \right ) \ln \relax (x )+\pi ^{2} x^{2} \mathrm {csgn}\left (i x \right )^{4} \mathrm {csgn}\left (i x^{2}\right )^{2}-4 \pi ^{2} x^{2} \mathrm {csgn}\left (i x \right )^{3} \mathrm {csgn}\left (i x^{2}\right )^{3}+6 \pi ^{2} x^{2} \mathrm {csgn}\left (i x \right )^{2} \mathrm {csgn}\left (i x^{2}\right )^{4}-4 \pi ^{2} x^{2} \mathrm {csgn}\left (i x \right ) \mathrm {csgn}\left (i x^{2}\right )^{5}+\pi ^{2} x^{2} \mathrm {csgn}\left (i x^{2}\right )^{6}-{\mathrm e}^{2 x} x^{2}-2 \,{\mathrm e}^{x} x^{2}-x^{2}+2 x\) | \(217\) |
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*} -16 \, x^{2} \log \relax (x)^{2} + 2 \, {\left (x - 1\right )} e^{x} \log \relax (x) - x^{2} - \frac {1}{2} \, {\left (2 \, x^{2} - 2 \, x + 1\right )} e^{\left (2 \, x\right )} - \frac {1}{2} \, {\left (2 \, x - 1\right )} e^{\left (2 \, x\right )} - 2 \, {\left (x^{2} - 2 \, x + 2\right )} e^{x} - 4 \, {\left (x - 1\right )} e^{x} + 2 \, x \log \relax (x) + 2 \, e^{x} \log \relax (x) - \log \relax (x)^{2} + 2 \, x - 2 \, {\rm Ei}\relax (x) + 2 \, e^{x} - 2 \, \int \frac {{\left (x - 1\right )} e^{x}}{x}\,{d x} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [B] time = 5.28, size = 54, normalized size = 1.80 \begin {gather*} 2\,x-2\,x^2\,{\mathrm {e}}^x-{\ln \relax (x)}^2-x^2\,{\mathrm {e}}^{2\,x}+2\,x\,\ln \relax (x)-x^2-4\,x^2\,{\ln \left (x^2\right )}^2+2\,x\,{\mathrm {e}}^x\,\ln \relax (x) \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
sympy [A] time = 0.42, size = 49, normalized size = 1.63 \begin {gather*} - x^{2} e^{2 x} - x^{2} + 2 x \log {\relax (x )} + 2 x + \left (- 16 x^{2} - 1\right ) \log {\relax (x )}^{2} + \left (- 2 x^{2} + 2 x \log {\relax (x )}\right ) e^{x} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________