If you ask how to turn the inexact equation into exact equation, then there are three cases:
Try 1: check $\frac{\frac{\partial M}{\partial y} - \frac{\partial N}{\partial x}}{N} =$ $f(x)$ function of $x$ only,
then let $\frac{u^{'}}{u} = f(x)$
$\frac{du}{u} = f(x)dx$
$u = e^{\int f(x)dx}$
Try 2: check $\frac{\frac{\partial N}{\partial x}-\frac{\partial M}{\partial y}}{M} = g(y)$ function of $y$ only, and then same as the first one you let $\frac{u^{'}}{u} = g(y)$,
$u = e^{\int g(y)dy}$
Try 3: if $\frac{\frac{\partial N}{\partial x} - \frac{\partial M}{\partial y}}{Mx-Ny} = z(x, y)$, then
$u = u(x, y)$ and $u = e^{\int z(x,y)}$
In each of these cases, $u$ is the integrating factor, when you solve $u$ and you multiply the equation both sides with $u$ then you will turn the inexact equation into an exact equation.