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?
$$\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.