Inexact differential equation

An inexact differential equation is a differential equation of the form (see also: inexact differential)


 * $$M(x,y) \, dx+N(x,y) \, dy=0, \text{ where } \frac{\partial M}{\partial y} \ne \frac{\partial N}{\partial x}. $$

The solution to such equations came with the invention of the integrating factor by Leonhard Euler in 1739.

Solution method
In order to solve the equation, we need to transform it into an exact differential equation. In order to do that, we need to find an integrating factor $$\mu$$ to multiply the equation by. We'll start with the equation itself. $$M\,dx+N\,dy=0$$, so we get $$\mu M\,dx+\mu N\,dy=0$$. We will require $$\mu$$ to satisfy $\frac{\partial\mu M}{\partial y}=\frac{\partial\mu N}{\partial x}$. We get
 * $$\frac{\partial\mu}{\partial y}M+\frac{\partial M}{\partial y}\mu=\frac{\partial\mu}{\partial x}N+\frac{\partial N}{\partial x}\mu.$$

After simplifying we get
 * $$M\mu_y-N\mu_x+(M_y-N_x)\mu = 0.$$

Since this is a partial differential equation, it is mostly extremely hard to solve, however in some cases we will get either $$\mu (x,y) =\mu (x)$$ or $$\mu (x,y) =\mu (y)$$, in which case we only need to find $$\mu$$ with a first-order linear differential equation or a separable differential equation, and as such either
 * $$\mu(y)=e^{-\int{\frac{M_y-N_x}{M} \, dy}}$$

or
 * $$\mu(x)=e^{\int{\frac{M_y-N_x}{N} \, dx}}.$$