We have,
dydx=ex−y(ey−x−ey)
dydx=exe−yey(e−x−1)
dydx=ex(e−x−1)
dydx=1−ex
dy=(1−ex)dx
On integrating both sides, we get
∫dy=∫(1−ex)dx
y=x−ex+C
Hence, this is the answer.