Answer
Answer in an implicit form :
$ y = e^y -2x -sinx + C $
Work Step by Step
$(e^y -1)y' = 2 + cos x $ can be rewritten as:
$(e^y -1) dy/dx = 2 + cos x $
Let's separate y on one side and x on the other side:
$(e^y -1) dy= (2 + cos x) dx $
Now let's integrate both parts:
$\int(e^y -1) dy= \int (2 + cos x) dx $
$e^y - y + C= 2x + sin x$
$ y = e^y -2x -sinx + C $
(Answer is in implicit form.)