Exact Equations
Before we begin, a quick note on notation. Within this section, subscripts of x and y mean "partial derivative with respect to x" and "partial derivative with respect to y" respectively. So
$ M_y(x,y) $
means the partial derivative of M(x,y) with respect to y.
Suppose, firstly, that your differential equation can be written this way:
$ M(x,y)+N(x,y)y' = 0 $
and secondly, that
$ \frac{\partial M}{\partial y}=\frac{\partial N}{\partial x} $
In this case*, your differential equation is said to be exact, and the solution to the differential equation is ψ(x,y) where
$ \psi_x(x,y)=M(x,y);\qquad \psi_y(x,y)=N(x,y) $