Problem 119
Medium Exponential and Logarithmic

Evaluate the integral: I = integral dx/(1+e^x)

Evaluate the integral: $$ I = \int \frac{dx}{1+e^x}. $$

Explanation of Method

Substituting $u=1+e^x$ converts the exponential integrand into a rational function of $u$, which factors nicely because $u-1=e^x$ appears exactly in $du$. Partial fractions then finish the job.

  1. Substitute $u=1+e^x$ and express $dx$ in terms of $du$.
  2. Decompose the resulting rational function using partial fractions.
  3. Integrate each term.
  4. Substitute back and simplify.

Step 1 · Set up the substitution

Let:

$$ u = 1+e^x \quad \text{so that} \quad du = e^x\,dx = (u-1)\,dx \quad \Longrightarrow \quad dx = \frac{du}{u-1}. $$

Substituting into the integral:

$$ I = \int \frac{du}{u(u-1)}. $$

Step 2 · Partial fraction decomposition

Write:

$$ \frac{1}{u(u-1)} = \frac{A}{u} + \frac{B}{u-1}. $$

Multiplying both sides by $u(u-1)$: $1=A(u-1)+Bu$. Setting $u=0$ gives $A=-1$; setting $u=1$ gives $B=1$.

Step 3 · Integrate

Substituting the coefficients:

$$ I = \int \left(-\frac1u + \frac{1}{u-1}\right) du = -\ln|u| + \ln|u-1| + C. $$

Step 4 · Substitute back and simplify

Substituting back $u=1+e^x$, and noting $u-1=e^x$:

$$ I = -\ln|1+e^x| + \ln|e^x| + C = -\ln(1+e^x) + x + C, $$

since $\ln|e^x|=x$ and $1+e^x>0$ always.


Summary Table

Quantity Value
Substitution$u = 1+e^x$
Partial fractions$A=-1,\;B=1$
Antiderivative$-\ln|u|+\ln|u-1|$

Additional Notes

Result

The solution to the integral is:

$$ I = x - \ln(1+e^x) + C. $$