First Law of Thermodynamics is expressed as[1]
The internal energy of an isolated system is constant.
If $w$ denotes the work done on a system, $q$ for the energy transferred as heat to the system, and $\Delta U$ for the resulting change in internal energy, then it follows that $$\Delta U = q + w \label{1}\tag{1}$$
$$\mathrm{d}U = \mathrm{d}q + \mathrm{d}w \label{2}\tag{2}$$
What I don't understand is how does $\eqref{2}$ follow mathematically from $\eqref{1}$. Taking the limit $\Delta U \rightarrow 0$ gives the left-hand side but how does $q$ change into $\mathrm{d}q$ and $w$ into $\mathrm{d}w$? I understand the interpretation of both the equations physically. Is this related to the fact that $U$ is a state function whereas $q$ and $w$ are not?
Reference:
[1] Atkins, P.; de Paula, J. Physical Chemistry, 10th ed; Oxford UP: Oxford, U.K., 2014.