Integrating Factor for First Order ODE/Function of One Variable

Theorem
Let the first order ordinary differential equation:
 * $(1): \quad \map M {x, y} + \map N {x, y} \dfrac {\d y} {\d x} = 0$

be non-homogeneous and not exact.

Suppose that:
 * $\map g x = \dfrac {\dfrac {\partial M} {\partial y} - \dfrac {\partial N} {\partial x} } {\map N {x, y} }$

is a function of $x$ only.

Then:
 * $\map \mu x = e^{\int \map g x \rd x}$

is an integrating factor for $(1)$.

Similarly, suppose that:
 * $\map h y = \dfrac {\dfrac {\partial M} {\partial y} - \dfrac {\partial N} {\partial x} } {\map M {x, y} }$

is a function of $y$ only.

Then:
 * $\map \mu y = e^{\int -\map h y \rd y}$

is an integrating factor for $(1)$.

Proof for Function of $x$ or $y$ only
Suppose that $\mu$ is a function of $x$ only.

Then:
 * $\dfrac {\partial \mu} {\partial x} = \dfrac {d \mu} {d x}, \dfrac {\partial \mu} {\partial y} = 0$

which, when substituting in $(3)$, leads us to:
 * $\dfrac 1 \mu \dfrac {\d \mu} {\d x} = \dfrac {\map P {x, y} } {\map N {x, y} } = \map g x$

where $\map g x$ is the function of $x$ that we posited.

Similarly, if $\mu$ is a function of $y$ only, we find that:
 * $\dfrac 1 \mu \dfrac {\d \mu} {\d y} = \dfrac {\map P {x, y} } {-\map M {x, y} } = \map h y$

where $\map h y$ is the function of $y$ that we posited.