The Clausius statement implies the Kelvin-Planck statement: -
So if we had a magic heat engine, we could have a magic fridge. Therefore, the statement that you can't have a magic fridge implies that you can't have a magic heat engine.
The Kelvin-Planck statement implies the Clausius inequality: -
We now wish to prove that the statement that you can't have a magic heat engine implies the Clausius inequality - that for any closed, stationary system operating in a cycle
where Q is as usual the heat transferred to the system and T is the temperature at the boundary of the system.
We shall prove this with the assistance of the piece of imaginary equipment shown in the diagram below. We choose any closed, stationary system (hereafter referred to as "the chosen system"). We imagine that the chosen system is attached to a reversible system which is connected to a thermal reservoir, as shown on the diagram.
By convention, the diagram shows heat flowing in to the chosen system and work coming out of it. We emphasize, however, that this is not a restriction on what the chosen system is allowed to do: it merely means that work input or heat output will have negative sign.
It is important to note that the inequality we're going to derive relates only to the boundary temperature and heat flow of the chosen system, and is therefore true whether or not the chosen system is connected to a reversible system which is connected to a thermal reservoir. The reversible system and the thermal reservoir are, so to speak, intellectual scaffolding, which will be discarded after we have produced our result.
So, consider the diagram. The combined system of the chosen system and the reversible system to which it's attached is, like everything else, subject to the First Law of Thermodynamics, which we give for the combined system in its differential form: δQr - δW = dE.
Now, as the reversible system is reversible, then if we are using a Thermodynamic Temperature Scale (eg degrees kelvin) then by the definition of a thermodynamic temperature scale we have δQr / δQ = Tr / T.
For convenience, we shall assume that the reversible system performs an whole number of cycles in the same time that the chosen system takes to execute one. Now, let's integrate the equation above over one cycle of the chosen system.
Of course, is simply W. To evaluate , recall that over a cycle, the combined system can neither gain nor lose energy - or it wouldn't be a cycle - and so . This gives us
which we shall rearrange to give
Now, here's the clever part. There is no such thing as a magic heat engine. That's the Kelvin-Planck statement of the Second Law, and the whole thing we're basing our argument on.
Now, look at the diagram given above, and observe that the combined system is connected to only one thermal reservoir. If the net work output W was greater than zero, the combined system would be a magic heat engine. Therefore, the net work output W of the combined system is less than or equal to zero, and so
Finally, we note that Tr is a constant (being the temperature of a thermal reservoir) and positive, since we are using a thermodynamic temperature scale. So we can divide both sides of the inequality through by Tr, giving us