Optimal. Leaf size=28 \[ -4+\left (-e^{x^2}+x\right ) \log \left (-x+\frac {2+2 x^2}{x}\right ) \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.87, 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 = {1607, 6820,
6857, 396, 209, 2241, 6847, 2209, 2240, 2634} \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 209
Rule 396
Rule 1607
Rule 2209
Rule 2240
Rule 2241
Rule 2634
Rule 6820
Rule 6847
Rule 6857
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-\text {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 )+\text {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.24, 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]
________________________________________________________________________________________
Maple [A]
time = 1.18, 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 \left (x \right )+{\mathrm e}^{x^{2}} \ln \left (x \right )+\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 \left (x\right ) + e^{\left (x^{2}\right )} \log \left (x\right ) \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 0.37, 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]
________________________________________________________________________________________
Sympy [A]
time = 0.17, 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]
________________________________________________________________________________________
Giac [A]
time = 0.43, 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]
________________________________________________________________________________________
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]
________________________________________________________________________________________