Optimal. Leaf size=32 \[ \frac {-\frac {e^{2 e^{e^4}+2 x^2}}{x^2}+2 x}{\left (2+e^x\right )^2} \]
________________________________________________________________________________________
Rubi [B] time = 1.63, antiderivative size = 148, normalized size of antiderivative = 4.62, number of steps used = 31, number of rules used = 14, integrand size = 94, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.149, Rules used = {6741, 6742, 2185, 2184, 2190, 2279, 2391, 2191, 2282, 36, 29, 31, 44, 2288} \begin {gather*} \frac {x^2}{2}-\frac {e^{2 x^2+2 e^{e^4}} \left (e^x x^2+2 x^2\right )}{\left (e^x+2\right )^3 x^4}-\frac {1}{8} (1-2 x)^2+\frac {1-2 x}{e^x+2}+\frac {2 x}{e^x+2}+\frac {2 x}{\left (e^x+2\right )^2}-\frac {x}{2}-\frac {1}{e^x+2}-\frac {1}{2} (1-2 x) \log \left (\frac {e^x}{2}+1\right )-x \log \left (\frac {e^x}{2}+1\right )+\frac {1}{2} \log \left (e^x+2\right ) \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 29
Rule 31
Rule 36
Rule 44
Rule 2184
Rule 2185
Rule 2190
Rule 2191
Rule 2279
Rule 2282
Rule 2288
Rule 2391
Rule 6741
Rule 6742
Rubi steps
\begin {gather*} \begin {aligned} \text {integral} &=\int \frac {4 x^3+e^x \left (2 x^3-4 x^4\right )+e^{2 e^{e^4}+2 x^2} \left (4-8 x^2+e^x \left (2+2 x-4 x^2\right )\right )}{\left (2+e^x\right )^3 x^3} \, dx\\ &=\int \left (-\frac {2 \left (-2-e^x+2 e^x x\right )}{\left (2+e^x\right )^3}-\frac {2 e^{2 e^{e^4}+2 x^2} \left (-2-e^x-e^x x+4 x^2+2 e^x x^2\right )}{\left (2+e^x\right )^3 x^3}\right ) \, dx\\ &=-\left (2 \int \frac {-2-e^x+2 e^x x}{\left (2+e^x\right )^3} \, dx\right )-2 \int \frac {e^{2 e^{e^4}+2 x^2} \left (-2-e^x-e^x x+4 x^2+2 e^x x^2\right )}{\left (2+e^x\right )^3 x^3} \, dx\\ &=-\frac {e^{2 e^{e^4}+2 x^2} \left (2 x^2+e^x x^2\right )}{\left (2+e^x\right )^3 x^4}-2 \int \left (-\frac {4 x}{\left (2+e^x\right )^3}+\frac {-1+2 x}{\left (2+e^x\right )^2}\right ) \, dx\\ &=-\frac {e^{2 e^{e^4}+2 x^2} \left (2 x^2+e^x x^2\right )}{\left (2+e^x\right )^3 x^4}-2 \int \frac {-1+2 x}{\left (2+e^x\right )^2} \, dx+8 \int \frac {x}{\left (2+e^x\right )^3} \, dx\\ &=-\frac {e^{2 e^{e^4}+2 x^2} \left (2 x^2+e^x x^2\right )}{\left (2+e^x\right )^3 x^4}-4 \int \frac {e^x x}{\left (2+e^x\right )^3} \, dx+4 \int \frac {x}{\left (2+e^x\right )^2} \, dx+\int \frac {e^x (-1+2 x)}{\left (2+e^x\right )^2} \, dx-\int \frac {-1+2 x}{2+e^x} \, dx\\ &=\frac {1-2 x}{2+e^x}-\frac {1}{8} (1-2 x)^2+\frac {2 x}{\left (2+e^x\right )^2}-\frac {e^{2 e^{e^4}+2 x^2} \left (2 x^2+e^x x^2\right )}{\left (2+e^x\right )^3 x^4}+\frac {1}{2} \int \frac {e^x (-1+2 x)}{2+e^x} \, dx-2 \int \frac {1}{\left (2+e^x\right )^2} \, dx+2 \int \frac {1}{2+e^x} \, dx-2 \int \frac {e^x x}{\left (2+e^x\right )^2} \, dx+2 \int \frac {x}{2+e^x} \, dx\\ &=\frac {1-2 x}{2+e^x}-\frac {1}{8} (1-2 x)^2+\frac {2 x}{\left (2+e^x\right )^2}+\frac {2 x}{2+e^x}+\frac {x^2}{2}-\frac {e^{2 e^{e^4}+2 x^2} \left (2 x^2+e^x x^2\right )}{\left (2+e^x\right )^3 x^4}-\frac {1}{2} (1-2 x) \log \left (1+\frac {e^x}{2}\right )-2 \int \frac {1}{2+e^x} \, dx-2 \operatorname {Subst}\left (\int \frac {1}{x (2+x)^2} \, dx,x,e^x\right )+2 \operatorname {Subst}\left (\int \frac {1}{x (2+x)} \, dx,x,e^x\right )-\int \frac {e^x x}{2+e^x} \, dx-\int \log \left (1+\frac {e^x}{2}\right ) \, dx\\ &=\frac {1-2 x}{2+e^x}-\frac {1}{8} (1-2 x)^2+\frac {2 x}{\left (2+e^x\right )^2}+\frac {2 x}{2+e^x}+\frac {x^2}{2}-\frac {e^{2 e^{e^4}+2 x^2} \left (2 x^2+e^x x^2\right )}{\left (2+e^x\right )^3 x^4}-\frac {1}{2} (1-2 x) \log \left (1+\frac {e^x}{2}\right )-x \log \left (1+\frac {e^x}{2}\right )-2 \operatorname {Subst}\left (\int \frac {1}{x (2+x)} \, dx,x,e^x\right )-2 \operatorname {Subst}\left (\int \left (\frac {1}{4 x}-\frac {1}{2 (2+x)^2}-\frac {1}{4 (2+x)}\right ) \, dx,x,e^x\right )+\int \log \left (1+\frac {e^x}{2}\right ) \, dx+\operatorname {Subst}\left (\int \frac {1}{x} \, dx,x,e^x\right )-\operatorname {Subst}\left (\int \frac {1}{2+x} \, dx,x,e^x\right )-\operatorname {Subst}\left (\int \frac {\log \left (1+\frac {x}{2}\right )}{x} \, dx,x,e^x\right )\\ &=-\frac {1}{2+e^x}+\frac {1-2 x}{2+e^x}-\frac {1}{8} (1-2 x)^2+\frac {x}{2}+\frac {2 x}{\left (2+e^x\right )^2}+\frac {2 x}{2+e^x}+\frac {x^2}{2}-\frac {e^{2 e^{e^4}+2 x^2} \left (2 x^2+e^x x^2\right )}{\left (2+e^x\right )^3 x^4}-\frac {1}{2} (1-2 x) \log \left (1+\frac {e^x}{2}\right )-x \log \left (1+\frac {e^x}{2}\right )-\frac {1}{2} \log \left (2+e^x\right )+\text {Li}_2\left (-\frac {e^x}{2}\right )-\operatorname {Subst}\left (\int \frac {1}{x} \, dx,x,e^x\right )+\operatorname {Subst}\left (\int \frac {1}{2+x} \, dx,x,e^x\right )+\operatorname {Subst}\left (\int \frac {\log \left (1+\frac {x}{2}\right )}{x} \, dx,x,e^x\right )\\ &=-\frac {1}{2+e^x}+\frac {1-2 x}{2+e^x}-\frac {1}{8} (1-2 x)^2-\frac {x}{2}+\frac {2 x}{\left (2+e^x\right )^2}+\frac {2 x}{2+e^x}+\frac {x^2}{2}-\frac {e^{2 e^{e^4}+2 x^2} \left (2 x^2+e^x x^2\right )}{\left (2+e^x\right )^3 x^4}-\frac {1}{2} (1-2 x) \log \left (1+\frac {e^x}{2}\right )-x \log \left (1+\frac {e^x}{2}\right )+\frac {1}{2} \log \left (2+e^x\right )\\ \end {aligned} \end {gather*}
________________________________________________________________________________________
Mathematica [A] time = 0.38, size = 31, normalized size = 0.97 \begin {gather*} -\frac {e^{2 \left (e^{e^4}+x^2\right )}-2 x^3}{\left (2+e^x\right )^2 x^2} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
fricas [A] time = 0.51, size = 44, normalized size = 1.38 \begin {gather*} \frac {2 \, x^{3} - e^{\left (2 \, x^{2} + 2 \, e^{\left (e^{4}\right )}\right )}}{x^{2} e^{\left (2 \, x\right )} + 4 \, x^{2} e^{x} + 4 \, x^{2}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [A] time = 0.32, size = 44, normalized size = 1.38 \begin {gather*} \frac {2 \, x^{3} - e^{\left (2 \, x^{2} + 2 \, e^{\left (e^{4}\right )}\right )}}{x^{2} e^{\left (2 \, x\right )} + 4 \, x^{2} e^{x} + 4 \, x^{2}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [A] time = 0.12, size = 34, normalized size = 1.06
method | result | size |
risch | \(\frac {2 x}{\left ({\mathrm e}^{x}+2\right )^{2}}-\frac {{\mathrm e}^{2 \,{\mathrm e}^{{\mathrm e}^{4}}+2 x^{2}}}{x^{2} \left ({\mathrm e}^{x}+2\right )^{2}}\) | \(34\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maxima [B] time = 1.05, size = 117, normalized size = 3.66 \begin {gather*} \frac {x e^{\left (2 \, x\right )} + 2 \, {\left (2 \, x + 1\right )} e^{x} + 4 \, x + 6}{2 \, {\left (e^{\left (2 \, x\right )} + 4 \, e^{x} + 4\right )}} - \frac {x e^{\left (2 \, x\right )} + 2 \, {\left (2 \, x + 1\right )} e^{x} + 4}{2 \, {\left (e^{\left (2 \, x\right )} + 4 \, e^{x} + 4\right )}} - \frac {e^{\left (2 \, x^{2} + 2 \, e^{\left (e^{4}\right )}\right )}}{x^{2} e^{\left (2 \, x\right )} + 4 \, x^{2} e^{x} + 4 \, x^{2}} - \frac {1}{e^{\left (2 \, x\right )} + 4 \, e^{x} + 4} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [B] time = 0.24, size = 30, normalized size = 0.94 \begin {gather*} -\frac {{\mathrm {e}}^{2\,{\mathrm {e}}^{{\mathrm {e}}^4}}\,{\mathrm {e}}^{2\,x^2}-2\,x^3}{x^2\,{\left ({\mathrm {e}}^x+2\right )}^2} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
sympy [A] time = 0.24, size = 49, normalized size = 1.53 \begin {gather*} \frac {2 x}{e^{2 x} + 4 e^{x} + 4} - \frac {e^{2 x^{2} + 2 e^{e^{4}}}}{x^{2} e^{2 x} + 4 x^{2} e^{x} + 4 x^{2}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________