You can multiply the original equation by anything and equality will always hold. However, multiplying it by an appropriate integration factor (see Case 2) makes it exact, hence easier to solve. If you are wondering where these integration factors come from, consider
$$M(x,y)dx + N(x,y)dy = 0$$
and multiply by an integration factor $u(x,y)$ to make it exact.
Note that we must have
$$\frac{{\partial (uM)}}{{\partial y}} = \frac{{\partial (uN)}}{{\partial x}} \Leftrightarrow {u_y}M + u{M_y} = {u_x}N + u{N_x}$$
for exactness. If $u = u(x)$, then
$$\frac{{du}}{{dx}} = u\frac{1}{N}\left( {{M_y} - {N_x}} \right)$$
which you know how to solve if the righthand side is a function of $x$ only. Similarly, if $u = u(y)$, then
$$\frac{{du}}{{dy}} = u\frac{1}{M}\left( {{N_x} - {M_y}} \right).$$
Again, you know how to solve this if the righthand side is a function of $y$ only.