# Finding $\int \frac {e^x}{e^x+2}dx$

Find $\int \frac {e^x}{e^x+2}dx$

From simple division I got: $\frac {e^x}{e^x+2}=1 - \frac 2 {e^x+2}$ so we're left with finding $-\int \frac 2 {e^x+2}dx=-2\int \frac 1 {1+2/e^x}\cdot \frac 1 {e^x}dx$ $\star$

Take $u=\frac 2{e^x}+1$ then $du=-\frac 2{e^x} dx$ so $-\frac {du}2=\frac 1 {e^x}dx$

Back to $\star$: $(-2)(-\frac 1 2)\int \frac 1 u du=\ln(u)+c=\ln (\frac 2{e^x}+1)+c$ but the answer to this part of the integration should include $-x$.

What did I do wrong? and is there a better way?

• HINT: $$\frac{d}{dx} (e^{x} + 2) = e^{x}$$ – mattos Apr 9 '15 at 14:59
• Also, from your solution (which is wrong) $$\ln \bigg( \frac{2}{e^{x}} + 1 \bigg) = \ln \bigg( \frac{2 + e^{x}}{e^{x}} \bigg) = \ln ( 2 + e^{x} ) - \ln (e^{x}) = \ln ( 2 + e^{x} ) - x$$ – mattos Apr 9 '15 at 15:02
• You forgot the $\int 1$ because $$\int 1-\frac{2}{e^x+2}=\int 1 - 2\int\frac{1}{e^x+2}$$ – kingW3 Apr 9 '15 at 15:05
• @kingW3 no I remembered it, I didn't get the $-x$ for the calculation of the right term. – shinzou Apr 9 '15 at 15:06
• @Mattos oh so I didn't simplify it enough to see the $-x$... well, thanks for pointing that out. So all that was left in my calculation is to add the $x$ from the beginning. – shinzou Apr 9 '15 at 15:08

$$\int\frac{e^x}{e^x+2}dx=\int\frac{(e^x+2)'}{e^x+2}dx=\log(e^x+2)+C$$
and I'm not sure what $\;-x\;$ you say "must" the solution contain.
• lol so simple I didn't see that... I was calculating: $-\int \frac 2 {e^x+2}dx$ which should include the $-x$ as seen in the link. – shinzou Apr 9 '15 at 15:01
• and the other term, therefore, must contain $+x$. – GEdgar Apr 9 '15 at 15:02
with $e^x=t$ we get $e^xdx=dt$ and our integral is $$\int\frac{dt}{t+2}=\ln(t+2)+C$$