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.
- Substitute $u=1+e^x$ and express $dx$ in terms of $du$.
- Decompose the resulting rational function using partial fractions.
- Integrate each term.
- 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
- The integrand is defined for all real $x$, since $1+e^x>0$ always.
- An equivalent shortcut is to write $\dfrac{1}{1+e^x} = 1-\dfrac{e^x}{1+e^x}$ and integrate directly, giving $x-\ln(1+e^x)+C$ immediately — the same result reached here via partial fractions.
- The result can be checked by differentiating $x-\ln(1+e^x)$ and confirming it returns $\dfrac{1}{1+e^x}$.
Result
The solution to the integral is: