How does $dS \ge 0$ imply a system cannot receive more energy than work supplied?
I am reading a book that asserts the following:
"The second law arises from an equation of the form (Eqn 1)
$$dS = \mu\,dE + \mu\,dW $$
where $dS$ is the change in entropy, $dE$ the change in system energy, and $-dW$ is the work done externally on the system. Thus the second law expressed as $dS \ge 0$ simply asserts that the system cannot receive more in energy than the amount of external work supplied."
I am confused by this. I know we normally have something like (Eqn 2)
$$dU=T\,dS-dW$$
where $U$ is internal energy, $dW$ is work done by the system, $T$ is temperature. This makes sense to me. 749
The gain of internal energy is equal to energy flowing in as heat ($T\,dS$ is positive if heat is flowing in) less the energy flowing out as work ($dW$ is positive if the system is doing work).
We can get Eqn 1 from Eqn 2, if we write $U \to E$, $\frac{1}{T} \to \mu$ and take the $dW$ to the other side. Furthermore, $dW$ in Eqn 2 is the work done by the system, so it is correct to say, with respect to Eqn 1, that $-dW$ is the work done on the system.
So Eqn 1 looks fine. The use of $dS \ge 0$ as a statement of the second law of thermodynamics also looks fine.
If we then call the work done on the system $dW'$ so that $dW=-dW'$, we can write Eqn 1 as (Eqn 3)
$$dS=\mu\,dE-\mu\,dW'$$
If we then assert that $dS \ge 0$, this implies that
$$\mu\,dE-\mu\,dW'\ge0$$
which implies that $dE \ge dW'$, i.e. the system must receive more energy than the external work supplied. Not only is this contrary to the statement of the book, but it does not make sense.
So how do starting points that make sense lead to something that does not make sense?
I believe it is something to do with the fact that the $dS$ in Eqn 1 refers to the entropy of the system, while the $dS$ in $dS \ge 0$ refers to total entropy of system plus surroundings.
Am I correct that the book is confusing these and leaving out some steps in the argument, so that, as written, it doesn't make sense? Or is the book perfectly correct, and it is me that is missing something? 749