Hey prasum.

This looks like a template for an exact system where Mdx + Ndy = 0 can be found if dM/dy = dN/dx (also you might need a - instead of a +: I took this class a very long time ago).

If it is exact then there is a technique for finding the solutions.