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

Optimal. Leaf size=56 \[ -x+\frac {1}{10} \left (5+\sqrt {5}\right ) \log \left (1-\sqrt {5}+2 e^x\right )+\frac {1}{10} \left (5-\sqrt {5}\right ) \log \left (1+\sqrt {5}+2 e^x\right ) \]

[Out]

-x+1/10*ln(1+2*exp(x)+5^(1/2))*(5-5^(1/2))+1/10*ln(1+2*exp(x)-5^(1/2))*(5+5^(1/2))

________________________________________________________________________________________

Rubi [A]
time = 0.02, antiderivative size = 56, normalized size of antiderivative = 1.00, number of steps used = 6, number of rules used = 5, integrand size = 12, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.417, Rules used = {2320, 719, 29, 646, 31} \begin {gather*} -x+\frac {1}{10} \left (5+\sqrt {5}\right ) \log \left (2 e^x+1-\sqrt {5}\right )+\frac {1}{10} \left (5-\sqrt {5}\right ) \log \left (2 e^x+1+\sqrt {5}\right ) \end {gather*}

Antiderivative was successfully verified.

[In]

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

[Out]

-x + ((5 + Sqrt[5])*Log[1 - Sqrt[5] + 2*E^x])/10 + ((5 - Sqrt[5])*Log[1 + Sqrt[5] + 2*E^x])/10

Rule 29

Int[(x_)^(-1), x_Symbol] :> Simp[Log[x], x]

Rule 31

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

Rule 646

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

Rule 719

Int[1/(((d_.) + (e_.)*(x_))*((a_.) + (b_.)*(x_) + (c_.)*(x_)^2)), x_Symbol] :> Dist[e^2/(c*d^2 - b*d*e + a*e^2
), Int[1/(d + e*x), x], x] + Dist[1/(c*d^2 - b*d*e + a*e^2), Int[(c*d - b*e - c*e*x)/(a + b*x + c*x^2), x], x]
 /; FreeQ[{a, b, c, d, e}, x] && NeQ[b^2 - 4*a*c, 0] && NeQ[c*d^2 - b*d*e + a*e^2, 0] && NeQ[2*c*d - b*e, 0]

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

________________________________________________________________________________________

Mathematica [A]
time = 0.07, size = 54, normalized size = 0.96 \begin {gather*} \frac {1}{10} \left (-10 \log \left (e^x\right )+\left (5+\sqrt {5}\right ) \log \left (-1+\sqrt {5}-2 e^x\right )-\left (-5+\sqrt {5}\right ) \log \left (1+\sqrt {5}+2 e^x\right )\right ) \end {gather*}

Antiderivative was successfully verified.

[In]

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

[Out]

(-10*Log[E^x] + (5 + Sqrt[5])*Log[-1 + Sqrt[5] - 2*E^x] - (-5 + Sqrt[5])*Log[1 + Sqrt[5] + 2*E^x])/10

________________________________________________________________________________________

Maple [A]
time = 0.02, size = 35, normalized size = 0.62

method result size
default \(\frac {\ln \left (-1+{\mathrm e}^{x}+{\mathrm e}^{2 x}\right )}{2}-\frac {\sqrt {5}\, \arctanh \left (\frac {\left (1+2 \,{\mathrm e}^{x}\right ) \sqrt {5}}{5}\right )}{5}-\ln \left ({\mathrm e}^{x}\right )\) \(35\)
risch \(-x +\frac {\ln \left ({\mathrm e}^{x}+\frac {1}{2}-\frac {\sqrt {5}}{2}\right )}{2}+\frac {\ln \left ({\mathrm e}^{x}+\frac {1}{2}-\frac {\sqrt {5}}{2}\right ) \sqrt {5}}{10}+\frac {\ln \left ({\mathrm e}^{x}+\frac {1}{2}+\frac {\sqrt {5}}{2}\right )}{2}-\frac {\ln \left ({\mathrm e}^{x}+\frac {1}{2}+\frac {\sqrt {5}}{2}\right ) \sqrt {5}}{10}\) \(59\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

1/2*ln(-1+exp(x)+exp(x)^2)-1/5*5^(1/2)*arctanh(1/5*(1+2*exp(x))*5^(1/2))-ln(exp(x))

________________________________________________________________________________________

Maxima [A]
time = 0.48, size = 43, normalized size = 0.77 \begin {gather*} \frac {1}{10} \, \sqrt {5} \log \left (-\frac {\sqrt {5} - 2 \, e^{x} - 1}{\sqrt {5} + 2 \, e^{x} + 1}\right ) - x + \frac {1}{2} \, \log \left (e^{\left (2 \, x\right )} + e^{x} - 1\right ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

1/10*sqrt(5)*log(-(sqrt(5) - 2*e^x - 1)/(sqrt(5) + 2*e^x + 1)) - x + 1/2*log(e^(2*x) + e^x - 1)

________________________________________________________________________________________

Fricas [A]
time = 0.36, size = 53, normalized size = 0.95 \begin {gather*} \frac {1}{10} \, \sqrt {5} \log \left (-\frac {2 \, {\left (\sqrt {5} - 1\right )} e^{x} + \sqrt {5} - 2 \, e^{\left (2 \, x\right )} - 3}{e^{\left (2 \, x\right )} + e^{x} - 1}\right ) - x + \frac {1}{2} \, \log \left (e^{\left (2 \, x\right )} + e^{x} - 1\right ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Sympy [A]
time = 0.04, size = 22, normalized size = 0.39 \begin {gather*} - x + \operatorname {RootSum} {\left (5 z^{2} - 5 z + 1, \left ( i \mapsto i \log {\left (- 5 i + e^{x} + 3 \right )} \right )\right )} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

-x + RootSum(5*_z**2 - 5*_z + 1, Lambda(_i, _i*log(-5*_i + exp(x) + 3)))

________________________________________________________________________________________

Giac [A]
time = 3.58, size = 46, normalized size = 0.82 \begin {gather*} \frac {1}{10} \, \sqrt {5} \log \left (\frac {{\left | -\sqrt {5} + 2 \, e^{x} + 1 \right |}}{\sqrt {5} + 2 \, e^{x} + 1}\right ) - x + \frac {1}{2} \, \log \left ({\left | e^{\left (2 \, x\right )} + e^{x} - 1 \right |}\right ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

1/10*sqrt(5)*log(abs(-sqrt(5) + 2*e^x + 1)/(sqrt(5) + 2*e^x + 1)) - x + 1/2*log(abs(e^(2*x) + e^x - 1))

________________________________________________________________________________________

Mupad [B]
time = 3.70, size = 32, normalized size = 0.57 \begin {gather*} \frac {\ln \left ({\mathrm {e}}^{2\,x}+{\mathrm {e}}^x-1\right )}{2}-x-\frac {\sqrt {5}\,\mathrm {atanh}\left (\frac {\sqrt {5}\,\left (2\,{\mathrm {e}}^x+1\right )}{5}\right )}{5} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

log(exp(2*x) + exp(x) - 1)/2 - x - (5^(1/2)*atanh((5^(1/2)*(2*exp(x) + 1))/5))/5

________________________________________________________________________________________