3.651 \(\int \frac{e^x (-2+e^x)}{1+e^x} \, dx\)

Optimal. Leaf size=12 \[ e^x-3 \log \left (e^x+1\right ) \]

[Out]

E^x - 3*Log[1 + E^x]

________________________________________________________________________________________

Rubi [A]  time = 0.0351896, antiderivative size = 12, normalized size of antiderivative = 1., number of steps used = 3, number of rules used = 2, integrand size = 16, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.125, Rules used = {2282, 43} \[ e^x-3 \log \left (e^x+1\right ) \]

Antiderivative was successfully verified.

[In]

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

[Out]

E^x - 3*Log[1 + 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 43

Int[((a_.) + (b_.)*(x_))^(m_.)*((c_.) + (d_.)*(x_))^(n_.), x_Symbol] :> Int[ExpandIntegrand[(a + b*x)^m*(c + d
*x)^n, x], x] /; FreeQ[{a, b, c, d, n}, x] && NeQ[b*c - a*d, 0] && IGtQ[m, 0] && ( !IntegerQ[n] || (EqQ[c, 0]
&& LeQ[7*m + 4*n + 4, 0]) || LtQ[9*m + 5*(n + 1), 0] || GtQ[m + n + 2, 0])

Rubi steps

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

Mathematica [A]  time = 0.0103021, size = 12, normalized size = 1. \[ e^x-3 \log \left (e^x+1\right ) \]

Antiderivative was successfully verified.

[In]

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

[Out]

E^x - 3*Log[1 + E^x]

________________________________________________________________________________________

Maple [A]  time = 0.02, size = 11, normalized size = 0.9 \begin{align*}{{\rm e}^{x}}-3\,\ln \left ( 1+{{\rm e}^{x}} \right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Maxima [A]  time = 1.00554, size = 14, normalized size = 1.17 \begin{align*} e^{x} - 3 \, \log \left (e^{x} + 1\right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Fricas [A]  time = 0.770717, size = 30, normalized size = 2.5 \begin{align*} e^{x} - 3 \, \log \left (e^{x} + 1\right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Sympy [A]  time = 0.092809, size = 10, normalized size = 0.83 \begin{align*} e^{x} - 3 \log{\left (e^{x} + 1 \right )} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Giac [A]  time = 1.28569, size = 14, normalized size = 1.17 \begin{align*} e^{x} - 3 \, \log \left (e^{x} + 1\right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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