Optimal. Leaf size=29 \[ \frac {2}{x}-\frac {2 \left (-3+x+2 \left (-e^x-x^2+\log (x)\right )\right )}{x} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.06, 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, 2228, 2341}
\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 2228
Rule 2341
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.01, 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]
________________________________________________________________________________________
Maple [A]
time = 0.20, size = 24, normalized size = 0.83
method | result | size |
norman | \(\frac {8+4 x^{2}+4 \,{\mathrm e}^{x}-4 \ln \left (x \right )}{x}\) | \(20\) |
risch | \(-\frac {4 \ln \left (x \right )}{x}+\frac {4 x^{2}+4 \,{\mathrm e}^{x}+8}{x}\) | \(21\) |
default | \(4 x +\frac {8}{x}-\frac {4 \ln \left (x \right )}{x}+\frac {4 \,{\mathrm e}^{x}}{x}\) | \(24\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [C] Result contains higher order function than in optimal. Order 4 vs. order
3.
time = 0.29, size = 27, normalized size = 0.93 \begin {gather*} 4 \, x - \frac {4 \, \log \left (x\right )}{x} + \frac {8}{x} + 4 \, {\rm Ei}\left (x\right ) - 4 \, \Gamma \left (-1, -x\right ) \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 0.35, size = 16, normalized size = 0.55 \begin {gather*} \frac {4 \, {\left (x^{2} + e^{x} - \log \left (x\right ) + 2\right )}}{x} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [A]
time = 0.08, size = 19, normalized size = 0.66 \begin {gather*} 4 x + \frac {4 e^{x}}{x} - \frac {4 \log {\left (x \right )}}{x} + \frac {8}{x} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A]
time = 0.40, size = 16, normalized size = 0.55 \begin {gather*} \frac {4 \, {\left (x^{2} + e^{x} - \log \left (x\right ) + 2\right )}}{x} \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 \left (x\right )+x^2+2\right )}{x} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________