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

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [A] (verified)
   Fricas [A] (verification not implemented)
   Sympy [A] (verification not implemented)
   Maxima [A] (verification not implemented)
   Giac [A] (verification not implemented)
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 16, antiderivative size = 23 \[ \int \frac {1}{1-e^{-x}+2 e^x} \, dx=\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] (verified)

Time = 0.02 (sec) , antiderivative size = 23, normalized size of antiderivative = 1.00, number of steps used = 4, number of rules used = 3, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.188, Rules used = {2320, 630, 31} \[ \int \frac {1}{1-e^{-x}+2 e^x} \, dx=\frac {1}{3} \log \left (1-2 e^x\right )-\frac {1}{3} \log \left (e^x+1\right ) \]

[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*} \text {integral}& = \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] (verified)

Time = 0.05 (sec) , antiderivative size = 18, normalized size of antiderivative = 0.78 \[ \int \frac {1}{1-e^{-x}+2 e^x} \, dx=\frac {2}{3} \text {arctanh}\left (\frac {1}{3}-\frac {2 e^{-x}}{3}\right ) \]

[In]

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

[Out]

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

Maple [A] (verified)

Time = 0.04 (sec) , antiderivative size = 16, normalized size of antiderivative = 0.70

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\)
parallelrisch \(\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 (2 \,{\mathrm e}^{x}-1\right )}{3}-\frac {\ln \left (1+{\mathrm e}^{x}\right )}{3}\) \(18\)
default \(\frac {\ln \left (2 \,{\mathrm e}^{x}-1\right )}{3}-\frac {\ln \left (1+{\mathrm e}^{x}\right )}{3}\) \(18\)
norman \(\frac {\ln \left (2 \,{\mathrm e}^{x}-1\right )}{3}-\frac {\ln \left (1+{\mathrm e}^{x}\right )}{3}\) \(18\)

[In]

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

[Out]

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

Fricas [A] (verification not implemented)

none

Time = 0.24 (sec) , antiderivative size = 17, normalized size of antiderivative = 0.74 \[ \int \frac {1}{1-e^{-x}+2 e^x} \, dx=\frac {1}{3} \, \log \left (2 \, e^{x} - 1\right ) - \frac {1}{3} \, \log \left (e^{x} + 1\right ) \]

[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] (verification not implemented)

Time = 0.06 (sec) , antiderivative size = 19, normalized size of antiderivative = 0.83 \[ \int \frac {1}{1-e^{-x}+2 e^x} \, dx=\frac {\log {\left (-2 + e^{- x} \right )}}{3} - \frac {\log {\left (1 + e^{- x} \right )}}{3} \]

[In]

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

[Out]

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

Maxima [A] (verification not implemented)

none

Time = 0.20 (sec) , antiderivative size = 19, normalized size of antiderivative = 0.83 \[ \int \frac {1}{1-e^{-x}+2 e^x} \, dx=-\frac {1}{3} \, \log \left (e^{\left (-x\right )} + 1\right ) + \frac {1}{3} \, \log \left (e^{\left (-x\right )} - 2\right ) \]

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

Giac [A] (verification not implemented)

none

Time = 0.27 (sec) , antiderivative size = 18, normalized size of antiderivative = 0.78 \[ \int \frac {1}{1-e^{-x}+2 e^x} \, dx=-\frac {1}{3} \, \log \left (e^{x} + 1\right ) + \frac {1}{3} \, \log \left ({\left | 2 \, e^{x} - 1 \right |}\right ) \]

[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] (verification not implemented)

Time = 0.30 (sec) , antiderivative size = 17, normalized size of antiderivative = 0.74 \[ \int \frac {1}{1-e^{-x}+2 e^x} \, dx=\frac {\ln \left (2\,{\mathrm {e}}^x-1\right )}{3}-\frac {\ln \left ({\mathrm {e}}^x+1\right )}{3} \]

[In]

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

[Out]

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