Optimal. Leaf size=16 \[ 1+2 x+\frac {\log (-2+e-x)}{x} \]
________________________________________________________________________________________
Rubi [A] time = 0.27, antiderivative size = 15, normalized size of antiderivative = 0.94, number of steps used = 11, number of rules used = 8, integrand size = 53, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.151, Rules used = {6, 1593, 6742, 893, 2395, 36, 31, 29} \begin {gather*} 2 x+\frac {\log (-x+e-2)}{x} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 6
Rule 29
Rule 31
Rule 36
Rule 893
Rule 1593
Rule 2395
Rule 6742
Rubi steps
\begin {gather*} \begin {aligned} \text {integral} &=\int \frac {-x-4 x^2+2 e x^2-2 x^3+(2-e+x) \log (-2+e-x)}{(-2+e) x^2-x^3} \, dx\\ &=\int \frac {-x+(-4+2 e) x^2-2 x^3+(2-e+x) \log (-2+e-x)}{(-2+e) x^2-x^3} \, dx\\ &=\int \frac {-x+(-4+2 e) x^2-2 x^3+(2-e+x) \log (-2+e-x)}{(-2+e-x) x^2} \, dx\\ &=\int \left (\frac {1+2 (2-e) x+2 x^2}{x (2-e+x)}-\frac {\log (-2+e-x)}{x^2}\right ) \, dx\\ &=\int \frac {1+2 (2-e) x+2 x^2}{x (2-e+x)} \, dx-\int \frac {\log (-2+e-x)}{x^2} \, dx\\ &=\frac {\log (-2+e-x)}{x}+\int \left (2-\frac {1}{(-2+e) (-2+e-x)}+\frac {1}{(2-e) x}\right ) \, dx+\int \frac {1}{(-2+e-x) x} \, dx\\ &=2 x+\frac {\log (-2+e-x)}{x}+\frac {\log (x)}{2-e}-\frac {\log (2-e+x)}{2-e}-\frac {\int \frac {1}{-2+e-x} \, dx}{2-e}-\frac {\int \frac {1}{x} \, dx}{2-e}\\ &=2 x+\frac {\log (-2+e-x)}{x}\\ \end {aligned} \end {gather*}
________________________________________________________________________________________
Mathematica [A] time = 0.06, size = 15, normalized size = 0.94 \begin {gather*} 2 x+\frac {\log (-2+e-x)}{x} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
fricas [A] time = 0.74, size = 18, normalized size = 1.12 \begin {gather*} \frac {2 \, x^{2} + \log \left (-x + e - 2\right )}{x} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [A] time = 1.54, size = 18, normalized size = 1.12 \begin {gather*} \frac {2 \, x^{2} + \log \left (-x + e - 2\right )}{x} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [A] time = 0.35, size = 17, normalized size = 1.06
method | result | size |
risch | \(\frac {\ln \left ({\mathrm e}-x -2\right )}{x}+2 x\) | \(17\) |
norman | \(\frac {2 x^{2}+\ln \left ({\mathrm e}-x -2\right )}{x}\) | \(19\) |
derivativedivides | \(-2 \,{\mathrm e}+2 x +4-\frac {\ln \left (-x \right )}{{\mathrm e}-2}+\frac {\ln \left ({\mathrm e}-x -2\right )}{{\mathrm e}-2}+\frac {\ln \relax (x )}{{\mathrm e}-2}+\frac {\ln \left ({\mathrm e}-x -2\right ) \left ({\mathrm e}-x -2\right )}{\left ({\mathrm e}-2\right ) x}\) | \(71\) |
default | \(-2 \,{\mathrm e}+2 x +4-\frac {\ln \left (-x \right )}{{\mathrm e}-2}+\frac {\ln \left ({\mathrm e}-x -2\right )}{{\mathrm e}-2}+\frac {\ln \relax (x )}{{\mathrm e}-2}+\frac {\ln \left ({\mathrm e}-x -2\right ) \left ({\mathrm e}-x -2\right )}{\left ({\mathrm e}-2\right ) x}\) | \(71\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maxima [A] time = 0.41, size = 18, normalized size = 1.12 \begin {gather*} \frac {2 \, x^{2} + \log \left (-x + e - 2\right )}{x} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [B] time = 5.49, size = 16, normalized size = 1.00 \begin {gather*} 2\,x+\frac {\ln \left (\mathrm {e}-x-2\right )}{x} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
sympy [A] time = 0.16, size = 12, normalized size = 0.75 \begin {gather*} 2 x + \frac {\log {\left (- x - 2 + e \right )}}{x} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________