3.358 $$\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]

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

________________________________________________________________________________________

Rubi [A]  time = 0.0259144, antiderivative size = 21, normalized size of antiderivative = 1., 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 veriﬁed.

[In]

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

[Out]

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

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]

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

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.0156914, size = 21, normalized size = 1. $-2 x-e^{-x}+2 \log \left (2 e^x+1\right )$

Antiderivative was successfully veriﬁed.

[In]

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

[Out]

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

________________________________________________________________________________________

Maple [A]  time = 0.007, size = 22, normalized size = 1.1 \begin{align*} - \left ({{\rm e}^{x}} \right ) ^{-1}-2\,\ln \left ({{\rm e}^{x}} \right ) +2\,\ln \left ( 1+2\,{{\rm e}^{x}} \right ) \end{align*}

Veriﬁcation of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Maxima [A]  time = 0.925633, size = 22, normalized size = 1.05 \begin{align*} -e^{\left (-x\right )} + 2 \, \log \left (e^{\left (-x\right )} + 2\right ) \end{align*}

Veriﬁcation 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)

________________________________________________________________________________________

Fricas [A]  time = 2.02538, size = 62, normalized size = 2.95 \begin{align*} -{\left (2 \, x e^{x} - 2 \, e^{x} \log \left (2 \, e^{x} + 1\right ) + 1\right )} e^{\left (-x\right )} \end{align*}

Veriﬁcation 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)

________________________________________________________________________________________

Sympy [A]  time = 0.089545, size = 14, normalized size = 0.67 \begin{align*} 2 \log{\left (2 + e^{- x} \right )} - e^{- x} \end{align*}

Veriﬁcation of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Giac [A]  time = 1.052, size = 26, normalized size = 1.24 \begin{align*} -2 \, x - e^{\left (-x\right )} + 2 \, \log \left (2 \, e^{x} + 1\right ) \end{align*}

Veriﬁcation 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)