3.510 \(\int \frac {x}{1+2 e^x+e^{2 x}} \, dx\)

Optimal. Leaf size=44 \[ -\text {Li}_2\left (-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 ) \]

[Out]

-x+x/(1+exp(x))+1/2*x^2+ln(1+exp(x))-x*ln(1+exp(x))-polylog(2,-exp(x))

________________________________________________________________________________________

Rubi [A]  time = 0.13, 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 = {6688, 2185, 2184, 2190, 2279, 2391, 2191, 2282, 36, 29, 31} \[ -\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 ) \]

Antiderivative was successfully verified.

[In]

Int[x/(1 + 2*E^x + E^(2*x)),x]

[Out]

-x + x/(1 + E^x) + x^2/2 + Log[1 + E^x] - x*Log[1 + E^x] - PolyLog[2, -E^x]

Rule 29

Int[(x_)^(-1), x_Symbol] :> Simp[Log[x], x]

Rule 31

Int[((a_) + (b_.)*(x_))^(-1), x_Symbol] :> Simp[Log[RemoveContent[a + b*x, x]]/b, x] /; FreeQ[{a, b}, x]

Rule 36

Int[1/(((a_.) + (b_.)*(x_))*((c_.) + (d_.)*(x_))), x_Symbol] :> Dist[b/(b*c - a*d), Int[1/(a + b*x), x], x] -
Dist[d/(b*c - a*d), Int[1/(c + d*x), x], x] /; FreeQ[{a, b, c, d}, x] && NeQ[b*c - a*d, 0]

Rule 2184

Int[((c_.) + (d_.)*(x_))^(m_.)/((a_) + (b_.)*((F_)^((g_.)*((e_.) + (f_.)*(x_))))^(n_.)), x_Symbol] :> Simp[(c
+ d*x)^(m + 1)/(a*d*(m + 1)), x] - Dist[b/a, Int[((c + d*x)^m*(F^(g*(e + f*x)))^n)/(a + b*(F^(g*(e + f*x)))^n)
, x], x] /; FreeQ[{F, a, b, c, d, e, f, g, n}, x] && IGtQ[m, 0]

Rule 2185

Int[((a_) + (b_.)*((F_)^((g_.)*((e_.) + (f_.)*(x_))))^(n_.))^(p_)*((c_.) + (d_.)*(x_))^(m_.), x_Symbol] :> Dis
t[1/a, Int[(c + d*x)^m*(a + b*(F^(g*(e + f*x)))^n)^(p + 1), x], x] - Dist[b/a, Int[(c + d*x)^m*(F^(g*(e + f*x)
))^n*(a + b*(F^(g*(e + f*x)))^n)^p, x], x] /; FreeQ[{F, a, b, c, d, e, f, g, n}, x] && ILtQ[p, 0] && IGtQ[m, 0
]

Rule 2190

Int[(((F_)^((g_.)*((e_.) + (f_.)*(x_))))^(n_.)*((c_.) + (d_.)*(x_))^(m_.))/((a_) + (b_.)*((F_)^((g_.)*((e_.) +
 (f_.)*(x_))))^(n_.)), x_Symbol] :> Simp[((c + d*x)^m*Log[1 + (b*(F^(g*(e + f*x)))^n)/a])/(b*f*g*n*Log[F]), x]
 - Dist[(d*m)/(b*f*g*n*Log[F]), Int[(c + d*x)^(m - 1)*Log[1 + (b*(F^(g*(e + f*x)))^n)/a], x], x] /; FreeQ[{F,
a, b, c, d, e, f, g, n}, x] && IGtQ[m, 0]

Rule 2191

Int[((F_)^((g_.)*((e_.) + (f_.)*(x_))))^(n_.)*((a_.) + (b_.)*((F_)^((g_.)*((e_.) + (f_.)*(x_))))^(n_.))^(p_.)*
((c_.) + (d_.)*(x_))^(m_.), x_Symbol] :> Simp[((c + d*x)^m*(a + b*(F^(g*(e + f*x)))^n)^(p + 1))/(b*f*g*n*(p +
1)*Log[F]), x] - Dist[(d*m)/(b*f*g*n*(p + 1)*Log[F]), Int[(c + d*x)^(m - 1)*(a + b*(F^(g*(e + f*x)))^n)^(p + 1
), x], x] /; FreeQ[{F, a, b, c, d, e, f, g, m, n, p}, x] && NeQ[p, -1]

Rule 2279

Int[Log[(a_) + (b_.)*((F_)^((e_.)*((c_.) + (d_.)*(x_))))^(n_.)], x_Symbol] :> Dist[1/(d*e*n*Log[F]), Subst[Int
[Log[a + b*x]/x, x], x, (F^(e*(c + d*x)))^n], x] /; FreeQ[{F, a, b, c, d, e, n}, x] && GtQ[a, 0]

