$xy^2 \, dx + e^x \, dy = 0$
$\dfrac{xy^2 \, dx}{y^2 e^x} + \dfrac{e^x \, dy}{y^2 e^x} = 0$
$\dfrac{x \, dx}{e^x} + \dfrac{dy}{y^2} = 0$
$\displaystyle \int xe^{-x} \, dx + \int y^{-2} \, dy = 0$
For $\displaystyle \int xe^{-x} \, dx$
Let
$u = x$, $du = dx$
$dv = \int e^{-x} \, dx$, $v = -e^{-x}$
$\displaystyle \int xe^{-x} \, dx = -xe^{-x} + \int e^{-x} \, dx$
$\displaystyle \int xe^{-x} \, dx = -xe^{-x} - e^{-x}$
Then,
$(-xe^{-x} - e^{-x}) - y^{-1} = -c$
$xe^{-x} + e^{-x} + y^{-1} = c$
$\dfrac{x}{e^x} + \dfrac{1}{e^x} + \dfrac{1}{y} = c$
when x → ∞, y → ½
$\dfrac{\infty}{e^\infty} + \dfrac{1}{e^\infty} + \dfrac{1}{\frac{1}{2}} = c$
$0 + 0 + 2 = c$
$c = 2$
Thus,
$\dfrac{x}{e^x} + \dfrac{1}{e^x} + \dfrac{1}{y} = 2$
$xy + y + e^x = 2ye^x$
$e^x = 2ye^x - xy - y$
$e^x = y(2e^x - x - 1)$
$y = \dfrac{e^x}{2e^x - x - 1}$ answer