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

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

[Out]

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

________________________________________________________________________________________

Rubi [A]
time = 0.01, antiderivative size = 17, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 2, integrand size = 14, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.143, Rules used = {2320, 46} \begin {gather*} x+\frac {1}{e^x+1}-\log \left (e^x+1\right ) \end {gather*}

Antiderivative was successfully verified.

[In]

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

[Out]

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

Rule 46

Int[((a_) + (b_.)*(x_))^(m_)*((c_.) + (d_.)*(x_))^(n_.), x_Symbol] :> Int[ExpandIntegrand[(a + b*x)^m*(c + d*x
)^n, x], x] /; FreeQ[{a, b, c, d}, x] && NeQ[b*c - a*d, 0] && ILtQ[m, 0] && IntegerQ[n] &&  !(IGtQ[n, 0] && Lt
Q[m + n + 2, 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*} \int \frac {1}{1+2 e^x+e^{2 x}} \, dx &=\text {Subst}\left (\int \frac {1}{x (1+x)^2} \, dx,x,e^x\right )\\ &=\text {Subst}\left (\int \left (\frac {1}{-1-x}+\frac {1}{x}-\frac {1}{(1+x)^2}\right ) \, dx,x,e^x\right )\\ &=\frac {1}{1+e^x}+x-\log \left (1+e^x\right )\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]
time = 0.02, size = 18, normalized size = 1.06 \begin {gather*} \frac {1}{1+e^x}-2 \tanh ^{-1}\left (1+2 e^x\right ) \end {gather*}

Antiderivative was successfully verified.

[In]

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

[Out]

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

________________________________________________________________________________________

Maple [A]
time = 0.02, size = 18, normalized size = 1.06

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

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

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

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

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

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

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

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

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

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

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

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________