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

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

[Out]

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

Rubi [A] (verified)

Time = 0.02 (sec) , antiderivative size = 12, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 2, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.154, Rules used = {2320, 78} \[ \int \frac {-1+e^x}{1+e^x} \, dx=2 \log \left (e^x+1\right )-x \]

[In]

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

[Out]

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

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

Mathematica [A] (verified)

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

[In]

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

[Out]

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

Maple [A] (verified)

Time = 0.03 (sec) , antiderivative size = 12, normalized size of antiderivative = 1.00

method result size
norman \(-x +2 \ln \left (1+{\mathrm e}^{x}\right )\) \(12\)
risch \(-x +2 \ln \left (1+{\mathrm e}^{x}\right )\) \(12\)
parallelrisch \(-x +2 \ln \left (1+{\mathrm e}^{x}\right )\) \(12\)
derivativedivides \(2 \ln \left (1+{\mathrm e}^{x}\right )-\ln \left ({\mathrm e}^{x}\right )\) \(14\)
default \(2 \ln \left (1+{\mathrm e}^{x}\right )-\ln \left ({\mathrm e}^{x}\right )\) \(14\)

[In]

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

[Out]

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

Fricas [A] (verification not implemented)

none

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

[In]

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

[Out]

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

Sympy [A] (verification not implemented)

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

[In]

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

[Out]

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

Maxima [A] (verification not implemented)

none

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

[In]

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

[Out]

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

Giac [A] (verification not implemented)

none

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

[In]

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

[Out]

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

Mupad [B] (verification not implemented)

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

[In]

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

[Out]

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