# How do I evaluate $\int \frac{\mathrm{d}x}{e^x + 1}$?

How do I solve evaluate $$\int \frac{\mathrm{d}x}{e^x + 1}\ ?$$

I know that I have to use $u$ substitution but I can't seem to find something to substitute with.

• What substitutions have you tried? – David H Apr 26 '14 at 14:45
• Mh, IMO you have at least three obvious substitutions. $u=e^x$, $u=e^x+1$ or $u=1/(e^x+1)$. Did you try any ? – Yves Daoust Jul 6 at 16:20

Setting $\displaystyle e^x=u,e^x\ dx=du\iff dx=\frac{du}{e^x}=\frac{du}u$$\int\frac{dx}{e^x+1}=\int\frac{du}{u(u+1)}$$ Now$\displaystyle\frac1{u(u+1)}=\frac{u+1-u}{u(u+1)}=\frac1u-\frac1{u+1}$HINT: $$\frac1{e^x+1}=\frac{e^{-x}}{1+e^{-x}}$$ OR $$\frac1{e^x+1}=1-\frac{e^x}{e^x+1}$$ • That may sound stupid, but how did you know that$\frac1{e^x+1}=\frac{e^{-x}}{1+e^{-x}}$? – Maik Klein Apr 26 '14 at 14:47 • Factor out$e^x$in the denominator. Recall$e^{-x}=\frac {1}{e^x}. – user2154420 Apr 26 '14 at 14:52 • @MaikKlein,The question is never stupid.I can say Observation as user2154420 has pointed out. I believe my other answer is more natural – lab bhattacharjee Apr 26 '14 at 14:57 It also equals $$1-\frac{e^x}{1+e^x}$$ Another possibility, if you like series solutions: \begin{align*} \int \frac{1}{e^x + 1}dx &= \int \sum_{n=0}^\infty (-1)^ne^{nx}dx \\ &=\sum_{n=0}^\infty (-1)^n\int e^{nx}{dx} \\ &= C + x + \sum_{n=1}^\infty (-1)^n \frac{1}{n}e^{nx} \\ &= C + x - \log(1 + e^x) \end{align*} So: $$\int\frac{1}{e^x+1}dx=\int\frac{e^{-x}}{1+e^{-x}}dx=-\int \frac{(1+e^{-x})'}{1+e^{-x}}dx=-\ln(1+e^{-x})+C=\ln(\frac{1}{1+e^{-x}})+C$$ Using the above hint that\frac{1}{\mathrm{e}^x+1}=1-\frac{\mathrm{e}^x}{\mathrm{e}^x+1}, we get \begin{align*} \int\frac{1}{\mathrm{e}^x+1}\,\mathrm{d}x&=\int 1-\frac{\mathrm{e}^x}{\mathrm{e}^x+1}\,\mathrm{d}x \\ &= x-\int\frac{\left(\mathrm{e}^x+1\right)'}{\mathrm{e}^x+1}\,\mathrm{d}x \\ &= x-\log\left(\mathrm{e}^x+1\right)+K \end{align*} Once again I'm late but better late than never. Let me think first what kind ofu$substitution should I use because I wanna give the OP different substitution. Aha! Let$u=e^x+1$then$e^x=u-1\;\Rightarrow\; x=\ln(u-1)\;\Rightarrow\; dx=\dfrac1{u-1}\ du, and the integral turns out to be \begin{align} \int\frac{1}{e^x+1}\ dx&=\int\frac1u\cdot\dfrac1{(u-1)}\ du\\ &=\int\left[\dfrac1{u-1}-\frac1u\right]\ du\\ &=\ln(u-1)-\ln u+C\tag1\\ &=\ln e^x-\ln (e^x+1)+C\\ &=x-\ln (e^x+1)+C\\ \end{align} or from(1)\$ we also obtain \begin{align} \int\frac{1}{e^x+1}\ dx &=\ln(u-1)-\ln u+C\\ &=\ln\left(\frac{u-1}{u}\right)+C\\ &=\ln\left(\frac{e^x}{e^x+1}\right)+C\\ &=\ln\left(\frac{1}{1+e^{-x}}\right)+C\\ &=-\ln \left(1+e^{-x}\right)+C. \end{align} Done! :)
If $$u=e^x$$ then $$du=e^x dx$$ and $$du= u dx$$: this in turn implies $$dx= du/u$$ so that the integrand gets $$\frac{1} {(u+1)u} = \frac{1}{u} - \frac{1}{u+1}$$ which integrates into $$\ln(u) - \ln(u+1)$$ which is $$\ln(e^x) - \ln(e^x+1)=x-\ln(e^x + 1)$$
In the interest of making things appear as simple as they are I am posting after a large number of others have posted. $$\int \frac{dx}{e^x+1} = \int \frac 1 {e^x(e^x+1)} \Big( e^x\,dx\Big) = \cdots$$ (And then partial fractions.)
$$\begin{eqnarray*} \int \frac{dx}{1+e^x} &=& \int \left( 1-\frac{e^x}{1+e^x} \right) dx \\ &=& \int \left( 1+\sum_{n=1}^{\infty} (-1)^n e^{nx} \right) dx \\ &=& x+\sum_{n=1}^{\infty} \frac{(-1)^n}{n} e^{nx} +C \\ &=& x- \ln(1+ e^x) +C. \end{eqnarray*}$$
{"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 1, "mathjax_display_tex": 1, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 8, "wp-katex-eq": 0, "align": 2, "equation": 0, "x-ck12": 0, "texerror": 0, "url": "https://math.stackexchange.com/questions/770114/how-do-i-evaluate-int-frac-mathrmdxex-1/3290232", "fetch_time": 1566174323000000000, "content_mime_type": "text/html", "warc_filename": "crawl-data/CC-MAIN-2019-35/segments/1566027314353.10/warc/CC-MAIN-20190818231019-20190819013019-00142.warc.gz", "warc_record_offset": 572758750, "warc_record_length": 35067, "token_count": 1511, "char_count": 3399, "score": 3.984375, "int_score": 4, "crawl": "CC-MAIN-2019-35", "snapshot_type": "latest", "language": "en", "language_score": 0.6236909031867981, "file_path": "/sailhome/yjruan/project/latent-lm/data/processed/finemath-4plus/finemath-4plus/train-00038-of-00064.parquet"}