How do I evaluate this integral by substitution?

How do I evaluate $$\int \frac{e^{-2x}}{1+e^{-x}} dx$$

I've tried the substitution u = $e^{-x}$, and the furthest I've gotten is $\int \frac{-u}{1+u} du$ and I don't know how to proceed from there.

• It's actually easier to substitute $u = 1 + e^{-x}$ Nov 23, 2014 at 19:28

You've already done the hard part. Notice now that $$\int \frac{u}{1 + u} du = \int \left(1 - \frac{1}{1 + u}\right) du$$
$$\cdots = u - \log |u + 1| + C.$$
• You're correct that, since $\log|x|$ is not connected, the general antiderivative of $\frac{1}{x}$ is the set of functions given by $\log|x| + C$ on $(-\infty, 0)$ and $\log|x| + D$ on $(0, \infty)$ for some constants $C, D$. But, nearly every calculus reference will suppress this complication, because in settings where the constant of integration is essential, one is already typically only working on one connected component of the domain, and good references justify this by declaring that expressions $+ C$ refer to working with one such component at a time, which is the sense I had in mind. Nov 16, 2014 at 16:23
$$\int\frac{-u}{1+u}du=\int\frac{-u\color{red}{-1+1}}{1+u}du=-\int du+\int\frac{du}{1+u}=-u+\ln|1+u|+C$$