The Clausius Theorem and Inequality
The equality above represents the Clausius Theorem and applies only the the ideal or Carnot cycle. Since the integral represents the net change in entropy in one complete cycle, it attributes a zero entropy change to the most efficient engine cycle.
The Clausius Inequality applies to any real engine cycle and implies a negative change in entropy on the cycle. That is, the entropy given to the environment during the cycle is larger than the entropy transferred to the engine by heat from the hot reservoir. In the simplified heat engine where the heat QH is all added at temperature TH, then an amount of entropy ΔS = QH/TH is added to the system and must be removed to the environment to complete the cycle. In general, the engine temperature will be less than TH for at least part of the time when heat is being added, and any temperature difference implies an irreversible process. Excess entropy is created in any irreversible process, and therefore more heat must be dumped to the cold reservoir to get rid of this entropy. This leaves less energy to do work.
Carnot cycle concepts
Heat engine concepts