Let $M(x,y)dx+N(x,y)dy=0$ is a differential equation of first order, and $I(x,y)$ is an integrating factor for this equation. With multiplying by $I$ we suppose $IMdx+INdy=0$ be exact. So we have
\begin{eqnarray*}
\frac{\partial(IM)}{\partial y} &=& \frac{\partial(IN)}{\partial x} \\
\frac{\partial I}{\partial y}M+I\frac{\partial M}{\partial y} &=& \frac{\partial I}{\partial x}N+I\frac{\partial N}{\partial x} \\
I(\frac{\partial M}{\partial y}-\frac{\partial N}{\partial x}) &=&\frac{\partial I}{\partial x}N-\frac{\partial I}{\partial y}M ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~(1)
\end{eqnarray*}
Let $I$ be a function of $x$ only, then $\dfrac{\partial I}{\partial y}=0$ and $(1)$ concludes that
$$I(\frac{\partial M}{\partial y}-\frac{\partial N}{\partial x}) =\frac{\partial I}{\partial x}N$$
which gives
$$\frac{\frac{\partial M}{\partial y}-\frac{\partial N}{\partial x}}{N} =\frac{\frac{\partial I}{\partial x}}{I}$$
If $\dfrac{∂M/∂y − ∂N/∂x}{N} = Q$, so $Q$ is a function of $x$ only, then from the last
$$Q(x)=\frac{1}{I}\frac{\partial I}{\partial x}$$
or
$$Q(x)dx=\frac{\partial I}{I}$$
by integration of two sides,
$$\int Q(x)dx=\int\frac{\partial I}{I}=\ln I$$
which obtains $I$ and we say that $I$ is an integrating factor of the form
$$I(x)=exp\int Q(x)dx$$