Optimal. Leaf size=29 \[ \frac {2}{x}-\frac {2 \left (-3+x+2 \left (-e^x-x^2+\log (x)\right )\right )}{x} \]
________________________________________________________________________________________
Rubi [A] time = 0.05, antiderivative size = 24, normalized size of antiderivative = 0.83, number of steps used = 8, number of rules used = 3, integrand size = 24, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.125, Rules used = {14, 2197, 2304} \begin {gather*} 4 x+\frac {4 e^x}{x}+\frac {8}{x}-\frac {4 \log (x)}{x} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 14
Rule 2197
Rule 2304
Rubi steps
\begin {gather*} \begin {aligned} \text {integral} &=\int \left (\frac {4 e^x (-1+x)}{x^2}+\frac {4 \left (-3+x^2+\log (x)\right )}{x^2}\right ) \, dx\\ &=4 \int \frac {e^x (-1+x)}{x^2} \, dx+4 \int \frac {-3+x^2+\log (x)}{x^2} \, dx\\ &=\frac {4 e^x}{x}+4 \int \left (\frac {-3+x^2}{x^2}+\frac {\log (x)}{x^2}\right ) \, dx\\ &=\frac {4 e^x}{x}+4 \int \frac {-3+x^2}{x^2} \, dx+4 \int \frac {\log (x)}{x^2} \, dx\\ &=-\frac {4}{x}+\frac {4 e^x}{x}-\frac {4 \log (x)}{x}+4 \int \left (1-\frac {3}{x^2}\right ) \, dx\\ &=\frac {8}{x}+\frac {4 e^x}{x}+4 x-\frac {4 \log (x)}{x}\\ \end {aligned} \end {gather*}
________________________________________________________________________________________
Mathematica [A] time = 0.02, size = 17, normalized size = 0.59 \begin {gather*} \frac {4 \left (2+e^x+x^2-\log (x)\right )}{x} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
fricas [A] time = 1.25, size = 16, normalized size = 0.55 \begin {gather*} \frac {4 \, {\left (x^{2} + e^{x} - \log \relax (x) + 2\right )}}{x} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [A] time = 0.16, size = 16, normalized size = 0.55 \begin {gather*} \frac {4 \, {\left (x^{2} + e^{x} - \log \relax (x) + 2\right )}}{x} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [A] time = 0.04, size = 20, normalized size = 0.69
method | result | size |
norman | \(\frac {8+4 x^{2}+4 \,{\mathrm e}^{x}-4 \ln \relax (x )}{x}\) | \(20\) |
risch | \(-\frac {4 \ln \relax (x )}{x}+\frac {4 x^{2}+4 \,{\mathrm e}^{x}+8}{x}\) | \(21\) |
default | \(4 x +\frac {8}{x}-\frac {4 \ln \relax (x )}{x}+\frac {4 \,{\mathrm e}^{x}}{x}\) | \(24\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maxima [C] time = 0.38, size = 27, normalized size = 0.93 \begin {gather*} 4 \, x - \frac {4 \, \log \relax (x)}{x} + \frac {8}{x} + 4 \, {\rm Ei}\relax (x) - 4 \, \Gamma \left (-1, -x\right ) \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [B] time = 3.69, size = 16, normalized size = 0.55 \begin {gather*} \frac {4\,\left ({\mathrm {e}}^x-\ln \relax (x)+x^2+2\right )}{x} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
sympy [A] time = 0.27, size = 19, normalized size = 0.66 \begin {gather*} 4 x + \frac {4 e^{x}}{x} - \frac {4 \log {\relax (x )}}{x} + \frac {8}{x} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________