Rule 2282

Int[u_, x_Symbol] :> With[{v = FunctionOfExponential[u, x]}, Dist[v/D[v, x], Subst[Int[FunctionOfExponentialFu
nction[u, x]/x, x], x, v], x]] /; FunctionOfExponentialQ[u, x] &&  !MatchQ[u, (w_)*((a_.)*(v_)^(n_))^(m_) /; F
reeQ[{a, m, n}, x] && IntegerQ[m*n]] &&  !MatchQ[u, E^((c_.)*((a_.) + (b_.)*x))*(F_)[v_] /; FreeQ[{a, b, c}, x
] && InverseFunctionQ[F[x]]]

Rule 2391

Int[Log[(c_.)*((d_) + (e_.)*(x_)^(n_.))]/(x_), x_Symbol] :> -Simp[PolyLog[2, -(c*e*x^n)]/n, x] /; FreeQ[{c, d,
 e, n}, x] && EqQ[c*d, 1]

Rule 6688

Int[u_, x_Symbol] :> With[{v = SimplifyIntegrand[u, x]}, Int[v, x] /; SimplerIntegrandQ[v, u, x]]

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-\operatorname {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 )-\operatorname {Subst}\left (\int \frac {1}{x} \, dx,x,e^x\right )+\operatorname {Subst}\left (\int \frac {1}{1+x} \, dx,x,e^x\right )+\operatorname {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.06, size = 38, normalized size = 0.86 \[ -\text {Li}_2\left (-e^x\right )+\frac {1}{2} x \left (x+\frac {2}{e^x+1}-2\right )-(x-1) \log \left (e^x+1\right ) \]

Antiderivative was successfully verified.

[In]

Integrate[x/(1 + 2*E^x + E^(2*x)),x]

[Out]

(x*(-2 + 2/(1 + E^x) + x))/2 - (-1 + x)*Log[1 + E^x] - PolyLog[2, -E^x]

________________________________________________________________________________________

fricas [A]  time = 0.41, size = 49, normalized size = 1.11 \[ \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 )}} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(x/(1+2*exp(x)+exp(2*x)),x, algorithm="fricas")

[Out]

1/2*(x^2 - 2*(e^x + 1)*dilog(-e^x) + (x^2 - 2*x)*e^x - 2*((x - 1)*e^x + x - 1)*log(e^x + 1))/(e^x + 1)

________________________________________________________________________________________

giac [F]  time = 0.00, size = 0, normalized size = 0.00 \[ \int \frac {x}{e^{\left (2 \, x\right )} + 2 \, e^{x} + 1}\,{d x} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(x/(1+2*exp(x)+exp(2*x)),x, algorithm="giac")

[Out]

integrate(x/(e^(2*x) + 2*e^x + 1), x)

________________________________________________________________________________________

maple [A]  time = 0.02, size = 38, normalized size = 0.86 \[ \frac {x^{2}}{2}-\frac {x \,{\mathrm e}^{x}}{{\mathrm e}^{x}+1}-x \ln \left ({\mathrm e}^{x}+1\right )-\dilog \left ({\mathrm e}^{x}+1\right )+\ln \left ({\mathrm e}^{x}+1\right ) \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(x/(1+2*exp(x)+exp(2*x)),x)

[Out]

ln(exp(x)+1)-x*exp(x)/(exp(x)+1)-dilog(exp(x)+1)-x*ln(exp(x)+1)+1/2*x^2

________________________________________________________________________________________

maxima [A]  time = 0.78, size = 37, normalized size = 0.84 \[ \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 ) \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(x/(1+2*exp(x)+exp(2*x)),x, algorithm="maxima")

[Out]

1/2*x^2 - x*log(e^x + 1) - x + x/(e^x + 1) - dilog(-e^x) + log(e^x + 1)

________________________________________________________________________________________

mupad [F]  time = 0.00, size = -1, normalized size = -0.02 \[ \int \frac {x}{{\mathrm {e}}^{2\,x}+2\,{\mathrm {e}}^x+1} \,d x \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(x/(exp(2*x) + 2*exp(x) + 1),x)

[Out]

int(x/(exp(2*x) + 2*exp(x) + 1), x)

________________________________________________________________________________________

sympy [F]  time = 0.00, size = 0, normalized size = 0.00 \[ \frac {x}{e^{x} + 1} + \int \frac {x - 1}{e^{x} + 1}\, dx \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(x/(1+2*exp(x)+exp(2*x)),x)

[Out]

x/(exp(x) + 1) + Integral((x - 1)/(exp(x) + 1), x)

________________________________________________________________________________________