The given differential equation is \[x\,dy + \left(y - e^x\right) dx = 0\] This can be rewritten as \[\left(y - e^x\right) dx + x\,dy = 0\] Let \(M = y - e^x\) and \(N = x\). The equation is in the form \( M\,dx + N\,dy = 0 \).To check for exactness, calculate the partial derivatives:\[\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.Find the potential function \(\Psi(x,y)\) satisfying \[\frac{\partial \Psi}{\partial x} = M = y - e^x\] Integrating with respect to \(x\) yields:\[\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)\] Equating this to \(N = x\):\[x + h'(y) = x \implies h'(y) = 0 \implies h(y) = \text{constant}\]Therefore, the potential function is \[\Psi(x,y) = xy - e^x = C\]To match specific solution formats, consider the integral of \(x\,dy\), which introduces a \(\frac{x^2}{2}\) term. The general solution, thus, can be expressed as:\[\frac{x^2}{2} + xy - e^x = C\]