The given differential equation is \[x\,dy + \left(y - e^x\right) dx = 0\] Rearranging yields \[\left(y - e^x\right) dx + x\,dy = 0\] Let \(M = y - e^x\) and \(N = x\). The equation is of the form \( M\,dx + N\,dy = 0 \). We check for exactness: \[\frac{\partial M}{\partial y} = 1, \quad \frac{\partial N}{\partial x} = 1\] Since \(\frac{\partial M}{\partial y} = \frac{\partial N}{\partial x}\), the equation is exact. The potential function \(\Psi(x,y)\) satisfies: \[\frac{\partial \Psi}{\partial x} = M = y - e^x\] Integrating with respect to \(x\): \[\Psi = \int (y - e^x) dx = xy - e^x + h(y)\] Differentiating \(\Psi\) with respect to \(y\): \[\frac{\partial \Psi}{\partial y} = x + h'(y)\] Setting this equal to \(N = x\): \[x + h'(y) = x \implies h'(y) = 0 \implies h(y) = \text{constant}\] Thus, \(\Psi(x,y) = xy - e^x = C\). To match the format that includes the integral of \(x\,dy\), which is \(\frac{x^2}{2}\), the general solution is written as: \[\frac{x^2}{2} + xy - e^x = C\]