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

   Optimal result
   Rubi [A] (verified)
   Mathematica [B] (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 = 27, antiderivative size = 18 \[ \int \frac {e^{-2 x}+e^{2 x}}{-e^{-2 x}+e^{2 x}} \, dx=-x+\frac {1}{2} \log \left (1-e^{4 x}\right ) \]

[Out]

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

Rubi [A] (verified)

Time = 0.03 (sec) , antiderivative size = 18, 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.111, Rules used = {2320, 457, 78} \[ \int \frac {e^{-2 x}+e^{2 x}}{-e^{-2 x}+e^{2 x}} \, dx=\frac {1}{2} \log \left (1-e^{4 x}\right )-x \]

[In]

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

[Out]

-x + Log[1 - E^(4*x)]/2

Rule 78

Int[((a_.) + (b_.)*(x_))*((c_) + (d_.)*(x_))^(n_.)*((e_.) + (f_.)*(x_))^(p_.), x_Symbol] :> Int[ExpandIntegran
d[(a + b*x)*(c + d*x)^n*(e + f*x)^p, x], x] /; FreeQ[{a, b, c, d, e, f, n}, x] && NeQ[b*c - a*d, 0] && ((ILtQ[
n, 0] && ILtQ[p, 0]) || EqQ[p, 1] || (IGtQ[p, 0] && ( !IntegerQ[n] || LeQ[9*p + 5*(n + 2), 0] || GeQ[n + p + 1
, 0] || (GeQ[n + p + 2, 0] && RationalQ[a, b, c, d, e, f]))))

Rule 457

Int[(x_)^(m_.)*((a_) + (b_.)*(x_)^(n_))^(p_.)*((c_) + (d_.)*(x_)^(n_))^(q_.), x_Symbol] :> Dist[1/n, Subst[Int
[x^(Simplify[(m + 1)/n] - 1)*(a + b*x)^p*(c + d*x)^q, x], x, x^n], x] /; FreeQ[{a, b, c, d, m, n, p, q}, x] &&
 NeQ[b*c - a*d, 0] && IntegerQ[Simplify[(m + 1)/n]]

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

Mathematica [B] (verified)

Leaf count is larger than twice the leaf count of optimal. \(39\) vs. \(2(18)=36\).

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

[In]

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

[Out]

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

Maple [A] (verified)

Time = 0.05 (sec) , antiderivative size = 12, normalized size of antiderivative = 0.67

method result size
risch \(x +\frac {\ln \left ({\mathrm e}^{-4 x}-1\right )}{2}\) \(12\)
norman \(x +\frac {\ln \left (-1+{\mathrm e}^{-2 x}\right )}{2}+\frac {\ln \left ({\mathrm e}^{-2 x}+1\right )}{2}\) \(21\)
default \(\frac {\ln \left (1+{\mathrm e}^{2 x}\right )}{2}-\ln \left ({\mathrm e}^{x}\right )+\frac {\ln \left (1+{\mathrm e}^{x}\right )}{2}+\frac {\ln \left (-1+{\mathrm e}^{x}\right )}{2}\) \(30\)
parts \(\frac {\ln \left (1+{\mathrm e}^{2 x}\right )}{2}-\ln \left ({\mathrm e}^{x}\right )+\frac {\ln \left (1+{\mathrm e}^{x}\right )}{4}+\frac {\ln \left (-1+{\mathrm e}^{x}\right )}{4}+\frac {\ln \left (-1+{\mathrm e}^{2 x}\right )}{4}\) \(48\)

[In]

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

[Out]

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

Fricas [A] (verification not implemented)

none

Time = 0.31 (sec) , antiderivative size = 13, normalized size of antiderivative = 0.72 \[ \int \frac {e^{-2 x}+e^{2 x}}{-e^{-2 x}+e^{2 x}} \, dx=-x + \frac {1}{2} \, \log \left (e^{\left (4 \, x\right )} - 1\right ) \]

[In]

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

[Out]

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

Sympy [A] (verification not implemented)

Time = 0.04 (sec) , antiderivative size = 10, normalized size of antiderivative = 0.56 \[ \int \frac {e^{-2 x}+e^{2 x}}{-e^{-2 x}+e^{2 x}} \, dx=- x + \frac {\log {\left (e^{4 x} - 1 \right )}}{2} \]

[In]

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

[Out]

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

Maxima [A] (verification not implemented)

none

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

[In]

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

[Out]

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

Giac [A] (verification not implemented)

none

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

[In]

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

[Out]

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

Mupad [B] (verification not implemented)

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

[In]

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

[Out]

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