3.639 \(\int (-e^{-x}+e^x) \log (1+e^{2 x}) \, dx\)

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

________________________________________________________________________________________

Rubi [A]  time = 0.05, 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 = {2282, 2476, 2448, 321, 203, 2455} \[ -2 e^x+e^{-x} \log \left (e^{2 x}+1\right )+e^x \log \left (e^{2 x}+1\right ) \]

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 203

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

Rule 321

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

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 2455

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 2476

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 &=\operatorname {Subst}\left (\int \frac {\left (-1+x^2\right ) \log \left (1+x^2\right )}{x^2} \, dx,x,e^x\right )\\ &=\operatorname {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 )\\ &=\operatorname {Subst}\left (\int \log \left (1+x^2\right ) \, dx,x,e^x\right )-\operatorname {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 \operatorname {Subst}\left (\int \frac {1}{1+x^2} \, dx,x,e^x\right )-2 \operatorname {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 \operatorname {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.04, size = 24, normalized size = 0.75 \[ \left (e^{-x}+e^x\right ) \log \left (e^{2 x}+1\right )-2 e^x \]

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

________________________________________________________________________________________

IntegrateAlgebraic [F]  time = 0.00, size = 0, normalized size = 0.00 \[ \int \left (-e^{-x}+e^x\right ) \log \left (1+e^{2 x}\right ) \, dx \]

Verification is Not applicable to the result.

[In]

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

[Out]

Could not integrate

________________________________________________________________________________________

fricas [A]  time = 1.21, size = 26, normalized size = 0.81 \[ {\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 )} \]

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)

________________________________________________________________________________________

giac [A]  time = 0.94, size = 20, normalized size = 0.62 \[ {\left (e^{\left (-x\right )} + e^{x}\right )} \log \left (e^{\left (2 \, x\right )} + 1\right ) - 2 \, e^{x} \]

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

________________________________________________________________________________________

maple [A]  time = 0.03, 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 = 0.44, size = 20, normalized size = 0.62 \[ {\left (e^{\left (-x\right )} + e^{x}\right )} \log \left (e^{\left (2 \, x\right )} + 1\right ) - 2 \, e^{x} \]

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

________________________________________________________________________________________

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

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)

________________________________________________________________________________________

sympy [F(-2)]  time = 0.00, size = 0, normalized size = 0.00 \[ \text {Exception raised: ShapeError} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

Exception raised: ShapeError

________________________________________________________________________________________