I need to find all solutions of:

$y^2 dx + (e^x - y)dy = 0$

So I take:

$M = y^2$

$N = e^x - y$

And I see that:

$\frac{M}{dy} = 2y$

$\frac{N}{dx} = e^x$

I'm therefore looking for an integrating factor:

$$ \displaystyle e^{\int \frac{1}{y^2}(e^x - 2y) dy} = e^{\int \frac{e^x - 2y}{y^2}dy} = e^{-2ln(y) - \frac{e^x}{y}}$$

And at this point I think it might be too complicated and I probably do something wrong.