# Apparently Spurious Argumentation in Justification of Clausius Inequality

In section 7-1 of Cengel and Boles text, "Thermodynamics - An Engineering Approach", the authors give a demonstration of the validity of the Clausius Inequality. In their justification, the authors ask the reader to consider a compound system composed of a reversible cyclic device connected to some system (as shown in the attached figure). The cyclic device receives heat $$\delta Q_R$$ from a thermal reservoir at temperature $$T_R$$ and produces an amount of work $$\delta W_{\mathrm{rev}}$$. The cyclic device rejects an amount $$\delta Q$$ of heat to the system, whose boundary temperature is $$T$$. Due to this transfer of heat, the system performs an amount of work $$\delta W_{\mathrm{sys}}$$. Applying the First Law, the authors come up with

$$\delta W_c = \delta Q_R - d E_c, \quad (1)$$

where the subscript "c" refers to the compound system. Now, I have no qualms with the terms $$\delta W_c$$ or $$d E_c$$, however, I find $$\delta Q_R$$ a bit troublesome. The authors fail to consider heat rejected by the system that does an amount $$\delta W_{sys}$$ of work. The way the First Law is phrased above in (1), it looks like all the heat $$\delta Q_R$$ that was transferred to the system is transformed into mechanical work. However, this would violate the Second Law. Am I missing something? How do I overcome this apparent inconsistency?

The symbols $$\delta Q$$ and $$\delta Q_R$$ can in principle have either sign so they include heat flow both into and out of the system or the reservoir. They are chosen to represent the net flow in the direction of the arrow in the diagram after all heat transfers (in either direction) have been accounted for.
Next, you are correct that if $$\delta Q_R > 0$$ then we have a violation of the Second Law if the system and heat engine have returned to their initial states. That is precisely what this bit of reasoning is all about! We deduce that $$\delta Q_R < 0$$ in the case of a sequence of changes where the system finishes in the same state it started in.