\(\int \frac {1}{1+e^x} \, dx\) [73]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [A] (verified)
   Fricas [A] (verification not implemented)
   Sympy [A] (verification not implemented)
   Maxima [A] (verification not implemented)
   Giac [A] (verification not implemented)
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 7, antiderivative size = 10 \[ \int \frac {1}{1+e^x} \, dx=x-\log \left (1+e^x\right ) \]

[Out]

x-ln(1+exp(x))

Rubi [A] (verified)

Time = 0.00 (sec) , antiderivative size = 10, normalized size of antiderivative = 1.00, number of steps used = 4, number of rules used = 4, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.571, Rules used = {2320, 36, 29, 31} \[ \int \frac {1}{1+e^x} \, dx=x-\log \left (e^x+1\right ) \]

[In]

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

[Out]

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

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

Mathematica [A] (verified)

Time = 0.01 (sec) , antiderivative size = 10, normalized size of antiderivative = 1.00 \[ \int \frac {1}{1+e^x} \, dx=-2 \text {arctanh}\left (1+2 e^x\right ) \]

[In]

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

[Out]

-2*ArcTanh[1 + 2*E^x]

Maple [A] (verified)

Time = 0.02 (sec) , antiderivative size = 10, normalized size of antiderivative = 1.00

method result size
norman \(x -\ln \left (1+{\mathrm e}^{x}\right )\) \(10\)
risch \(x -\ln \left (1+{\mathrm e}^{x}\right )\) \(10\)
parallelrisch \(x -\ln \left (1+{\mathrm e}^{x}\right )\) \(10\)
derivativedivides \(-\ln \left (1+{\mathrm e}^{x}\right )+\ln \left ({\mathrm e}^{x}\right )\) \(12\)
default \(-\ln \left (1+{\mathrm e}^{x}\right )+\ln \left ({\mathrm e}^{x}\right )\) \(12\)

[In]

int(1/(1+exp(x)),x,method=_RETURNVERBOSE)

[Out]

x-ln(1+exp(x))

Fricas [A] (verification not implemented)

none

Time = 0.24 (sec) , antiderivative size = 9, normalized size of antiderivative = 0.90 \[ \int \frac {1}{1+e^x} \, dx=x - \log \left (e^{x} + 1\right ) \]

[In]

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

[Out]

x - log(e^x + 1)

Sympy [A] (verification not implemented)

Time = 0.04 (sec) , antiderivative size = 7, normalized size of antiderivative = 0.70 \[ \int \frac {1}{1+e^x} \, dx=x - \log {\left (e^{x} + 1 \right )} \]

[In]

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

[Out]

x - log(exp(x) + 1)

Maxima [A] (verification not implemented)

none

Time = 0.20 (sec) , antiderivative size = 9, normalized size of antiderivative = 0.90 \[ \int \frac {1}{1+e^x} \, dx=x - \log \left (e^{x} + 1\right ) \]

[In]

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

[Out]

x - log(e^x + 1)

Giac [A] (verification not implemented)

none

Time = 0.27 (sec) , antiderivative size = 9, normalized size of antiderivative = 0.90 \[ \int \frac {1}{1+e^x} \, dx=x - \log \left (e^{x} + 1\right ) \]

[In]

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

[Out]

x - log(e^x + 1)

Mupad [B] (verification not implemented)

Time = 0.05 (sec) , antiderivative size = 9, normalized size of antiderivative = 0.90 \[ \int \frac {1}{1+e^x} \, dx=x-\ln \left ({\mathrm {e}}^x+1\right ) \]

[In]

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

[Out]

x - log(exp(x) + 1)