3.530 \(\int \frac {x}{2+e^{-x}+e^x} \, dx\)

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

[Out]

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

________________________________________________________________________________________

Rubi [A]  time = 0.13, 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 = {2267, 6688, 2191, 2282, 36, 29, 31} \[ -\frac {x}{e^x+1}+x-\log \left (e^x+1\right ) \]

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 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 2267

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 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 6688

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}+\operatorname {Subst}\left (\int \frac {1}{x (1+x)} \, dx,x,e^x\right )\\ &=-\frac {x}{1+e^x}+\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 )\\ &=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 \[ -\frac {x}{e^x+1}+x-\log \left (e^x+1\right ) \]

Antiderivative was successfully verified.

[In]

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

[Out]

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

________________________________________________________________________________________

fricas [A]  time = 0.40, size = 23, normalized size = 1.15 \[ \frac {x e^{x} - {\left (e^{x} + 1\right )} \log \left (e^{x} + 1\right )}{e^{x} + 1} \]

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)

________________________________________________________________________________________

giac [A]  time = 0.29, size = 28, normalized size = 1.40 \[ \frac {x e^{x} - e^{x} \log \left (e^{x} + 1\right ) - \log \left (e^{x} + 1\right )}{e^{x} + 1} \]

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)

________________________________________________________________________________________

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

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

maxima [A]  time = 1.11, size = 18, normalized size = 0.90 \[ \frac {x e^{x}}{e^{x} + 1} - \log \left (e^{x} + 1\right ) \]

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)

________________________________________________________________________________________

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

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)

________________________________________________________________________________________

sympy [A]  time = 0.09, size = 14, normalized size = 0.70 \[ x - \frac {x}{e^{x} + 1} - \log {\left (e^{x} + 1 \right )} \]

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)

________________________________________________________________________________________