Optimal. Leaf size=23 \[ \frac {-2+e^x-e^{2 e^{25} x}}{x+x^2} \]
________________________________________________________________________________________
Rubi [B] time = 1.36, antiderivative size = 55, normalized size of antiderivative = 2.39, number of steps used = 24, number of rules used = 7, integrand size = 59, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.119, Rules used = {1594, 27, 6742, 2177, 2178, 6688, 74} \begin {gather*} -\frac {e^x}{x+1}+\frac {e^{2 e^{25} x}}{x+1}+\frac {e^x}{x}-\frac {e^{2 e^{25} x}}{x}-\frac {2}{(x+1) x} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 27
Rule 74
Rule 1594
Rule 2177
Rule 2178
Rule 6688
Rule 6742
Rubi steps
\begin {gather*} \begin {aligned} \text {integral} &=\int \frac {2+4 x+e^x \left (-1-x+x^2\right )+e^{2 e^{25} x} \left (1+2 x+e^{25} \left (-2 x-2 x^2\right )\right )}{x^2 \left (1+2 x+x^2\right )} \, dx\\ &=\int \frac {2+4 x+e^x \left (-1-x+x^2\right )+e^{2 e^{25} x} \left (1+2 x+e^{25} \left (-2 x-2 x^2\right )\right )}{x^2 (1+x)^2} \, dx\\ &=\int \left (\frac {e^{2 e^{25} x} \left (1+2 \left (1-e^{25}\right ) x-2 e^{25} x^2\right )}{x^2 (1+x)^2}+\frac {2-e^x+4 x-e^x x+e^x x^2}{x^2 (1+x)^2}\right ) \, dx\\ &=\int \frac {e^{2 e^{25} x} \left (1+2 \left (1-e^{25}\right ) x-2 e^{25} x^2\right )}{x^2 (1+x)^2} \, dx+\int \frac {2-e^x+4 x-e^x x+e^x x^2}{x^2 (1+x)^2} \, dx\\ &=\int \left (\frac {e^{2 e^{25} x}}{x^2}-\frac {2 e^{25+2 e^{25} x}}{x}-\frac {e^{2 e^{25} x}}{(1+x)^2}+\frac {2 e^{25+2 e^{25} x}}{1+x}\right ) \, dx+\int \frac {2+4 x+e^x \left (-1-x+x^2\right )}{x^2 (1+x)^2} \, dx\\ &=-\left (2 \int \frac {e^{25+2 e^{25} x}}{x} \, dx\right )+2 \int \frac {e^{25+2 e^{25} x}}{1+x} \, dx+\int \frac {e^{2 e^{25} x}}{x^2} \, dx-\int \frac {e^{2 e^{25} x}}{(1+x)^2} \, dx+\int \left (\frac {2 (1+2 x)}{x^2 (1+x)^2}+\frac {e^x \left (-1-x+x^2\right )}{x^2 (1+x)^2}\right ) \, dx\\ &=-\frac {e^{2 e^{25} x}}{x}+\frac {e^{2 e^{25} x}}{1+x}-2 e^{25} \text {Ei}\left (2 e^{25} x\right )+2 e^{25-2 e^{25}} \text {Ei}\left (2 e^{25} (1+x)\right )+2 \int \frac {1+2 x}{x^2 (1+x)^2} \, dx+\left (2 e^{25}\right ) \int \frac {e^{2 e^{25} x}}{x} \, dx-\left (2 e^{25}\right ) \int \frac {e^{2 e^{25} x}}{1+x} \, dx+\int \frac {e^x \left (-1-x+x^2\right )}{x^2 (1+x)^2} \, dx\\ &=-\frac {e^{2 e^{25} x}}{x}+\frac {e^{2 e^{25} x}}{1+x}-\frac {2}{x (1+x)}+\int \left (\frac {e^x}{-1-x}-\frac {e^x}{x^2}+\frac {e^x}{x}+\frac {e^x}{(1+x)^2}\right ) \, dx\\ &=-\frac {e^{2 e^{25} x}}{x}+\frac {e^{2 e^{25} x}}{1+x}-\frac {2}{x (1+x)}+\int \frac {e^x}{-1-x} \, dx-\int \frac {e^x}{x^2} \, dx+\int \frac {e^x}{x} \, dx+\int \frac {e^x}{(1+x)^2} \, dx\\ &=\frac {e^x}{x}-\frac {e^{2 e^{25} x}}{x}-\frac {e^x}{1+x}+\frac {e^{2 e^{25} x}}{1+x}-\frac {2}{x (1+x)}+\text {Ei}(x)-\frac {\text {Ei}(1+x)}{e}-\int \frac {e^x}{x} \, dx+\int \frac {e^x}{1+x} \, dx\\ &=\frac {e^x}{x}-\frac {e^{2 e^{25} x}}{x}-\frac {e^x}{1+x}+\frac {e^{2 e^{25} x}}{1+x}-\frac {2}{x (1+x)}\\ \end {aligned} \end {gather*}
________________________________________________________________________________________
Mathematica [A] time = 0.30, size = 24, normalized size = 1.04 \begin {gather*} -\frac {2-e^x+e^{2 e^{25} x}}{x+x^2} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
fricas [A] time = 0.77, size = 21, normalized size = 0.91 \begin {gather*} -\frac {e^{\left (2 \, x e^{25}\right )} - e^{x} + 2}{x^{2} + x} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [A] time = 0.21, size = 21, normalized size = 0.91 \begin {gather*} -\frac {e^{\left (2 \, x e^{25}\right )} - e^{x} + 2}{x^{2} + x} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [A] time = 0.24, size = 23, normalized size = 1.00
method | result | size |
norman | \(\frac {{\mathrm e}^{x}-{\mathrm e}^{2 x \,{\mathrm e}^{25}}-2}{\left (x +1\right ) x}\) | \(23\) |
risch | \(-\frac {2}{x \left (x +1\right )}+\frac {{\mathrm e}^{x}}{x \left (x +1\right )}-\frac {{\mathrm e}^{2 x \,{\mathrm e}^{25}}}{x \left (x +1\right )}\) | \(39\) |
default | \({\mathrm e}^{-25} \left (-\frac {{\mathrm e}^{2 x \,{\mathrm e}^{25}} {\mathrm e}^{25} \left (2 x \,{\mathrm e}^{25}+{\mathrm e}^{25}\right )}{\left (x \,{\mathrm e}^{25}+{\mathrm e}^{25}\right ) x}-2 \left (2 \,{\mathrm e}^{50} {\mathrm e}^{25}-{\mathrm e}^{75}+{\mathrm e}^{50}\right ) {\mathrm e}^{-25} {\mathrm e}^{-2 \,{\mathrm e}^{25}} \expIntegralEi \left (1, -2 x \,{\mathrm e}^{25}-2 \,{\mathrm e}^{25}\right )-2 \left (-{\mathrm e}^{50}+{\mathrm e}^{75}\right ) {\mathrm e}^{-25} \expIntegralEi \left (1, -2 x \,{\mathrm e}^{25}\right )\right )+\frac {2}{x +1}-\frac {2}{x}+\frac {{\mathrm e}^{x}}{x}-\frac {{\mathrm e}^{x}}{x +1}+2 \,{\mathrm e}^{-50} \left (\frac {{\mathrm e}^{2 x \,{\mathrm e}^{25}} {\mathrm e}^{75}}{x \,{\mathrm e}^{25}+{\mathrm e}^{25}}+{\mathrm e}^{75} \left (2 \,{\mathrm e}^{25}+1\right ) {\mathrm e}^{-25} {\mathrm e}^{-2 \,{\mathrm e}^{25}} \expIntegralEi \left (1, -2 x \,{\mathrm e}^{25}-2 \,{\mathrm e}^{25}\right )-{\mathrm e}^{75} {\mathrm e}^{-25} \expIntegralEi \left (1, -2 x \,{\mathrm e}^{25}\right )\right )-2 \,{\mathrm e}^{-25} \left (\frac {{\mathrm e}^{2 x \,{\mathrm e}^{25}} {\mathrm e}^{75}}{x \,{\mathrm e}^{25}+{\mathrm e}^{25}}+{\mathrm e}^{75} \left (2 \,{\mathrm e}^{25}+1\right ) {\mathrm e}^{-25} {\mathrm e}^{-2 \,{\mathrm e}^{25}} \expIntegralEi \left (1, -2 x \,{\mathrm e}^{25}-2 \,{\mathrm e}^{25}\right )-{\mathrm e}^{75} {\mathrm e}^{-25} \expIntegralEi \left (1, -2 x \,{\mathrm e}^{25}\right )\right )-2 \,{\mathrm e}^{-50} \left (-\frac {{\mathrm e}^{2 x \,{\mathrm e}^{25}} {\mathrm e}^{100}}{x \,{\mathrm e}^{25}+{\mathrm e}^{25}}-2 \,{\mathrm e}^{100} {\mathrm e}^{-2 \,{\mathrm e}^{25}} \expIntegralEi \left (1, -2 x \,{\mathrm e}^{25}-2 \,{\mathrm e}^{25}\right )\right )\) | \(314\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maxima [A] time = 0.41, size = 42, normalized size = 1.83 \begin {gather*} -\frac {2 \, {\left (2 \, x + 1\right )}}{x^{2} + x} - \frac {e^{\left (2 \, x e^{25}\right )} - e^{x}}{x^{2} + x} + \frac {4}{x + 1} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [B] time = 4.27, size = 22, normalized size = 0.96 \begin {gather*} -\frac {{\mathrm {e}}^{2\,x\,{\mathrm {e}}^{25}}-{\mathrm {e}}^x+2}{x\,\left (x+1\right )} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
sympy [A] time = 0.83, size = 27, normalized size = 1.17 \begin {gather*} \frac {e^{x}}{x^{2} + x} - \frac {e^{2 x e^{25}}}{x^{2} + x} - \frac {2}{x^{2} + x} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________