In my Differential Equations textbook, it says that First-Order ODEs can be written as:
M(x,y)dx + N(x,y)dy = 0
Then, it gives an example:
(y - x)dx + 4xdy = 0
I assume M(x,y) = (y - x) , but I do not understand why N(x ,y)=4x
The reason why I do not understand is because N(x,y) only has x as a variable. So why is it written with that notation?
You state than $N$ is a function of two variables thanks to the symbol $N(x,y)$.
For example $$N(x,y)=4x+a\,y$$ where $a$ is an arbitrary constant.
This is valid any value of $a$, for example $a=0$. $$N(x,y)=4x+0 \: y=4x$$ $$N(x,y)=4x$$ Thus $N(x,y)=4x$ is a particular case of a two variable function.
Of course, this is only one example taken among many. Nobody forbid to state that a two variable function $M(x,y)$ be equal to a single variable function $f(x)$, in stating that $N(x,y)=f(x)$. Just imagine that among the parameters included in the function $N(x,y)$ there is a parameter nul as coefficient of $y$.
This is the same for a one variable function which can be the constant function. I am sure that you are familiar with the constant function : $$f(x)=c$$ The variable $x$ doesn't appears into the function in this particular case. This does not mean that the function doesn't exists.