### 3.303 $$\int \frac{1+e^x}{1-e^x} \, dx$$

Optimal. Leaf size=12 $x-2 \log \left (1-e^x\right )$

[Out]

x - 2*Log[1 - E^x]

________________________________________________________________________________________

Rubi [A]  time = 0.0210943, antiderivative size = 12, 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 = {2282, 72} $x-2 \log \left (1-e^x\right )$

Antiderivative was successfully veriﬁed.

[In]

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

[Out]

x - 2*Log[1 - E^x]

Rule 2282

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

Rule 72

Int[((e_.) + (f_.)*(x_))^(p_.)/(((a_.) + (b_.)*(x_))*((c_.) + (d_.)*(x_))), x_Symbol] :> Int[ExpandIntegrand[(
e + f*x)^p/((a + b*x)*(c + d*x)), x], x] /; FreeQ[{a, b, c, d, e, f}, x] && IntegerQ[p]

Rubi steps

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

Mathematica [A]  time = 0.0084745, size = 12, normalized size = 1. $x-2 \log \left (1-e^x\right )$

Antiderivative was successfully veriﬁed.

[In]

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

[Out]

x - 2*Log[1 - E^x]

________________________________________________________________________________________

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

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

[In]

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

[Out]

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

________________________________________________________________________________________

Maxima [A]  time = 0.942234, size = 12, normalized size = 1. \begin{align*} x - 2 \, \log \left (e^{x} - 1\right ) \end{align*}

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

[In]

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

[Out]

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

________________________________________________________________________________________

Fricas [A]  time = 1.91797, size = 27, normalized size = 2.25 \begin{align*} x - 2 \, \log \left (e^{x} - 1\right ) \end{align*}

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

[In]

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

[Out]

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

________________________________________________________________________________________

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

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

[In]

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

[Out]

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

________________________________________________________________________________________

Giac [A]  time = 1.05154, size = 14, normalized size = 1.17 \begin{align*} x - 2 \, \log \left ({\left | e^{x} - 1 \right |}\right ) \end{align*}

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

[In]

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

[Out]

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