Optimal. Leaf size=31 \[ -2-x+\frac {e^x \left (2+e^2-\frac {4}{4+2 x}\right )}{x (3+x)} \]
________________________________________________________________________________________
Rubi [A] time = 1.65, antiderivative size = 45, normalized size of antiderivative = 1.45, number of steps used = 14, number of rules used = 4, integrand size = 99, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.040, Rules used = {6688, 6742, 2177, 2178} \begin {gather*} -x+\frac {e^x}{x+2}-\frac {\left (4+e^2\right ) e^x}{3 (x+3)}+\frac {\left (1+e^2\right ) e^x}{3 x} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 2177
Rule 2178
Rule 6688
Rule 6742
Rubi steps
\begin {gather*} \begin {aligned} \text {integral} &=\int \frac {e^{2+x} (2+x)^2 \left (-3+x+x^2\right )-x^2 \left (6+5 x+x^2\right )^2+2 e^x \left (-6-4 x+3 x^2+4 x^3+x^4\right )}{x^2 \left (6+5 x+x^2\right )^2} \, dx\\ &=\int \left (-1+\frac {e^x \left (-12 \left (1+e^2\right )-8 \left (1+e^2\right ) x+\left (6+5 e^2\right ) x^2+\left (8+5 e^2\right ) x^3+\left (2+e^2\right ) x^4\right )}{x^2 (2+x)^2 (3+x)^2}\right ) \, dx\\ &=-x+\int \frac {e^x \left (-12 \left (1+e^2\right )-8 \left (1+e^2\right ) x+\left (6+5 e^2\right ) x^2+\left (8+5 e^2\right ) x^3+\left (2+e^2\right ) x^4\right )}{x^2 (2+x)^2 (3+x)^2} \, dx\\ &=-x+\int \left (\frac {e^x \left (-1-e^2\right )}{3 x^2}+\frac {e^x \left (1+e^2\right )}{3 x}-\frac {e^x}{(2+x)^2}+\frac {e^x}{2+x}+\frac {e^x \left (4+e^2\right )}{3 (3+x)^2}+\frac {e^x \left (-4-e^2\right )}{3 (3+x)}\right ) \, dx\\ &=-x+\frac {1}{3} \left (-4-e^2\right ) \int \frac {e^x}{3+x} \, dx+\frac {1}{3} \left (-1-e^2\right ) \int \frac {e^x}{x^2} \, dx+\frac {1}{3} \left (1+e^2\right ) \int \frac {e^x}{x} \, dx+\frac {1}{3} \left (4+e^2\right ) \int \frac {e^x}{(3+x)^2} \, dx-\int \frac {e^x}{(2+x)^2} \, dx+\int \frac {e^x}{2+x} \, dx\\ &=\frac {e^x \left (1+e^2\right )}{3 x}-x+\frac {e^x}{2+x}-\frac {e^x \left (4+e^2\right )}{3 (3+x)}+\frac {1}{3} \left (1+e^2\right ) \text {Ei}(x)+\frac {\text {Ei}(2+x)}{e^2}-\frac {\left (4+e^2\right ) \text {Ei}(3+x)}{3 e^3}+\frac {1}{3} \left (-1-e^2\right ) \int \frac {e^x}{x} \, dx+\frac {1}{3} \left (4+e^2\right ) \int \frac {e^x}{3+x} \, dx-\int \frac {e^x}{2+x} \, dx\\ &=\frac {e^x \left (1+e^2\right )}{3 x}-x+\frac {e^x}{2+x}-\frac {e^x \left (4+e^2\right )}{3 (3+x)}\\ \end {aligned} \end {gather*}
________________________________________________________________________________________
Mathematica [A] time = 0.34, size = 45, normalized size = 1.45 \begin {gather*} \frac {e^x \left (1+e^2\right )}{3 x}-x+\frac {e^x}{2+x}-\frac {e^x \left (4+e^2\right )}{3 (3+x)} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
fricas [A] time = 0.94, size = 45, normalized size = 1.45 \begin {gather*} -\frac {x^{4} + 5 \, x^{3} + 6 \, x^{2} - {\left ({\left (x + 2\right )} e^{2} + 2 \, x + 2\right )} e^{x}}{x^{3} + 5 \, x^{2} + 6 \, x} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [A] time = 0.28, size = 52, normalized size = 1.68 \begin {gather*} -\frac {x^{4} + 5 \, x^{3} + 6 \, x^{2} - x e^{\left (x + 2\right )} - 2 \, x e^{x} - 2 \, e^{\left (x + 2\right )} - 2 \, e^{x}}{x^{3} + 5 \, x^{2} + 6 \, x} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [A] time = 0.12, size = 34, normalized size = 1.10
method | result | size |
risch | \(-x +\frac {\left ({\mathrm e}^{2} x +2 \,{\mathrm e}^{2}+2 x +2\right ) {\mathrm e}^{x}}{x \left (x^{2}+5 x +6\right )}\) | \(34\) |
norman | \(\frac {19 x^{2}+30 x +\left (2 \,{\mathrm e}^{2}+2\right ) {\mathrm e}^{x}+\left ({\mathrm e}^{2}+2\right ) x \,{\mathrm e}^{x}-x^{4}}{x \left (x^{2}+5 x +6\right )}\) | \(46\) |
default | \({\mathrm e}^{2} \left (8 \,{\mathrm e}^{-2} \expIntegralEi \left (1, -x -2\right )-\frac {4 \,{\mathrm e}^{x}}{2+x}-\frac {9 \,{\mathrm e}^{x}}{3+x}-21 \,{\mathrm e}^{-3} \expIntegralEi \left (1, -3-x \right )\right )-x +\frac {{\mathrm e}^{x}}{2+x}-\frac {4 \,{\mathrm e}^{x}}{3 \left (3+x \right )}+\frac {{\mathrm e}^{x}}{3 x}-12 \,{\mathrm e}^{2} \left (\frac {\expIntegralEi \left (1, -x \right )}{54}-\frac {{\mathrm e}^{x}}{4 \left (2+x \right )}-\frac {{\mathrm e}^{x}}{9 \left (3+x \right )}-\frac {11 \,{\mathrm e}^{-3} \expIntegralEi \left (1, -3-x \right )}{27}-\frac {{\mathrm e}^{x}}{36 x}\right )-8 \,{\mathrm e}^{2} \left (-\frac {\expIntegralEi \left (1, -x \right )}{36}-\frac {{\mathrm e}^{-2} \expIntegralEi \left (1, -x -2\right )}{4}+\frac {{\mathrm e}^{x}}{2 x +4}+\frac {{\mathrm e}^{x}}{3 x +9}+\frac {10 \,{\mathrm e}^{-3} \expIntegralEi \left (1, -3-x \right )}{9}\right )+5 \,{\mathrm e}^{2} \left ({\mathrm e}^{-2} \expIntegralEi \left (1, -x -2\right )-\frac {{\mathrm e}^{x}}{2+x}-\frac {{\mathrm e}^{x}}{3+x}-3 \,{\mathrm e}^{-3} \expIntegralEi \left (1, -3-x \right )\right )+5 \,{\mathrm e}^{2} \left (-3 \,{\mathrm e}^{-2} \expIntegralEi \left (1, -x -2\right )+\frac {2 \,{\mathrm e}^{x}}{2+x}+\frac {3 \,{\mathrm e}^{x}}{3+x}+8 \,{\mathrm e}^{-3} \expIntegralEi \left (1, -3-x \right )\right )\) | \(262\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maxima [B] time = 0.75, size = 117, normalized size = 3.77 \begin {gather*} -x + \frac {{\left (x {\left (e^{2} + 2\right )} + 2 \, e^{2} + 2\right )} e^{x}}{x^{3} + 5 \, x^{2} + 6 \, x} + \frac {97 \, x + 210}{x^{2} + 5 \, x + 6} - \frac {10 \, {\left (35 \, x + 78\right )}}{x^{2} + 5 \, x + 6} + \frac {37 \, {\left (13 \, x + 30\right )}}{x^{2} + 5 \, x + 6} - \frac {60 \, {\left (5 \, x + 12\right )}}{x^{2} + 5 \, x + 6} + \frac {36 \, {\left (2 \, x + 5\right )}}{x^{2} + 5 \, x + 6} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [B] time = 0.66, size = 37, normalized size = 1.19 \begin {gather*} \frac {{\mathrm {e}}^x\,\left (2\,{\mathrm {e}}^2+2\right )+x\,{\mathrm {e}}^x\,\left ({\mathrm {e}}^2+2\right )}{x^3+5\,x^2+6\,x}-x \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
sympy [A] time = 0.21, size = 31, normalized size = 1.00 \begin {gather*} - x + \frac {\left (2 x + x e^{2} + 2 + 2 e^{2}\right ) e^{x}}{x^{3} + 5 x^{2} + 6 x} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________