3.7.39 \(\int (-e^{-x}+e^x) \log (1+e^{2 x}) \, dx\) [639]

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

[Out]

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

________________________________________________________________________________________

Rubi [A]
time = 0.03, antiderivative size = 32, normalized size of antiderivative = 1.00, number of steps used = 8, number of rules used = 6, integrand size = 20, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.300, Rules used = {2320, 2526, 2498, 327, 209, 2505} \begin {gather*} -2 e^x+e^{-x} \log \left (e^{2 x}+1\right )+e^x \log \left (e^{2 x}+1\right ) \end {gather*}

Antiderivative was successfully verified.

[In]

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

[Out]

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

Rule 209

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

Rule 327

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

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

Rule 2498

Int[Log[(c_.)*((d_) + (e_.)*(x_)^(n_))^(p_.)], x_Symbol] :> Simp[x*Log[c*(d + e*x^n)^p], x] - Dist[e*n*p, Int[
x^n/(d + e*x^n), x], x] /; FreeQ[{c, d, e, n, p}, x]

Rule 2505

Int[((a_.) + Log[(c_.)*((d_) + (e_.)*(x_)^(n_))^(p_.)]*(b_.))*((f_.)*(x_))^(m_.), x_Symbol] :> Simp[(f*x)^(m +
 1)*((a + b*Log[c*(d + e*x^n)^p])/(f*(m + 1))), x] - Dist[b*e*n*(p/(f*(m + 1))), Int[x^(n - 1)*((f*x)^(m + 1)/
(d + e*x^n)), x], x] /; FreeQ[{a, b, c, d, e, f, m, n, p}, x] && NeQ[m, -1]

Rule 2526

Int[((a_.) + Log[(c_.)*((d_) + (e_.)*(x_)^(n_))^(p_.)]*(b_.))^(q_.)*(x_)^(m_.)*((f_) + (g_.)*(x_)^(s_))^(r_.),
 x_Symbol] :> Int[ExpandIntegrand[(a + b*Log[c*(d + e*x^n)^p])^q, x^m*(f + g*x^s)^r, x], x] /; FreeQ[{a, b, c,
 d, e, f, g, m, n, p, q, r, s}, x] && IGtQ[q, 0] && IntegerQ[m] && IntegerQ[r] && IntegerQ[s]

Rubi steps

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

________________________________________________________________________________________

Mathematica [A]
time = 0.02, size = 24, normalized size = 0.75 \begin {gather*} -2 e^x+\left (e^{-x}+e^x\right ) \log \left (1+e^{2 x}\right ) \end {gather*}

Antiderivative was successfully verified.

[In]

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

[Out]

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

________________________________________________________________________________________

Maple [A]
time = 0.02, size = 24, normalized size = 0.75

method result size
risch \(\left (1+{\mathrm e}^{2 x}\right ) {\mathrm e}^{-x} \ln \left (1+{\mathrm e}^{2 x}\right )-2 \,{\mathrm e}^{x}\) \(24\)
norman \(\left ({\mathrm e}^{2 x} \ln \left (1+{\mathrm e}^{2 x}\right )-2 \,{\mathrm e}^{2 x}+\ln \left (1+{\mathrm e}^{2 x}\right )\right ) {\mathrm e}^{-x}\) \(32\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Maxima [A]
time = 2.45, size = 20, normalized size = 0.62 \begin {gather*} {\left (e^{\left (-x\right )} + e^{x}\right )} \log \left (e^{\left (2 \, x\right )} + 1\right ) - 2 \, e^{x} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Fricas [A]
time = 0.50, size = 26, normalized size = 0.81 \begin {gather*} {\left ({\left (e^{\left (2 \, x\right )} + 1\right )} \log \left (e^{\left (2 \, x\right )} + 1\right ) - 2 \, e^{\left (2 \, x\right )}\right )} e^{\left (-x\right )} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Sympy [F(-1)] Timed out
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Timed out} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

Timed out

________________________________________________________________________________________

Giac [A]
time = 1.98, size = 20, normalized size = 0.62 \begin {gather*} {\left (e^{\left (-x\right )} + e^{x}\right )} \log \left (e^{\left (2 \, x\right )} + 1\right ) - 2 \, e^{x} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Mupad [B]
time = 0.38, size = 24, normalized size = 0.75 \begin {gather*} 2\,\ln \left ({\mathrm {e}}^{2\,x}+1\right )\,\mathrm {cosh}\left (x\right )-\frac {{\mathrm {e}}^{2\,x}+1}{\mathrm {cosh}\left (x\right )} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________