Integrating factor that depends on \(x\) only
Let
\begin{align} \mu M\left ( x,y\right ) +\mu N\left ( x,y\right ) \frac {dy}{dx} & =d\phi \left ( x,y\right ) \tag {1}\\ & =\frac {\partial \phi }{\partial x}\frac {dx}{dx}+\frac {\partial \phi }{\partial y}\frac {dy}{dx}\nonumber \\ & =\frac {\partial \phi }{\partial x}+\frac {\partial \phi }{\partial y}\frac {dy}{dx} \tag {2}\end{align}
Comparing (1),(2) then
\begin{align*} \frac {\partial \phi }{\partial x} & =\mu M\\ \frac {\partial \phi }{\partial y} & =\mu N \end{align*}
The compatibility condition is \(\frac {\partial ^{2}\phi }{\partial y\partial x}=\frac {\partial ^{2}\phi }{\partial x\partial y}\) then this implies
\begin{align*} \frac {\partial }{\partial y}\left ( \frac {\partial \phi }{\partial x}\right ) & =\frac {\partial }{\partial x}\left ( \frac {\partial \phi }{\partial y}\right ) \\ \frac {\partial \mu M}{\partial y} & =\frac {\partial \mu N}{\partial x}\\ \mu _{y}M+\mu M_{y} & =\mu _{x}N+\mu N_{x}\\ \mu _{x}N & =\mu _{y}M+\mu M_{y}-\mu N_{x}\\ \mu _{x}N & =\mu _{y}M+\mu \left ( M_{y}-N_{x}\right ) \\ \mu _{x} & =\frac {\mu _{y}M}{N}+\frac {\mu }{N}\left ( M_{y}-N_{x}\right ) \end{align*}
Assuming \(\mu \equiv \mu \left ( x\right ) \) then \(\mu _{y}=0\) and the above simpliļ¬es to
\begin{align*} \mu _{x} & =\frac {\mu }{N}\left ( M_{y}-N_{x}\right ) \\ \frac {d\mu }{dx}\frac {1}{\mu } & =\frac {1}{N}\left ( \frac {\partial M}{\partial y}-\frac {\partial N}{\partial x}\right ) \end{align*}
Let \(\frac {1}{N}\left ( \frac {\partial M}{\partial y}-\frac {\partial N}{\partial x}\right ) =A\). If \(A\equiv A\left ( x\right ) \) which depends only on \(x\) then we can solve the above.
\begin{align*} \frac {d\mu }{dx}\frac {1}{\mu } & =A\\ \mu & =e^{\int Adx}\end{align*}
Let \(\overline {M}=\mu M,\overline {N}=\mu N\) then the ode
\[ \overline {M}\left ( x,y\right ) +\overline {N}\left ( x,y\right ) y^{\prime }=0 \]
is now exact.