In Morris Tenenbaum's Ordinary Differential Equation's he introduces the concept of the differential of a function $f(x)=y$ with the definition:
$$dy\left(x,\Delta x\right)=f'\left(x\right)\Delta x$$
He then treats $x$ as the identity map, to motivate replacing $\Delta x$ with $dx$, formalising why we write:
$$ dy=f'(x)dx$$
However, he then introduces seperable differential equations, which he writes as: $$f(x)dx + g(y)dy = 0$$ treating $dx$ and $dy$ as differentials. At which point he asserts:
$$\int{f(x)dx}+\int{g(y)dy}=C$$
So what is happening here formally with regards to the original definiton of the differential?
Since $dx,dy\ne0$ you can "divide" by them to give: $$f(x)+g(y)y'=0$$ which seems more familiar. Furthermore, if we say that $y$ satisfies the equation $y=h(x)$ we get: $$f(x)+gh(x)\cdot h'(x)=0$$
Note that in the equation: $$f(x)dx+g(y)dy=0$$ $dx$ and $dy$ are not independent, since $y$ is a function of $x$ and so $dy$ is a function of $dx$