Optimal. Leaf size=26 \[ \frac {e^4+x+\log \left (2 e^{-4 e^x+2 x} x^4\right )}{x^2} \]
[Out]
________________________________________________________________________________________
Rubi [B] Leaf count is larger than twice the leaf count of optimal. \(65\) vs. \(2(26)=52\).
time = 0.16, antiderivative size = 65, normalized size of antiderivative = 2.50, number of steps
used = 14, number of rules used = 6, integrand size = 37, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.162, Rules used = {14, 2208,
2209, 37, 2631, 12} \begin {gather*} \frac {(x+2)^2}{2 x^2}-\frac {\left (x+2 \left (2-e^4\right )\right )^2}{4 \left (2-e^4\right ) x^2}+\frac {\log \left (2 e^{-2 \left (2 e^x-x\right )} x^4\right )}{x^2} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 12
Rule 14
Rule 37
Rule 2208
Rule 2209
Rule 2631
Rubi steps
\begin {gather*} \begin {aligned} \text {integral} &=\int \left (-\frac {4 e^x}{x^2}+\frac {4 \left (1-\frac {e^4}{2}\right )+x-2 \log \left (2 e^{-4 e^x+2 x} x^4\right )}{x^3}\right ) \, dx\\ &=-\left (4 \int \frac {e^x}{x^2} \, dx\right )+\int \frac {4 \left (1-\frac {e^4}{2}\right )+x-2 \log \left (2 e^{-4 e^x+2 x} x^4\right )}{x^3} \, dx\\ &=\frac {4 e^x}{x}-4 \int \frac {e^x}{x} \, dx+\int \left (\frac {4-2 e^4+x}{x^3}-\frac {2 \log \left (2 e^{-2 \left (2 e^x-x\right )} x^4\right )}{x^3}\right ) \, dx\\ &=\frac {4 e^x}{x}-4 \text {Ei}(x)-2 \int \frac {\log \left (2 e^{-2 \left (2 e^x-x\right )} x^4\right )}{x^3} \, dx+\int \frac {4-2 e^4+x}{x^3} \, dx\\ &=\frac {4 e^x}{x}-\frac {\left (2 \left (2-e^4\right )+x\right )^2}{4 \left (2-e^4\right ) x^2}-4 \text {Ei}(x)+\frac {\log \left (2 e^{-2 \left (2 e^x-x\right )} x^4\right )}{x^2}-\int \frac {2 \left (2+x-2 e^x x\right )}{x^3} \, dx\\ &=\frac {4 e^x}{x}-\frac {\left (2 \left (2-e^4\right )+x\right )^2}{4 \left (2-e^4\right ) x^2}-4 \text {Ei}(x)+\frac {\log \left (2 e^{-2 \left (2 e^x-x\right )} x^4\right )}{x^2}-2 \int \frac {2+x-2 e^x x}{x^3} \, dx\\ &=\frac {4 e^x}{x}-\frac {\left (2 \left (2-e^4\right )+x\right )^2}{4 \left (2-e^4\right ) x^2}-4 \text {Ei}(x)+\frac {\log \left (2 e^{-2 \left (2 e^x-x\right )} x^4\right )}{x^2}-2 \int \left (-\frac {2 e^x}{x^2}+\frac {2+x}{x^3}\right ) \, dx\\ &=\frac {4 e^x}{x}-\frac {\left (2 \left (2-e^4\right )+x\right )^2}{4 \left (2-e^4\right ) x^2}-4 \text {Ei}(x)+\frac {\log \left (2 e^{-2 \left (2 e^x-x\right )} x^4\right )}{x^2}-2 \int \frac {2+x}{x^3} \, dx+4 \int \frac {e^x}{x^2} \, dx\\ &=\frac {(2+x)^2}{2 x^2}-\frac {\left (2 \left (2-e^4\right )+x\right )^2}{4 \left (2-e^4\right ) x^2}-4 \text {Ei}(x)+\frac {\log \left (2 e^{-2 \left (2 e^x-x\right )} x^4\right )}{x^2}+4 \int \frac {e^x}{x} \, dx\\ &=\frac {(2+x)^2}{2 x^2}-\frac {\left (2 \left (2-e^4\right )+x\right )^2}{4 \left (2-e^4\right ) x^2}+\frac {\log \left (2 e^{-2 \left (2 e^x-x\right )} x^4\right )}{x^2}\\ \end {aligned} \end {gather*}
________________________________________________________________________________________
Mathematica [A]
time = 0.06, size = 32, normalized size = 1.23 \begin {gather*} \frac {e^4}{x^2}+\frac {1}{x}+\frac {\log \left (2 e^{-4 e^x+2 x} x^4\right )}{x^2} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.51, size = 42, normalized size = 1.62
method | result | size |
default | \(\frac {\ln \left (2 x^{4} {\mathrm e}^{2 x} {\mathrm e}^{-4 \,{\mathrm e}^{x}}\right )}{x^{2}}+\frac {1}{x}+\frac {2}{x^{2}}+\frac {2 \,{\mathrm e}^{4}-4}{2 x^{2}}\) | \(42\) |
risch | \(-\frac {\ln \left ({\mathrm e}^{4 \,{\mathrm e}^{x}}\right )}{x^{2}}+\frac {2 x +i \pi \mathrm {csgn}\left (i x^{3}\right )^{2} \mathrm {csgn}\left (i x \right )+i \pi \mathrm {csgn}\left (i x^{3}\right )^{2} \mathrm {csgn}\left (i x^{2}\right )-i \pi \,\mathrm {csgn}\left (i {\mathrm e}^{2 x}\right ) \mathrm {csgn}\left (i {\mathrm e}^{x}\right )^{2}+2 i \pi \mathrm {csgn}\left (i {\mathrm e}^{2 x}\right )^{2} \mathrm {csgn}\left (i {\mathrm e}^{x}\right )+i \pi \mathrm {csgn}\left (i {\mathrm e}^{2 x -4 \,{\mathrm e}^{x}}\right )^{2} \mathrm {csgn}\left (i {\mathrm e}^{2 x}\right )+i \pi \,\mathrm {csgn}\left (i {\mathrm e}^{-4 \,{\mathrm e}^{x}}\right ) \mathrm {csgn}\left (i {\mathrm e}^{2 x -4 \,{\mathrm e}^{x}}\right )^{2}+i \pi \,\mathrm {csgn}\left (i x^{4}\right ) \mathrm {csgn}\left (i x^{4} {\mathrm e}^{2 x -4 \,{\mathrm e}^{x}}\right )^{2}+i \pi \,\mathrm {csgn}\left (i {\mathrm e}^{2 x -4 \,{\mathrm e}^{x}}\right ) \mathrm {csgn}\left (i x^{4} {\mathrm e}^{2 x -4 \,{\mathrm e}^{x}}\right )^{2}+i \pi \,\mathrm {csgn}\left (i x^{3}\right ) \mathrm {csgn}\left (i x^{4}\right )^{2}+i \pi \mathrm {csgn}\left (i x^{4}\right )^{2} \mathrm {csgn}\left (i x \right )-i \pi \mathrm {csgn}\left (i x \right )^{2} \mathrm {csgn}\left (i x^{2}\right )+2 i \pi \,\mathrm {csgn}\left (i x \right ) \mathrm {csgn}\left (i x^{2}\right )^{2}+4 \ln \left ({\mathrm e}^{x}\right )+2 \,{\mathrm e}^{4}+2 \ln \left (2\right )+8 \ln \left (x \right )-i \pi \mathrm {csgn}\left (i x^{2}\right )^{3}-i \pi \mathrm {csgn}\left (i {\mathrm e}^{2 x -4 \,{\mathrm e}^{x}}\right )^{3}-i \pi \mathrm {csgn}\left (i x^{3}\right )^{3}-i \pi \mathrm {csgn}\left (i {\mathrm e}^{2 x}\right )^{3}-i \pi \mathrm {csgn}\left (i x^{4} {\mathrm e}^{2 x -4 \,{\mathrm e}^{x}}\right )^{3}-i \pi \mathrm {csgn}\left (i x^{4}\right )^{3}-i \pi \,\mathrm {csgn}\left (i x^{4}\right ) \mathrm {csgn}\left (i {\mathrm e}^{2 x -4 \,{\mathrm e}^{x}}\right ) \mathrm {csgn}\left (i x^{4} {\mathrm e}^{2 x -4 \,{\mathrm e}^{x}}\right )-i \pi \,\mathrm {csgn}\left (i {\mathrm e}^{-4 \,{\mathrm e}^{x}}\right ) \mathrm {csgn}\left (i {\mathrm e}^{2 x -4 \,{\mathrm e}^{x}}\right ) \mathrm {csgn}\left (i {\mathrm e}^{2 x}\right )-i \pi \,\mathrm {csgn}\left (i x^{3}\right ) \mathrm {csgn}\left (i x^{4}\right ) \mathrm {csgn}\left (i x \right )-i \pi \,\mathrm {csgn}\left (i x^{3}\right ) \mathrm {csgn}\left (i x \right ) \mathrm {csgn}\left (i x^{2}\right )}{2 x^{2}}\) | \(524\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Failed to integrate} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 0.38, size = 23, normalized size = 0.88 \begin {gather*} \frac {x + e^{4} + \log \left (2 \, x^{4} e^{\left (2 \, x - 4 \, e^{x}\right )}\right )}{x^{2}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [A]
time = 0.21, size = 31, normalized size = 1.19 \begin {gather*} - \frac {- x - e^{4}}{x^{2}} + \frac {\log {\left (2 x^{4} e^{2 x} e^{- 4 e^{x}} \right )}}{x^{2}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A]
time = 0.42, size = 20, normalized size = 0.77 \begin {gather*} \frac {3 \, x + e^{4} - 4 \, e^{x} + \log \left (2 \, x^{4}\right )}{x^{2}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 2.30, size = 20, normalized size = 0.77 \begin {gather*} \frac {3\,x+{\mathrm {e}}^4+\ln \left (2\,x^4\right )-4\,{\mathrm {e}}^x}{x^2} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________