3.6.30 \(\int \frac {x}{2+e^{-x}+e^x} \, dx\) [530]

Optimal. Leaf size=20 \[ x-\frac {x}{1+e^x}-\log \left (1+e^x\right ) \]

[Out]

x-x/(1+exp(x))-ln(1+exp(x))

________________________________________________________________________________________

Rubi [A]
time = 0.09, antiderivative size = 20, normalized size of antiderivative = 1.00, number of steps used = 7, number of rules used = 7, integrand size = 14, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.500, Rules used = {2299, 6820, 2222, 2320, 36, 29, 31} \begin {gather*} -\frac {x}{e^x+1}+x-\log \left (e^x+1\right ) \end {gather*}

Antiderivative was successfully verified.

[In]

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

[Out]

x - x/(1 + E^x) - Log[1 + 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 2222

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 2299

Int[(u_)/((a_) + (b_.)*(F_)^(v_) + (c_.)*(F_)^(w_)), x_Symbol] :> Int[u*(F^v/(c + a*F^v + b*F^(2*v))), x] /; F
reeQ[{F, a, b, c}, x] && EqQ[w, -v] && LinearQ[v, x] && If[RationalQ[Coefficient[v, x, 1]], GtQ[Coefficient[v,
 x, 1], 0], LtQ[LeafCount[v], LeafCount[w]]]

Rule 2320

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 6820

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

Rubi steps

\begin {align*} \int \frac {x}{2+e^{-x}+e^x} \, dx &=\int \frac {e^x x}{1+2 e^x+e^{2 x}} \, dx\\ &=\int \frac {e^x x}{\left (1+e^x\right )^2} \, dx\\ &=-\frac {x}{1+e^x}+\int \frac {1}{1+e^x} \, dx\\ &=-\frac {x}{1+e^x}+\text {Subst}\left (\int \frac {1}{x (1+x)} \, dx,x,e^x\right )\\ &=-\frac {x}{1+e^x}+\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 )\\ &=x-\frac {x}{1+e^x}-\log \left (1+e^x\right )\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]
time = 0.03, size = 20, normalized size = 1.00 \begin {gather*} x-\frac {x}{1+e^x}-\log \left (1+e^x\right ) \end {gather*}

Antiderivative was successfully verified.

[In]

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

[Out]

x - x/(1 + E^x) - Log[1 + E^x]

________________________________________________________________________________________

Maple [A]
time = 0.02, size = 19, normalized size = 0.95

method result size
default \(-\ln \left (1+{\mathrm e}^{x}\right )+\frac {x \,{\mathrm e}^{x}}{1+{\mathrm e}^{x}}\) \(19\)
norman \(-\ln \left (1+{\mathrm e}^{x}\right )+\frac {x \,{\mathrm e}^{x}}{1+{\mathrm e}^{x}}\) \(19\)
risch \(x -\frac {x}{1+{\mathrm e}^{x}}-\ln \left (1+{\mathrm e}^{x}\right )\) \(19\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(x/(2+exp(-x)+exp(x)),x,method=_RETURNVERBOSE)

[Out]

-ln(1+exp(x))+x*exp(x)/(1+exp(x))

________________________________________________________________________________________

Maxima [A]
time = 0.28, size = 18, normalized size = 0.90 \begin {gather*} \frac {x e^{x}}{e^{x} + 1} - \log \left (e^{x} + 1\right ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Fricas [A]
time = 0.42, size = 23, normalized size = 1.15 \begin {gather*} \frac {x e^{x} - {\left (e^{x} + 1\right )} \log \left (e^{x} + 1\right )}{e^{x} + 1} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Sympy [A]
time = 0.03, size = 14, normalized size = 0.70 \begin {gather*} x - \frac {x}{e^{x} + 1} - \log {\left (e^{x} + 1 \right )} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(x/(2+exp(-x)+exp(x)),x)

[Out]

x - x/(exp(x) + 1) - log(exp(x) + 1)

________________________________________________________________________________________

Giac [A]
time = 4.94, size = 28, normalized size = 1.40 \begin {gather*} \frac {x e^{x} - e^{x} \log \left (e^{x} + 1\right ) - \log \left (e^{x} + 1\right )}{e^{x} + 1} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Mupad [B]
time = 0.06, size = 18, normalized size = 0.90 \begin {gather*} \frac {x\,{\mathrm {e}}^x}{{\mathrm {e}}^x+1}-\ln \left ({\mathrm {e}}^x+1\right ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(x/(exp(-x) + exp(x) + 2),x)

[Out]

(x*exp(x))/(exp(x) + 1) - log(exp(x) + 1)

________________________________________________________________________________________