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

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

[Out]

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

________________________________________________________________________________________

Rubi [A]  time = 0.03, antiderivative size = 21, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 2, integrand size = 15, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.133, Rules used = {2248, 44} \[ -2 x-e^{-x}+2 \log \left (2 e^x+1\right ) \]

Antiderivative was successfully verified.

[In]

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

[Out]

-E^(-x) - 2*x + 2*Log[1 + 2*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 2248

Int[((a_) + (b_.)*(F_)^((e_.)*((c_.) + (d_.)*(x_))))^(p_.)*(G_)^((h_.)*((f_.) + (g_.)*(x_))), x_Symbol] :> Wit
h[{m = FullSimplify[(g*h*Log[G])/(d*e*Log[F])]}, Dist[(Denominator[m]*G^(f*h - (c*g*h)/d))/(d*e*Log[F]), Subst
[Int[x^(Numerator[m] - 1)*(a + b*x^Denominator[m])^p, x], x, F^((e*(c + d*x))/Denominator[m])], x] /; LeQ[m, -
1] || GeQ[m, 1]] /; FreeQ[{F, G, a, b, c, d, e, f, g, h, p}, x]

Rubi steps

\begin {align*} \int \frac {e^{-x}}{1+2 e^x} \, dx &=\operatorname {Subst}\left (\int \frac {1}{x^2 (1+2 x)} \, dx,x,e^x\right )\\ &=\operatorname {Subst}\left (\int \left (\frac {1}{x^2}-\frac {2}{x}+\frac {4}{1+2 x}\right ) \, dx,x,e^x\right )\\ &=-e^{-x}-2 x+2 \log \left (1+2 e^x\right )\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]  time = 0.02, size = 21, normalized size = 1.00 \[ -2 x-e^{-x}+2 \log \left (2 e^x+1\right ) \]

Antiderivative was successfully verified.

[In]

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

[Out]

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

________________________________________________________________________________________

fricas [A]  time = 0.41, size = 24, normalized size = 1.14 \[ -{\left (2 \, x e^{x} - 2 \, e^{x} \log \left (2 \, e^{x} + 1\right ) + 1\right )} e^{\left (-x\right )} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

giac [A]  time = 0.21, size = 19, normalized size = 0.90 \[ -2 \, x - e^{\left (-x\right )} + 2 \, \log \left (2 \, e^{x} + 1\right ) \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

maple [A]  time = 0.03, size = 22, normalized size = 1.05 \[ -{\mathrm e}^{-x}+2 \ln \left (2 \,{\mathrm e}^{x}+1\right )-2 \ln \left ({\mathrm e}^{x}\right ) \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

maxima [A]  time = 0.98, size = 16, normalized size = 0.76 \[ -e^{\left (-x\right )} + 2 \, \log \left (e^{\left (-x\right )} + 2\right ) \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

mupad [B]  time = 0.07, size = 19, normalized size = 0.90 \[ 2\,\ln \left (2\,{\mathrm {e}}^x+1\right )-2\,x-{\mathrm {e}}^{-x} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

2*log(2*exp(x) + 1) - 2*x - exp(-x)

________________________________________________________________________________________

sympy [A]  time = 0.10, size = 17, normalized size = 0.81 \[ - 2 x + 2 \log {\left (e^{x} + \frac {1}{2} \right )} - e^{- x} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________