Solution (source code)

= Solution

Exactness after multiplication requires $\partial_y(\mu M)=\partial_x(\mu N)$. Since $\mu$ depends only on $x$,
$$
\mu M_y=\mu' N+\mu N_x.
$$
For $\mu=\exp(\int f(x)\,dx)$, the ratio $\mu'/\mu$ is $f(x)$, so
$$
\boxed{f(x)=\frac{M_y-N_x}{N}},\qquad
\boxed{\mu(x)=\exp\int\frac{M_y-N_x}{N}\,dx}.
$$
The assumed existence means this ratio is a <function> only of $x$ wherever the division is valid. For a factor depending only on $y$, the corresponding equation is $\psi'M+\psi M_y=\psi N_x$, giving
$$
\boxed{\psi(y)=\exp\int\frac{N_x-M_y}{M}\,dy}.
$$
These are the <integrating factor for a differential one-form> formulas. Nonzero constant multiples are equivalent. Exactness follows locally from closedness, and globally on a suitable <simply connected domain>.