1. ## Integrals of e.

I need to find the integral of (1/(1+e^x)) dx.

...I don't think I can use u substitution, but well, I'm basically open to suggestions.

2. $\displaystyle \displaystyle\int\frac{1}{e^x}dx=\int\frac{e^x}{e^ x(1+e^x)}dx$
Use the substitution $\displaystyle e^x=u$

3. Hello, niyati!

$\displaystyle I \;= \;\int\frac{dx}{1 + e^x}$

This is definitely my favorite integral.
There are at least seven ways to integrate it.
Here are a few of them . . .

$\displaystyle \text{(1) Long Division}$

. . $\displaystyle \frac{1}{1+e^x} \;=\;\frac{1+e^x-e^x}{1+e^x} \;=\;\frac{1+e^x}{1+e^x} - \frac{e^x}{1+e^x} \;=\;1 - \frac{e^x}{1+e^x}$

Then: .$\displaystyle I \;=\;\int\left(1 - \frac{e^x}{1+e^x}\right)dx \;=\;\boxed{x - \ln(1+e^x) + C}$

$\displaystyle \text{(2) }\;\frac{du}{u}$

Multiply top and bottom by $\displaystyle e^{-x}$

. . $\displaystyle \frac{e^{-x}}{e^{-x}}\cdot\frac{1}{1+e^x} \;=\;\frac{e^{-x}}{e^{-x} + 1} \;=\;-\frac{-e^{-x}}{e^{-x} + 1}$

Therefore: .$\displaystyle I \;=\;-\int\frac{-e^{-x}}{e^{-x} + 1}\,dx \;=\;\boxed{-\ln(e^{-x} + 1) + C}$

$\displaystyle (3)\;\text{Substitution}$

Let $\displaystyle U \,=\,1+e^x\quad\Rightarrow\quad x \,=\,\ln(U-1)\quad\Rightarrow\quad dx \:=\:\frac{dU}{U-1}$

Substitute: .$\displaystyle I \;=\;\int\frac{dU}{U(U-1)}$

Partial Fractions: .$\displaystyle \int\frac{dU}{U(U-1)} \;=\;\int\left(\frac{1}{U-1} - \frac{1}{U}\right)dU \;=\;\ln|U-1| - \ln|U| + C$

. . . $\displaystyle I \;= \;\ln\left|\frac{U-1}{U}\right| + C \;=\;\boxed{\ln\left(\frac{e^x}{1+e^x}\right) + C}$

$\displaystyle (4)\;\text{ Trig Substitution}$ . . . my favorite method

Let $\displaystyle e^x \,=\,\tan^2\theta\quad\Rightarrow\quad e^{\frac{x}{2}}\,=\,\tan\theta\quad\Rightarrow\qua d \frac{x}{2} \,=\,\ln(\tan\theta)\quad\Rightarrow\quad dx \,=\,2\cdot\frac{\sec^2\theta}{\tan\theta}\,d\thet a$
. . and: .$\displaystyle 1 + e^x \:=\:1+\tan^2\!\theta \:=\:\sec^2\!\theta$

Substitute: .$\displaystyle I \;=\;\int\frac{1}{\sec^2\!\theta}\cdot2\cdot\frac{ \sec^2\theta}{\tan\theta}d\theta \;=\;2\int\cot\theta\,d\theta \;=\;2\ln|\sin\theta| + C$

$\displaystyle \text{Since }\tan\theta = e^{\frac{x}{2}}\text{, then }\theta\text{ is in a right triangle with: }opp = e^{\frac{x}{2}} \text{ and }adj = 1$
. . Hence: .$\displaystyle hyp = \sqrt{1+e^x}$ .and .$\displaystyle \sin\theta \,=\,\frac{e^{\frac{x}{2}}}{\sqrt{1+e^x}}$

Therefore: .$\displaystyle I \;=\;\boxed{2\cdot\ln\left(\frac{e^{\frac{x}{2}}}{ \sqrt{1+e^x}}\right) + C}$

~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~

Of course, these four answers are equivalent.
. . You should verify this for yourself.

But now you are prepared to surprise/impress/terrify your teacher.

4. Thank you! (Both red_dog and soroban)

I hated how I kind of had to use partial fraction decomposition on the substitution method (the only way we learned it...-_-) but I'm just wondering how I am suppose to intuitively know to do that. :P Perhaps practice, and hopefully a very similar problem on my exam.

Again, thank you both for your help.

5. Originally Posted by niyati
Thank you! (Both red_dog and soroban)

I hated how I kind of had to use partial fraction decomposition on the substitution method (the only way we learned it...-_-) but I'm just wondering how I am suppose to intuitively know to do that. :P Perhaps practice, and hopefully a very similar problem on my exam.

Again, thank you both for your help.
Unfortunately there are a number of integrals out there that, paradoxically, you can only understand how to do once you've seen them done. (Unless you are some kind of integration genius anyway. ) We all have that problem and that's why things like this forum exist.

-Dan