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

Optimal. Leaf size=12 $e^{-x}-\tanh ^{-1}\left (e^x\right )$

[Out]

E^(-x) - ArcTanh[E^x]

________________________________________________________________________________________

Rubi [A]  time = 0.0118939, antiderivative size = 12, normalized size of antiderivative = 1., number of steps used = 3, number of rules used = 3, integrand size = 13, $$\frac{\text{number of rules}}{\text{integrand size}}$$ = 0.231, Rules used = {2282, 325, 207} $e^{-x}-\tanh ^{-1}\left (e^x\right )$

Antiderivative was successfully veriﬁed.

[In]

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

[Out]

E^(-x) - ArcTanh[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 325

Int[((c_.)*(x_))^(m_)*((a_) + (b_.)*(x_)^(n_))^(p_), x_Symbol] :> Simp[((c*x)^(m + 1)*(a + b*x^n)^(p + 1))/(a*
c*(m + 1)), x] - Dist[(b*(m + n*(p + 1) + 1))/(a*c^n*(m + 1)), Int[(c*x)^(m + n)*(a + b*x^n)^p, x], x] /; Free
Q[{a, b, c, p}, x] && IGtQ[n, 0] && LtQ[m, -1] && IntBinomialQ[a, b, c, n, m, p, x]

Rule 207

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> -Simp[ArcTanh[(Rt[b, 2]*x)/Rt[-a, 2]]/(Rt[-a, 2]*Rt[b, 2]), x] /;
FreeQ[{a, b}, x] && NegQ[a/b] && (LtQ[a, 0] || GtQ[b, 0])

Rubi steps

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

Mathematica [C]  time = 0.0053248, size = 19, normalized size = 1.58 $e^{-x} \text{Hypergeometric2F1}\left (-\frac{1}{2},1,\frac{1}{2},e^{2 x}\right )$

Antiderivative was successfully veriﬁed.

[In]

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

[Out]

Hypergeometric2F1[-1/2, 1, 1/2, E^(2*x)]/E^x

________________________________________________________________________________________

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

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

[In]

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

[Out]

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

________________________________________________________________________________________

Maxima [A]  time = 0.935188, size = 26, normalized size = 2.17 \begin{align*} e^{\left (-x\right )} - \frac{1}{2} \, \log \left (e^{x} + 1\right ) + \frac{1}{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)+exp(3*x)),x, algorithm="maxima")

[Out]

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

________________________________________________________________________________________

Fricas [B]  time = 1.98467, size = 74, normalized size = 6.17 \begin{align*} -\frac{1}{2} \,{\left (e^{x} \log \left (e^{x} + 1\right ) - e^{x} \log \left (e^{x} - 1\right ) - 2\right )} e^{\left (-x\right )} \end{align*}

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

[In]

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

[Out]

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

________________________________________________________________________________________

Sympy [B]  time = 0.109092, size = 20, normalized size = 1.67 \begin{align*} \frac{\log{\left (e^{x} - 1 \right )}}{2} - \frac{\log{\left (e^{x} + 1 \right )}}{2} + e^{- x} \end{align*}

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

[In]

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

[Out]

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

________________________________________________________________________________________

Giac [A]  time = 1.05866, size = 27, normalized size = 2.25 \begin{align*} e^{\left (-x\right )} - \frac{1}{2} \, \log \left (e^{x} + 1\right ) + \frac{1}{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)+exp(3*x)),x, algorithm="giac")

[Out]

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