This is an example of the method of separation of variables for ODEs, which is perfectly standard mathematics and is taught in any college level Differential Equations course.
Like the chain rule, it intuitively splits up the dx, dy, or what have you in a derivative like it was a ratio. As for what dx, dy, etc are, the precise definition comes from measure theory and/or differential geometry. For the non-mathematician, take things like separation of variables on faith and think of dx, dy, etc as an infinitesimal over which we sum when we integrate, like the delta(x) in the Riemann integral when the step size is tending to zero.