Clarify definite integration of differentials in physics problems
The notation is misleading - while $\mathrm{d}U_p$ really is the differential of a state function $U_p$, there is no state function $W$ whose differential $\mathrm{d}W$ could be. That is, it is an "inexact differential" or inexact 1-form, which you can evaluate along paths but for which no potential function exists. The "$W$" we usually write on the l.h.s. of your equation should be thought of as $W[\gamma]$, where $\gamma$ is the path you're integrating along, i.e. "work" is a functional on paths whose value you get by integrating the inexact differential $\mathrm{d}W$. Some people are careful to make the inexactness visible by writing inexact differentials as $\delta W$, but there seems to be no consensus on this.
See also this answer by Joshphysics for a formal proof of the fact that the existence of the path functional "work" $W$ is equivalent to the existence of a 1-form $\mathrm{d}W$. Physically, this still has the meaning of $\mathrm{d}W$ being the "infinitesimal version" of $W$, but as said, the crucial difference to something like potential energy is that $W$ is not a function on spatial points, but a function on the paths, hence the $\mathrm{d}$ in $\mathrm{d}W$ does not denote ordinary differentiation.
The force from pressure in your second example is the same, just in one dimension higher: The $P\mathrm{d}A$ is an inexact 2-form that can be integrated over 2-dimensional objects (=surfaces), and this produces a functional on surfaces that we can call $F$ that assigns to any surface that integral.
In general, we note that the viewpoint that unifies both exact and inexact differentials is the notion of differential p-forms that can be integrated over p-dimensional objects. The differentials $\mathrm{d}U_p, \mathrm{d}W, \mathrm{d}F$ appearing here are all examples of such forms. The $\mathrm{d}U_p$ is special, because it is the (exterior) derivative of a 0-form (a function) $U_p$, while the others are no such derivatives. In full generality, if you have a $p$-form $\omega$ that is the exterior derivative of a $p-1$-form, you can use a general version of Stokes' theorem to reduce an integral of $\omega$ over a $p$-dimensional object to the integral of $\sigma$ over the $p-1$-dimensional boundary of that object.
Since you're wondering in a comment how to tell whether any given form (or "differential" is a derivative or not: This is answered by Poincaré's lemma: On nice (contractible) regions, it is necessary and sufficient for the (exterior) derivative of a form to vanish in order for it to have a $p-1$-form that is its antiderivative.