1. Let $\displaystyle u = 2+e^x~\implies~\frac{du}{dx} = e^x~\implies~\boxed{du=e^x \cdot dx}$
2. Re-write the integral:
$\displaystyle \int\left(\frac{e^x}{2+e^x}\right) dx = \int\left(\frac1{2+e^x}\right) e^x \cdot dx$
3. Now replace $\displaystyle 2+e^x$ by u and $\displaystyle e^x \cdot dx$ by du. Your integral becomes now:
$\displaystyle \int\left(\frac1u \right) du$
4. Afterwards re-substitute to get a function wrt x.