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

   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 = 8 \[ \int \frac {1}{2+e^x} \, dx=-\text {arctanh}\left (1+e^x\right ) \]

[Out]

-arctanh(exp(x)+1)

Rubi [A] (verified)

Time = 0.01 (sec) , antiderivative size = 16, normalized size of antiderivative = 2.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}{2+e^x} \, dx=\frac {x}{2}-\frac {1}{2} \log \left (e^x+2\right ) \]

[In]

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

[Out]

x/2 - Log[2 + E^x]/2

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

Mathematica [A] (verified)

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

[In]

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

[Out]

-ArcTanh[1 + E^x]

Maple [A] (verified)

Time = 0.01 (sec) , antiderivative size = 12, normalized size of antiderivative = 1.50

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

[In]

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

[Out]

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

Fricas [A] (verification not implemented)

none

Time = 0.25 (sec) , antiderivative size = 11, normalized size of antiderivative = 1.38 \[ \int \frac {1}{2+e^x} \, dx=\frac {1}{2} \, x - \frac {1}{2} \, \log \left (e^{x} + 2\right ) \]

[In]

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

[Out]

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

Sympy [A] (verification not implemented)

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

[In]

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

[Out]

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

Maxima [A] (verification not implemented)

none

Time = 0.21 (sec) , antiderivative size = 11, normalized size of antiderivative = 1.38 \[ \int \frac {1}{2+e^x} \, dx=\frac {1}{2} \, x - \frac {1}{2} \, \log \left (e^{x} + 2\right ) \]

[In]

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

[Out]

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

Giac [A] (verification not implemented)

none

Time = 0.26 (sec) , antiderivative size = 11, normalized size of antiderivative = 1.38 \[ \int \frac {1}{2+e^x} \, dx=\frac {1}{2} \, x - \frac {1}{2} \, \log \left (e^{x} + 2\right ) \]

[In]

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

[Out]

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

Mupad [B] (verification not implemented)

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

[In]

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

[Out]

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