3.655 \(\int \frac{-e^{-x}+e^x}{e^{-x}+e^x} \, dx\)

Optimal. Leaf size=10 \[ \log \left (e^{-x}+e^x\right ) \]

[Out]

Log[E^(-x) + E^x]

________________________________________________________________________________________

Rubi [A]  time = 0.0372131, antiderivative size = 12, normalized size of antiderivative = 1.2, number of steps used = 4, number of rules used = 3, integrand size = 23, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.13, Rules used = {2282, 446, 72} \[ \log \left (e^{2 x}+1\right )-x \]

Antiderivative was successfully verified.

[In]

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

[Out]

-x + Log[1 + E^(2*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 446

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

Mathematica [A]  time = 0.0079775, size = 12, normalized size = 1.2 \[ \log \left (e^{2 x}+1\right )-x \]

Antiderivative was successfully verified.

[In]

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

[Out]

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

________________________________________________________________________________________

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

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Maxima [A]  time = 0.978719, size = 11, normalized size = 1.1 \begin{align*} \log \left (e^{\left (-x\right )} + e^{x}\right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

log(e^(-x) + e^x)

________________________________________________________________________________________

Fricas [A]  time = 0.799678, size = 31, normalized size = 3.1 \begin{align*} -x + \log \left (e^{\left (2 \, x\right )} + 1\right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

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

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Giac [A]  time = 1.33075, size = 15, normalized size = 1.5 \begin{align*} -x + \log \left (e^{\left (2 \, x\right )} + 1\right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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