I was given the integral $$\int \frac{2}{e^{-x}+1}dx$$ Here is my method to get the (correct) solution: $$\int \frac{2}{e^{-x}+1}dx$$ $$=2\int \frac{1}{e^{-x}+1}dx$$ $$=2\int \frac{e^xe^{-x}}{e^{-x}+e^xe^{-x}}dx$$ $$=2\int\frac{e^x}{1+e^x}dx$$ Let $u=e^x+1$ and $du=e^xdx$
So it becomes $$2\int\frac{1}{u}du$$ $$=2 \ln|u|+c$$ $$=2 \ln(e^x+1)+c$$ Is there an alternative way to do this? My first thought was, when I got to $$=2\int\frac{e^x}{1+e^x}dx$$ to write it as $$=2\int\frac{e^x+1-1}{1+e^x}dx$$ as one would do for $$=2\int\frac{x+1-1}{1+x}dx$$ but it becomes instead $$2\int1-\frac{1}{1+e^x}dx$$ where it doesn't seem $u$-substitution would work.