It's really not possible to write it as a fraction. The notation $\frac{dy}{dx}$ is a limiting process, not an actual fraction so it doesn't make sense to split them. It's just a notational convenience because it is reminiscent of difference quotients and slope formula. Really what is going on in a differential equations course is that you're doing chain rule without the "inconvenience" of having to think about doing the chain rule. Take for instance the following differential equation:
$$\frac{dy}{dx} = y.$$
In a differential equations course they tell you to move the $y$ over and then multiply by $dx$ but since $\frac{dy}{dx}$ isn't really a fraction, instead what you should really be doing is the following:
$$\frac{1}{y}\frac{dy}{dx} = 1.$$
We can recognize the left hand side as the derivative of $C\log|y(x)|$ (you can check this by differentiating via chain rule). If you then write $y$ in terms of $x$, you'll get the same expression as you would if you "separated" the differentials.
In the language of differential forms in differential geometry, expressions like $F(x)dx+G(y)dy$ mean something very specific and you can actually make sense of them however even then $dx$ and $dy$ are (co)vectors so it doesn't make sense to divide them and again they're not differentials. It's just suggestive notation that happens to unify some seemingly disjoint theorems in mathematics.