Optimal. Leaf size=23 \[ \frac {12 e^{4+x}+2 x}{x (e+x)}+\log (4) \]
________________________________________________________________________________________
Rubi [A] time = 0.78, antiderivative size = 30, normalized size of antiderivative = 1.30, number of steps used = 12, number of rules used = 5, integrand size = 48, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.104, Rules used = {1594, 27, 6742, 2177, 2178} \begin {gather*} -\frac {12 e^{x+3}}{x+e}+\frac {2}{x+e}+\frac {12 e^{x+3}}{x} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 27
Rule 1594
Rule 2177
Rule 2178
Rule 6742
Rubi steps
\begin {gather*} \begin {aligned} \text {integral} &=\int \frac {-2 x^2+e^{4+x} \left (-24 x+12 x^2+e (-12+12 x)\right )}{x^2 \left (e^2+2 e x+x^2\right )} \, dx\\ &=\int \frac {-2 x^2+e^{4+x} \left (-24 x+12 x^2+e (-12+12 x)\right )}{x^2 (e+x)^2} \, dx\\ &=\int \left (-\frac {2}{(e+x)^2}+\frac {12 e^{4+x} \left (-e-(2-e) x+x^2\right )}{x^2 (e+x)^2}\right ) \, dx\\ &=\frac {2}{e+x}+12 \int \frac {e^{4+x} \left (-e-(2-e) x+x^2\right )}{x^2 (e+x)^2} \, dx\\ &=\frac {2}{e+x}+12 \int \left (-\frac {e^{3+x}}{x^2}+\frac {e^{3+x}}{x}+\frac {e^{3+x}}{(e+x)^2}-\frac {e^{3+x}}{e+x}\right ) \, dx\\ &=\frac {2}{e+x}-12 \int \frac {e^{3+x}}{x^2} \, dx+12 \int \frac {e^{3+x}}{x} \, dx+12 \int \frac {e^{3+x}}{(e+x)^2} \, dx-12 \int \frac {e^{3+x}}{e+x} \, dx\\ &=\frac {12 e^{3+x}}{x}+\frac {2}{e+x}-\frac {12 e^{3+x}}{e+x}+12 e^3 \text {Ei}(x)-12 e^{3-e} \text {Ei}(e+x)-12 \int \frac {e^{3+x}}{x} \, dx+12 \int \frac {e^{3+x}}{e+x} \, dx\\ &=\frac {12 e^{3+x}}{x}+\frac {2}{e+x}-\frac {12 e^{3+x}}{e+x}\\ \end {aligned} \end {gather*}
________________________________________________________________________________________
Mathematica [A] time = 0.13, size = 20, normalized size = 0.87 \begin {gather*} \frac {2 \left (6 e^{4+x}+x\right )}{e x+x^2} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
fricas [A] time = 0.57, size = 20, normalized size = 0.87 \begin {gather*} \frac {2 \, {\left (x + 6 \, e^{\left (x + 4\right )}\right )}}{x^{2} + x e} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [A] time = 0.32, size = 20, normalized size = 0.87 \begin {gather*} \frac {2 \, {\left (x + 6 \, e^{\left (x + 4\right )}\right )}}{x^{2} + x e} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [A] time = 0.30, size = 21, normalized size = 0.91
method | result | size |
norman | \(\frac {12 \,{\mathrm e}^{4+x}+2 x}{x \left (x +{\mathrm e}\right )}\) | \(21\) |
risch | \(\frac {2}{x +{\mathrm e}}+\frac {12 \,{\mathrm e}^{4+x}}{\left (x +{\mathrm e}\right ) x}\) | \(25\) |
derivativedivides | \(\frac {64 \,{\mathrm e}^{-2} \left (4+x \right )-4 \,{\mathrm e}^{-2} \left (64-8 \,{\mathrm e}\right )}{x \left (x +{\mathrm e}\right )}+\frac {\left (-128+16 \,{\mathrm e}\right ) {\mathrm e}^{-2} \left (4+x \right )-4 \,{\mathrm e}^{-2} \left (-128+32 \,{\mathrm e}\right )}{x \left (x +{\mathrm e}\right )}+\frac {\left (64+2 \,{\mathrm e}^{2}-16 \,{\mathrm e}\right ) {\mathrm e}^{-2} \left (4+x \right )-4 \left ({\mathrm e}-4\right ) {\mathrm e}^{-2} \left (-16+2 \,{\mathrm e}\right )}{x \left (x +{\mathrm e}\right )}-\frac {288 \,{\mathrm e}^{4+x} \left ({\mathrm e}+2 x \right ) {\mathrm e}^{-2}}{\left (4+x \right ) {\mathrm e}+\left (4+x \right )^{2}-4 \,{\mathrm e}-16-8 x}-288 \,{\mathrm e}^{-2} \left ({\mathrm e}-2\right ) {\mathrm e}^{-1} {\mathrm e}^{4} \expIntegralEi \left (1, -x \right )-288 \,{\mathrm e}^{-2} \left ({\mathrm e}+2\right ) {\mathrm e}^{-1} {\mathrm e}^{4-{\mathrm e}} \expIntegralEi \left (1, -{\mathrm e}-x \right )-60 \,{\mathrm e} \left (-\frac {{\mathrm e}^{4+x} \left ({\mathrm e}+2 x \right ) {\mathrm e}^{-2}}{\left (4+x \right ) {\mathrm e}+\left (4+x \right )^{2}-4 \,{\mathrm e}-16-8 x}-{\mathrm e}^{-2} \left ({\mathrm e}-2\right ) {\mathrm e}^{-1} {\mathrm e}^{4} \expIntegralEi \left (1, -x \right )-{\mathrm e}^{-2} \left ({\mathrm e}+2\right ) {\mathrm e}^{-1} {\mathrm e}^{4-{\mathrm e}} \expIntegralEi \left (1, -{\mathrm e}-x \right )\right )-\frac {120 \,{\mathrm e}^{4+x} \left (\left (4+x \right ) {\mathrm e}-8 \,{\mathrm e}-8 x \right ) {\mathrm e}^{-2}}{\left (4+x \right ) {\mathrm e}+\left (4+x \right )^{2}-4 \,{\mathrm e}-16-8 x}+120 \,{\mathrm e}^{-2} \left (5 \,{\mathrm e}-8\right ) {\mathrm e}^{-1} {\mathrm e}^{4} \expIntegralEi \left (1, -x \right )-120 \,{\mathrm e}^{-2} \left ({\mathrm e}^{2}-3 \,{\mathrm e}-8\right ) {\mathrm e}^{-1} {\mathrm e}^{4-{\mathrm e}} \expIntegralEi \left (1, -{\mathrm e}-x \right )-\frac {12 \,{\mathrm e}^{4+x} \left (\left (4+x \right ) {\mathrm e}^{2}-4 \,{\mathrm e}^{2}-8 \left (4+x \right ) {\mathrm e}+48 \,{\mathrm e}+32 x \right ) {\mathrm e}^{-2}}{\left (4+x \right ) {\mathrm e}+\left (4+x \right )^{2}-4 \,{\mathrm e}-16-8 x}-96 \,{\mathrm e}^{-2} \left (3 \,{\mathrm e}-4\right ) {\mathrm e}^{-1} {\mathrm e}^{4} \expIntegralEi \left (1, -x \right )-12 \,{\mathrm e}^{-2} \left ({\mathrm e} \,{\mathrm e}^{2}-8 \,{\mathrm e}^{2}+8 \,{\mathrm e}+32\right ) {\mathrm e}^{-1} {\mathrm e}^{4-{\mathrm e}} \expIntegralEi \left (1, -{\mathrm e}-x \right )+12 \,{\mathrm e} \left (\frac {{\mathrm e}^{4+x} \left (\left (4+x \right ) {\mathrm e}-8 \,{\mathrm e}-8 x \right ) {\mathrm e}^{-2}}{\left (4+x \right ) {\mathrm e}+\left (4+x \right )^{2}-4 \,{\mathrm e}-16-8 x}-{\mathrm e}^{-2} \left (5 \,{\mathrm e}-8\right ) {\mathrm e}^{-1} {\mathrm e}^{4} \expIntegralEi \left (1, -x \right )+{\mathrm e}^{-2} \left ({\mathrm e}^{2}-3 \,{\mathrm e}-8\right ) {\mathrm e}^{-1} {\mathrm e}^{4-{\mathrm e}} \expIntegralEi \left (1, -{\mathrm e}-x \right )\right )\) | \(626\) |
default | \(\frac {64 \,{\mathrm e}^{-2} \left (4+x \right )-4 \,{\mathrm e}^{-2} \left (64-8 \,{\mathrm e}\right )}{x \left (x +{\mathrm e}\right )}+\frac {\left (-128+16 \,{\mathrm e}\right ) {\mathrm e}^{-2} \left (4+x \right )-4 \,{\mathrm e}^{-2} \left (-128+32 \,{\mathrm e}\right )}{x \left (x +{\mathrm e}\right )}+\frac {\left (64+2 \,{\mathrm e}^{2}-16 \,{\mathrm e}\right ) {\mathrm e}^{-2} \left (4+x \right )-4 \left ({\mathrm e}-4\right ) {\mathrm e}^{-2} \left (-16+2 \,{\mathrm e}\right )}{x \left (x +{\mathrm e}\right )}-\frac {288 \,{\mathrm e}^{4+x} \left ({\mathrm e}+2 x \right ) {\mathrm e}^{-2}}{\left (4+x \right ) {\mathrm e}+\left (4+x \right )^{2}-4 \,{\mathrm e}-16-8 x}-288 \,{\mathrm e}^{-2} \left ({\mathrm e}-2\right ) {\mathrm e}^{-1} {\mathrm e}^{4} \expIntegralEi \left (1, -x \right )-288 \,{\mathrm e}^{-2} \left ({\mathrm e}+2\right ) {\mathrm e}^{-1} {\mathrm e}^{4-{\mathrm e}} \expIntegralEi \left (1, -{\mathrm e}-x \right )-60 \,{\mathrm e} \left (-\frac {{\mathrm e}^{4+x} \left ({\mathrm e}+2 x \right ) {\mathrm e}^{-2}}{\left (4+x \right ) {\mathrm e}+\left (4+x \right )^{2}-4 \,{\mathrm e}-16-8 x}-{\mathrm e}^{-2} \left ({\mathrm e}-2\right ) {\mathrm e}^{-1} {\mathrm e}^{4} \expIntegralEi \left (1, -x \right )-{\mathrm e}^{-2} \left ({\mathrm e}+2\right ) {\mathrm e}^{-1} {\mathrm e}^{4-{\mathrm e}} \expIntegralEi \left (1, -{\mathrm e}-x \right )\right )-\frac {120 \,{\mathrm e}^{4+x} \left (\left (4+x \right ) {\mathrm e}-8 \,{\mathrm e}-8 x \right ) {\mathrm e}^{-2}}{\left (4+x \right ) {\mathrm e}+\left (4+x \right )^{2}-4 \,{\mathrm e}-16-8 x}+120 \,{\mathrm e}^{-2} \left (5 \,{\mathrm e}-8\right ) {\mathrm e}^{-1} {\mathrm e}^{4} \expIntegralEi \left (1, -x \right )-120 \,{\mathrm e}^{-2} \left ({\mathrm e}^{2}-3 \,{\mathrm e}-8\right ) {\mathrm e}^{-1} {\mathrm e}^{4-{\mathrm e}} \expIntegralEi \left (1, -{\mathrm e}-x \right )-\frac {12 \,{\mathrm e}^{4+x} \left (\left (4+x \right ) {\mathrm e}^{2}-4 \,{\mathrm e}^{2}-8 \left (4+x \right ) {\mathrm e}+48 \,{\mathrm e}+32 x \right ) {\mathrm e}^{-2}}{\left (4+x \right ) {\mathrm e}+\left (4+x \right )^{2}-4 \,{\mathrm e}-16-8 x}-96 \,{\mathrm e}^{-2} \left (3 \,{\mathrm e}-4\right ) {\mathrm e}^{-1} {\mathrm e}^{4} \expIntegralEi \left (1, -x \right )-12 \,{\mathrm e}^{-2} \left ({\mathrm e} \,{\mathrm e}^{2}-8 \,{\mathrm e}^{2}+8 \,{\mathrm e}+32\right ) {\mathrm e}^{-1} {\mathrm e}^{4-{\mathrm e}} \expIntegralEi \left (1, -{\mathrm e}-x \right )+12 \,{\mathrm e} \left (\frac {{\mathrm e}^{4+x} \left (\left (4+x \right ) {\mathrm e}-8 \,{\mathrm e}-8 x \right ) {\mathrm e}^{-2}}{\left (4+x \right ) {\mathrm e}+\left (4+x \right )^{2}-4 \,{\mathrm e}-16-8 x}-{\mathrm e}^{-2} \left (5 \,{\mathrm e}-8\right ) {\mathrm e}^{-1} {\mathrm e}^{4} \expIntegralEi \left (1, -x \right )+{\mathrm e}^{-2} \left ({\mathrm e}^{2}-3 \,{\mathrm e}-8\right ) {\mathrm e}^{-1} {\mathrm e}^{4-{\mathrm e}} \expIntegralEi \left (1, -{\mathrm e}-x \right )\right )\) | \(626\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maxima [A] time = 0.61, size = 25, normalized size = 1.09 \begin {gather*} \frac {12 \, e^{\left (x + 4\right )}}{x^{2} + x e} + \frac {2}{x + e} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [B] time = 0.17, size = 25, normalized size = 1.09 \begin {gather*} \frac {2\,{\mathrm {e}}^{-1}\,\left (6\,{\mathrm {e}}^{x+5}-x^2\right )}{x\,\left (x+\mathrm {e}\right )} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
sympy [A] time = 0.18, size = 20, normalized size = 0.87 \begin {gather*} \frac {12 e^{x + 4}}{x^{2} + e x} + \frac {2}{x + e} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________