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

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

[Out]

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

________________________________________________________________________________________

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

Antiderivative was successfully verified.

[In]

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

[Out]

Log[1 - 2*E^x]/3 - Log[1 + E^x]/3

Rule 31

Int[((a_) + (b_.)*(x_))^(-1), x_Symbol] :> Simp[Log[RemoveContent[a + b*x, x]]/b, x] /; FreeQ[{a, b}, x]

Rule 630

Int[((a_.) + (b_.)*(x_) + (c_.)*(x_)^2)^(-1), x_Symbol] :> With[{q = Rt[b^2 - 4*a*c, 2]}, Dist[c/q, Int[1/Simp
[b/2 - q/2 + c*x, x], x], x] - Dist[c/q, Int[1/Simp[b/2 + q/2 + c*x, x], x], x]] /; FreeQ[{a, b, c}, x] && NeQ
[b^2 - 4*a*c, 0] && PosQ[b^2 - 4*a*c] && PerfectSquareQ[b^2 - 4*a*c]

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

________________________________________________________________________________________

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

Antiderivative was successfully verified.

[In]

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

[Out]

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

________________________________________________________________________________________

Maple [A]
time = 0.01, size = 18, normalized size = 0.78

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

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

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

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Fricas [A]
time = 0.41, size = 17, normalized size = 0.74 \begin {gather*} \frac {1}{3} \, \log \left (2 \, e^{x} - 1\right ) - \frac {1}{3} \, \log \left (e^{x} + 1\right ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Sympy [A]
time = 0.05, size = 17, normalized size = 0.74 \begin {gather*} \frac {\log {\left (e^{x} - \frac {1}{2} \right )}}{3} - \frac {\log {\left (e^{x} + 1 \right )}}{3} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Giac [A]
time = 3.94, size = 18, normalized size = 0.78 \begin {gather*} -\frac {1}{3} \, \log \left (e^{x} + 1\right ) + \frac {1}{3} \, \log \left ({\left | 2 \, e^{x} - 1 \right |}\right ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Mupad [B]
time = 0.12, size = 17, normalized size = 0.74 \begin {gather*} \frac {\ln \left (2\,{\mathrm {e}}^x-1\right )}{3}-\frac {\ln \left ({\mathrm {e}}^x+1\right )}{3} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________