Algorithm to find an integrating factor in a first order ODE?

Is there an algorithm to find the integrating factor for any given first order differential equation or can we only solve it by guesswork or trial and error method? If not what should I look for while considering any first order non-exact differential equation?

For the non-linear, non-exact first order O.D.E $f(x,y)=M(x,y) + N(x,y)y'=0$, the integrating factor $\mu(x,y)$ can be written as $$\mu(x,y) = e^{\int{\frac{M_y - N_x}{N}dx}}$$. Multiplying $f(x,y)$ by $\mu(x,y)$ will make $f$ exact.