Optimal. Leaf size=28 \[ -4+\left (-e^{x^2}+x\right ) \log \left (-x+\frac {2+2 x^2}{x}\right ) \]
________________________________________________________________________________________
Rubi [A] time = 1.30, antiderivative size = 30, normalized size of antiderivative = 1.07, number of steps used = 22, number of rules used = 10, integrand size = 65, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.154, Rules used = {1593, 6688, 6725, 388, 203, 2210, 6715, 2178, 2209, 2554} \begin {gather*} x \log \left (\frac {x^2+2}{x}\right )-e^{x^2} \log \left (\frac {x^2+2}{x}\right ) \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 203
Rule 388
Rule 1593
Rule 2178
Rule 2209
Rule 2210
Rule 2554
Rule 6688
Rule 6715
Rule 6725
Rubi steps
\begin {gather*} \begin {aligned} \text {integral} &=\int \frac {-2 x+x^3+e^{x^2} \left (2-x^2\right )+\left (2 x+x^3+e^{x^2} \left (-4 x^2-2 x^4\right )\right ) \log \left (\frac {2+x^2}{x}\right )}{x \left (2+x^2\right )} \, dx\\ &=\int \left (\frac {\left (-e^{x^2}+x\right ) \left (-2+x^2\right )}{x \left (2+x^2\right )}+\left (1-2 e^{x^2} x\right ) \log \left (\frac {2+x^2}{x}\right )\right ) \, dx\\ &=\int \frac {\left (-e^{x^2}+x\right ) \left (-2+x^2\right )}{x \left (2+x^2\right )} \, dx+\int \left (1-2 e^{x^2} x\right ) \log \left (\frac {2+x^2}{x}\right ) \, dx\\ &=-e^{x^2} \log \left (\frac {2+x^2}{x}\right )+x \log \left (\frac {2+x^2}{x}\right )-\int \frac {\left (e^{x^2}-x\right ) \left (2-x^2\right )}{x \left (2+x^2\right )} \, dx+\int \left (\frac {-2+x^2}{2+x^2}-\frac {e^{x^2} \left (-2+x^2\right )}{x \left (2+x^2\right )}\right ) \, dx\\ &=-e^{x^2} \log \left (\frac {2+x^2}{x}\right )+x \log \left (\frac {2+x^2}{x}\right )+\int \frac {-2+x^2}{2+x^2} \, dx-\int \frac {e^{x^2} \left (-2+x^2\right )}{x \left (2+x^2\right )} \, dx-\int \left (\frac {-2+x^2}{2+x^2}-\frac {e^{x^2} \left (-2+x^2\right )}{x \left (2+x^2\right )}\right ) \, dx\\ &=x-e^{x^2} \log \left (\frac {2+x^2}{x}\right )+x \log \left (\frac {2+x^2}{x}\right )-4 \int \frac {1}{2+x^2} \, dx-\int \frac {-2+x^2}{2+x^2} \, dx+\int \frac {e^{x^2} \left (-2+x^2\right )}{x \left (2+x^2\right )} \, dx-\int \left (-\frac {e^{x^2}}{x}+\frac {2 e^{x^2} x}{2+x^2}\right ) \, dx\\ &=-2 \sqrt {2} \tan ^{-1}\left (\frac {x}{\sqrt {2}}\right )-e^{x^2} \log \left (\frac {2+x^2}{x}\right )+x \log \left (\frac {2+x^2}{x}\right )-2 \int \frac {e^{x^2} x}{2+x^2} \, dx+4 \int \frac {1}{2+x^2} \, dx+\int \frac {e^{x^2}}{x} \, dx+\int \left (-\frac {e^{x^2}}{x}+\frac {2 e^{x^2} x}{2+x^2}\right ) \, dx\\ &=\frac {\text {Ei}\left (x^2\right )}{2}-e^{x^2} \log \left (\frac {2+x^2}{x}\right )+x \log \left (\frac {2+x^2}{x}\right )+2 \int \frac {e^{x^2} x}{2+x^2} \, dx-\int \frac {e^{x^2}}{x} \, dx-\operatorname {Subst}\left (\int \frac {e^x}{2+x} \, dx,x,x^2\right )\\ &=-\frac {\text {Ei}\left (2+x^2\right )}{e^2}-e^{x^2} \log \left (\frac {2+x^2}{x}\right )+x \log \left (\frac {2+x^2}{x}\right )+\operatorname {Subst}\left (\int \frac {e^x}{2+x} \, dx,x,x^2\right )\\ &=-e^{x^2} \log \left (\frac {2+x^2}{x}\right )+x \log \left (\frac {2+x^2}{x}\right )\\ \end {aligned} \end {gather*}
________________________________________________________________________________________
Mathematica [A] time = 0.15, size = 18, normalized size = 0.64 \begin {gather*} \left (-e^{x^2}+x\right ) \log \left (\frac {2}{x}+x\right ) \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
fricas [A] time = 0.68, size = 19, normalized size = 0.68 \begin {gather*} {\left (x - e^{\left (x^{2}\right )}\right )} \log \left (\frac {x^{2} + 2}{x}\right ) \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [A] time = 0.21, size = 29, normalized size = 1.04 \begin {gather*} x \log \left (\frac {x^{2} + 2}{x}\right ) - e^{\left (x^{2}\right )} \log \left (\frac {x^{2} + 2}{x}\right ) \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [A] time = 0.37, size = 30, normalized size = 1.07
method | result | size |
default | \(-\ln \left (\frac {x^{2}+2}{x}\right ) {\mathrm e}^{x^{2}}+\ln \left (\frac {x^{2}+2}{x}\right ) x\) | \(30\) |
norman | \(-\ln \left (\frac {x^{2}+2}{x}\right ) {\mathrm e}^{x^{2}}+\ln \left (\frac {x^{2}+2}{x}\right ) x\) | \(30\) |
risch | \(\left (-{\mathrm e}^{x^{2}}+x \right ) \ln \left (x^{2}+2\right )-x \ln \relax (x )+{\mathrm e}^{x^{2}} \ln \relax (x )+\frac {i \pi x \,\mathrm {csgn}\left (i \left (x^{2}+2\right )\right ) \mathrm {csgn}\left (\frac {i \left (x^{2}+2\right )}{x}\right )^{2}}{2}-\frac {i \pi x \,\mathrm {csgn}\left (i \left (x^{2}+2\right )\right ) \mathrm {csgn}\left (\frac {i \left (x^{2}+2\right )}{x}\right ) \mathrm {csgn}\left (\frac {i}{x}\right )}{2}-\frac {i \pi x \mathrm {csgn}\left (\frac {i \left (x^{2}+2\right )}{x}\right )^{3}}{2}+\frac {i \pi x \mathrm {csgn}\left (\frac {i \left (x^{2}+2\right )}{x}\right )^{2} \mathrm {csgn}\left (\frac {i}{x}\right )}{2}-\frac {i \pi \,\mathrm {csgn}\left (i \left (x^{2}+2\right )\right ) \mathrm {csgn}\left (\frac {i \left (x^{2}+2\right )}{x}\right )^{2} {\mathrm e}^{x^{2}}}{2}+\frac {i \pi \,\mathrm {csgn}\left (i \left (x^{2}+2\right )\right ) \mathrm {csgn}\left (\frac {i \left (x^{2}+2\right )}{x}\right ) \mathrm {csgn}\left (\frac {i}{x}\right ) {\mathrm e}^{x^{2}}}{2}+\frac {i \pi \mathrm {csgn}\left (\frac {i \left (x^{2}+2\right )}{x}\right )^{3} {\mathrm e}^{x^{2}}}{2}-\frac {i \pi \mathrm {csgn}\left (\frac {i \left (x^{2}+2\right )}{x}\right )^{2} \mathrm {csgn}\left (\frac {i}{x}\right ) {\mathrm e}^{x^{2}}}{2}\) | \(253\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maxima [A] time = 0.52, size = 28, normalized size = 1.00 \begin {gather*} {\left (x - e^{\left (x^{2}\right )}\right )} \log \left (x^{2} + 2\right ) - x \log \relax (x) + e^{\left (x^{2}\right )} \log \relax (x) \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [B] time = 5.63, size = 19, normalized size = 0.68 \begin {gather*} \ln \left (\frac {x^2+2}{x}\right )\,\left (x-{\mathrm {e}}^{x^2}\right ) \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
sympy [A] time = 0.49, size = 22, normalized size = 0.79 \begin {gather*} x \log {\left (\frac {x^{2} + 2}{x} \right )} - e^{x^{2}} \log {\left (\frac {x^{2} + 2}{x} \right )} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________