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

Optimal. Leaf size=10 \[ x-\log \left (e^x+1\right ) \]

[Out]

x - Log[1 + E^x]

________________________________________________________________________________________

Rubi [A]  time = 0.0061695, antiderivative size = 10, normalized size of antiderivative = 1., number of steps used = 4, number of rules used = 4, integrand size = 7, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.571, Rules used = {2282, 36, 29, 31} \[ x-\log \left (e^x+1\right ) \]

Antiderivative was successfully verified.

[In]

Int[(1 + E^x)^(-1),x]

[Out]

x - Log[1 + E^x]

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

Rubi steps

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

Mathematica [A]  time = 0.0025529, size = 10, normalized size = 1. \[ x-\log \left (e^x+1\right ) \]

Antiderivative was successfully verified.

[In]

Integrate[(1 + E^x)^(-1),x]

[Out]

x - Log[1 + E^x]

________________________________________________________________________________________

Maple [A]  time = 0.006, size = 12, normalized size = 1.2 \begin{align*} \ln \left ({{\rm e}^{x}} \right ) -\ln \left ( 1+{{\rm e}^{x}} \right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Maxima [A]  time = 0.960611, size = 12, normalized size = 1.2 \begin{align*} x - \log \left (e^{x} + 1\right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

x - log(e^x + 1)

________________________________________________________________________________________

Fricas [A]  time = 0.478029, size = 24, normalized size = 2.4 \begin{align*} x - \log \left (e^{x} + 1\right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

x - log(e^x + 1)

________________________________________________________________________________________

Sympy [A]  time = 0.070752, size = 7, normalized size = 0.7 \begin{align*} x - \log{\left (e^{x} + 1 \right )} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

x - log(exp(x) + 1)

________________________________________________________________________________________

Giac [A]  time = 1.07975, size = 12, normalized size = 1.2 \begin{align*} x - \log \left (e^{x} + 1\right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

x - log(e^x + 1)