\deltaUsys = Q+W is derived from the basic equation of energy conservation,
\delta(Energy of system) + \delta(Enenrgy of surroundings) = 0
Here we assume for a closed system, change in Energy of Surroundings can happen only through heat and work transfer with the system.
Thus we can write, \delta(Energy of system) = Q+W
By this logic, this relation should be valid for all kinds of processes.
But example 2.7 of "Intro.toChemical Engineering Thermodynamics" seems to indicate otherwise.
Why would we consider \delta(Usurr) when we are working on a closed system. Won't \delta(Energy of surrounding) be just equal to work done on it = P[sub] ext [\sub] * \delta V?
Attached the pics of the example for convinience.