Existence of Integrating Factor

Theorem
Let the first order ordinary differential equation:
 * $$(1) \qquad M \left({x, y}\right) + N \left({x, y}\right) \frac {dy} {dx} = 0$$

be such that $$M$$ and $$N$$ are real functions of two variables which are not homogeneous functions of the same degree.

Suppose also that:
 * $$\frac {\partial M} {\partial y} \ne \frac {\partial N} {\partial x}$$

i.e. $$(1)$$ is not exact.

Finally, suppose that $$(1)$$ has a general solution.

Then it is always possible to find an integrating factor $$\mu \left({x, y}\right)$$ such that:
 * $$\mu \left({x, y}\right) \left({M \left({x, y}\right) + N \left({x, y}\right) \frac {dy} {dx}}\right) = 0$$

is an exact differential equation.

Hence it is possible to find that solution by Solution to Exact Differential Equation.

Proof
Let us for ease of manipulation express $$(1)$$ in the form of differentials:
 * $$(2) \qquad M \left({x, y}\right) dx + N \left({x, y}\right) dy = 0$$

Suppose that $$(2)$$ has a general solution:
 * $$(3) \qquad f \left({x, y}\right) = C$$

where $$C$$ is some constant.

We can eliminate $$C$$ by differentiating:
 * $$\frac {\partial f}{\partial x} dx + \frac {\partial f}{\partial y} dy = 0$$

It follows from $$(2)$$ and $$(3)$$ that:
 * $$\frac {dy}{dx} = - \frac M N = - \frac {\partial f / \partial x} {\partial f / \partial y}$$

and so:
 * $$(4) \qquad \frac {\partial f / \partial x} M = \frac {\partial f / \partial y} N$$

Let this common ratio in $$(4)$$ be denoted $$\mu \left({x, y}\right)$$.

Then:
 * $$\frac {\partial f}{\partial x} = \mu M, \frac {\partial f}{\partial y} = \mu N$$.

So, if we multiply $$(2)$$ by $$\mu$$, we get:
 * $$\mu M dx + \mu N dy = 0$$

or:
 * $$\frac {\partial f}{\partial x} dx + \frac {\partial f}{\partial y} dy = 0$$

which is exact.

So, if $$(2)$$ has a general solution, it has at least one integrating factor $$\mu \left({x, y}\right)$$.

Comment
If there is one integrating factor, there are in fact infinitely many.

Suppose $$F \left({f}\right)$$ is any function of $$f$$, then:
 * $$\mu F \left({f}\right) \left({M \left({x, y}\right) dx + N \left({x, y}\right) dy}\right) = F \left({f}\right) df = d \left({\int F \left({f}\right) df}\right)$$

so $$\mu F \left({f}\right)$$ is also an integrating factor.