text: With the development of the first two laws of thermodynamics in the 1850s and 60s, heats of reaction and the work associated with these processes were given a more accurate mathematical basis.  In 1876, Willard Gibbs unified all of this in his 300-page "On the Equilibrium of Heterogeneous Substances". Suppose, for example, we have a general thermodynamic system, called the "primary" system and that we mechanically connect it to a "reversible work source". A reversible work source is a system which, when it does work, or has work done to it, does not change its entropy. It is therefore not a heat engine and does not suffer dissipation due to friction or heat exchanges. A simple example would be a frictionless spring, or a weight on a pulley in a gravitational field. Suppose further, that we thermally connect the primary system to a third system, a "reversible heat source". A reversible heat source may be thought of as a heat source in which all transformations are reversible. For such a source, the heat energy δQ added will be equal to the temperature of the source (T) times the increase in its entropy. (If it were an irreversible heat source, the entropy increase would be larger than δQ/T)
  Define:
  We may now make the following statements
  Eliminating , , and  gives the following equation:
  When the primary system is reversible, the equality will hold and the amount of work delivered will be a maximum. Note that this will hold for any  reversible system which has the same values of dU  and dS .