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

Optimal. Leaf size=17 \[ x+\frac {1}{e^x+1}-\log \left (e^x+1\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 = {2282, 44} \[ x+\frac {1}{e^x+1}-\log \left (e^x+1\right ) \]

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 44

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] && L
tQ[m + n + 2, 0])

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

Rubi steps

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

Antiderivative was successfully verified.

[In]

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

[Out]

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

________________________________________________________________________________________

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

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)

________________________________________________________________________________________

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

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)

________________________________________________________________________________________

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

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

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

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)

________________________________________________________________________________________

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

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)

________________________________________________________________________________________

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

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)

________________________________________________________________________________________