Optimal. Leaf size=31 \[ -2-x+\frac {e^x \left (2+e^2-\frac {4}{4+2 x}\right )}{x (3+x)} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 1.11, 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 = {6820, 6874,
2208, 2209} \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 2208
Rule 2209
Rule 6820
Rule 6874
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 = 4.67, size = 34, normalized size = 1.10 \begin {gather*} -x+\frac {e^x \left (2 (1+x)+e^2 (2+x)\right )}{x (2+x) (3+x)} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [C] Result contains higher order function than in optimal. Order 4 vs. order
3.
time = 0.17, size = 262, normalized size = 8.45
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 (-\frac {9 \,{\mathrm e}^{x}}{3+x}-21 \,{\mathrm e}^{-3} \expIntegral \left (1, -3-x \right )-\frac {4 \,{\mathrm e}^{x}}{2+x}+8 \,{\mathrm e}^{-2} \expIntegral \left (1, -x -2\right )\right )-x +\frac {{\mathrm e}^{x}}{3 x}-\frac {4 \,{\mathrm e}^{x}}{3 \left (3+x \right )}+\frac {{\mathrm e}^{x}}{2+x}-12 \,{\mathrm e}^{2} \left (-\frac {{\mathrm e}^{x}}{36 x}+\frac {\expIntegral \left (1, -x \right )}{54}-\frac {{\mathrm e}^{x}}{9 \left (3+x \right )}-\frac {11 \,{\mathrm e}^{-3} \expIntegral \left (1, -3-x \right )}{27}-\frac {{\mathrm e}^{x}}{4 \left (2+x \right )}\right )-8 \,{\mathrm e}^{2} \left (-\frac {\expIntegral \left (1, -x \right )}{36}+\frac {{\mathrm e}^{x}}{3 x +9}+\frac {10 \,{\mathrm e}^{-3} \expIntegral \left (1, -3-x \right )}{9}+\frac {{\mathrm e}^{x}}{2 x +4}-\frac {{\mathrm e}^{-2} \expIntegral \left (1, -x -2\right )}{4}\right )+5 \,{\mathrm e}^{2} \left (-\frac {{\mathrm e}^{x}}{3+x}-3 \,{\mathrm e}^{-3} \expIntegral \left (1, -3-x \right )-\frac {{\mathrm e}^{x}}{2+x}+{\mathrm e}^{-2} \expIntegral \left (1, -x -2\right )\right )+5 \,{\mathrm e}^{2} \left (\frac {3 \,{\mathrm e}^{x}}{3+x}+8 \,{\mathrm e}^{-3} \expIntegral \left (1, -3-x \right )+\frac {2 \,{\mathrm e}^{x}}{2+x}-3 \,{\mathrm e}^{-2} \expIntegral \left (1, -x -2\right )\right )\) | \(262\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [B] Leaf count of result is larger than twice the leaf count of optimal. 117 vs.
\(2 (30) = 60\).
time = 0.31, 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]
________________________________________________________________________________________
Fricas [A]
time = 0.35, 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]
________________________________________________________________________________________
Sympy [A]
time = 0.09, 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]
________________________________________________________________________________________
Giac [A]
time = 0.42, 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]
________________________________________________________________________________________
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]
________________________________________________________________________________________