Optimal. Leaf size=24 \[ 3+e^{x^2} (-2+x)-x^2+x \log ^2(-1+x) \]
________________________________________________________________________________________
Rubi [A] time = 0.24, antiderivative size = 39, normalized size of antiderivative = 1.62, number of steps used = 15, number of rules used = 11, integrand size = 78, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.141, Rules used = {6688, 2226, 2204, 2209, 2212, 2411, 2346, 2301, 2295, 2389, 2296} \begin {gather*} -x^2+e^{x^2} x-2 e^{x^2}-(1-x) \log ^2(x-1)+\log ^2(x-1) \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 2204
Rule 2209
Rule 2212
Rule 2226
Rule 2295
Rule 2296
Rule 2301
Rule 2346
Rule 2389
Rule 2411
Rule 6688
Rubi steps
\begin {gather*} \begin {aligned} \text {integral} &=\int \left (-2 x+e^{x^2} \left (1-4 x+2 x^2\right )+\frac {2 x \log (-1+x)}{-1+x}+\log ^2(-1+x)\right ) \, dx\\ &=-x^2+2 \int \frac {x \log (-1+x)}{-1+x} \, dx+\int e^{x^2} \left (1-4 x+2 x^2\right ) \, dx+\int \log ^2(-1+x) \, dx\\ &=-x^2+2 \operatorname {Subst}\left (\int \frac {(1+x) \log (x)}{x} \, dx,x,-1+x\right )+\int \left (e^{x^2}-4 e^{x^2} x+2 e^{x^2} x^2\right ) \, dx+\operatorname {Subst}\left (\int \log ^2(x) \, dx,x,-1+x\right )\\ &=-x^2+(-1+x) \log ^2(-1+x)+2 \int e^{x^2} x^2 \, dx+2 \operatorname {Subst}\left (\int \frac {\log (x)}{x} \, dx,x,-1+x\right )-4 \int e^{x^2} x \, dx+\int e^{x^2} \, dx\\ &=-2 e^{x^2}+e^{x^2} x-x^2+\frac {1}{2} \sqrt {\pi } \text {erfi}(x)+\log ^2(-1+x)+(-1+x) \log ^2(-1+x)-\int e^{x^2} \, dx\\ &=-2 e^{x^2}+e^{x^2} x-x^2+\log ^2(-1+x)+(-1+x) \log ^2(-1+x)\\ \end {aligned} \end {gather*}
________________________________________________________________________________________
Mathematica [A] time = 0.03, size = 23, normalized size = 0.96 \begin {gather*} e^{x^2} (-2+x)-x^2+x \log ^2(-1+x) \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
fricas [A] time = 1.01, size = 23, normalized size = 0.96 \begin {gather*} x \log \left (x - 1\right )^{2} - x^{2} + e^{\left (x^{2} + \log \left (x - 2\right )\right )} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [A] time = 0.16, size = 26, normalized size = 1.08 \begin {gather*} x \log \left (x - 1\right )^{2} - x^{2} + x e^{\left (x^{2}\right )} - 2 \, e^{\left (x^{2}\right )} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [A] time = 0.17, size = 23, normalized size = 0.96
method | result | size |
risch | \(\ln \left (x -1\right )^{2} x -x^{2}+\left (x -2\right ) {\mathrm e}^{x^{2}}\) | \(23\) |
default | \(\left (x -1\right ) \ln \left (x -1\right )^{2}-2 \,{\mathrm e}^{x^{2}}+{\mathrm e}^{x^{2}} x -x^{2}+\ln \left (x -1\right )^{2}\) | \(35\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maxima [A] time = 0.42, size = 22, normalized size = 0.92 \begin {gather*} x \log \left (x - 1\right )^{2} - x^{2} + {\left (x - 2\right )} e^{\left (x^{2}\right )} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [B] time = 0.45, size = 26, normalized size = 1.08 \begin {gather*} x\,{\mathrm {e}}^{x^2}-2\,{\mathrm {e}}^{x^2}+x\,{\ln \left (x-1\right )}^2-x^2 \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
sympy [A] time = 0.34, size = 19, normalized size = 0.79 \begin {gather*} - x^{2} + x \log {\left (x - 1 \right )}^{2} + \left (x - 2\right ) e^{x^{2}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________