Optimal. Leaf size=44 \[ -x+\frac {x}{1+e^x}+\frac {x^2}{2}+\log \left (1+e^x\right )-x \log \left (1+e^x\right )-\text {Li}_2\left (-e^x\right ) \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.09, antiderivative size = 44, normalized size of antiderivative = 1.00, number of steps
used = 11, number of rules used = 11, integrand size = 16, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.688, Rules used = {6820, 2216,
2215, 2221, 2317, 2438, 2222, 2320, 36, 29, 31} \begin {gather*} -\text {PolyLog}\left (2,-e^x\right )+\frac {x^2}{2}+\frac {x}{e^x+1}-x-x \log \left (e^x+1\right )+\log \left (e^x+1\right ) \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 29
Rule 31
Rule 36
Rule 2215
Rule 2216
Rule 2221
Rule 2222
Rule 2317
Rule 2320
Rule 2438
Rule 6820
Rubi steps
\begin {align*} \int \frac {x}{1+2 e^x+e^{2 x}} \, dx &=\int \frac {x}{\left (1+e^x\right )^2} \, dx\\ &=-\int \frac {e^x x}{\left (1+e^x\right )^2} \, dx+\int \frac {x}{1+e^x} \, dx\\ &=\frac {x}{1+e^x}+\frac {x^2}{2}-\int \frac {1}{1+e^x} \, dx-\int \frac {e^x x}{1+e^x} \, dx\\ &=\frac {x}{1+e^x}+\frac {x^2}{2}-x \log \left (1+e^x\right )+\int \log \left (1+e^x\right ) \, dx-\text {Subst}\left (\int \frac {1}{x (1+x)} \, dx,x,e^x\right )\\ &=\frac {x}{1+e^x}+\frac {x^2}{2}-x \log \left (1+e^x\right )-\text {Subst}\left (\int \frac {1}{x} \, dx,x,e^x\right )+\text {Subst}\left (\int \frac {1}{1+x} \, dx,x,e^x\right )+\text {Subst}\left (\int \frac {\log (1+x)}{x} \, dx,x,e^x\right )\\ &=-x+\frac {x}{1+e^x}+\frac {x^2}{2}+\log \left (1+e^x\right )-x \log \left (1+e^x\right )-\text {Li}_2\left (-e^x\right )\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.05, size = 38, normalized size = 0.86 \begin {gather*} \frac {1}{2} x \left (-2+\frac {2}{1+e^x}+x\right )-(-1+x) \log \left (1+e^x\right )-\text {Li}_2\left (-e^x\right ) \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.02, size = 38, normalized size = 0.86
method | result | size |
default | \(\ln \left (1+{\mathrm e}^{x}\right )-\frac {x \,{\mathrm e}^{x}}{1+{\mathrm e}^{x}}-\dilog \left (1+{\mathrm e}^{x}\right )-x \ln \left (1+{\mathrm e}^{x}\right )+\frac {x^{2}}{2}\) | \(38\) |
risch | \(\frac {x}{1+{\mathrm e}^{x}}+\frac {x^{2}}{2}-x \ln \left (1+{\mathrm e}^{x}\right )-\polylog \left (2, -{\mathrm e}^{x}\right )-\ln \left ({\mathrm e}^{x}\right )+\ln \left (1+{\mathrm e}^{x}\right )\) | \(41\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A]
time = 0.28, size = 37, normalized size = 0.84 \begin {gather*} \frac {1}{2} \, x^{2} - x \log \left (e^{x} + 1\right ) - x + \frac {x}{e^{x} + 1} - {\rm Li}_2\left (-e^{x}\right ) + \log \left (e^{x} + 1\right ) \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 0.38, size = 49, normalized size = 1.11 \begin {gather*} \frac {x^{2} - 2 \, {\left (e^{x} + 1\right )} {\rm Li}_2\left (-e^{x}\right ) + {\left (x^{2} - 2 \, x\right )} e^{x} - 2 \, {\left ({\left (x - 1\right )} e^{x} + x - 1\right )} \log \left (e^{x} + 1\right )}{2 \, {\left (e^{x} + 1\right )}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \frac {x}{e^{x} + 1} + \int \frac {x - 1}{e^{x} + 1}\, dx \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {could not integrate} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [F]
time = 0.00, size = -1, normalized size = -0.02 \begin {gather*} \int \frac {x}{{\mathrm {e}}^{2\,x}+2\,{\mathrm {e}}^x+1} \,d x \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________