Base on the concept of system, the first law and second law of thermodynamics, the formulas for calculating the maximum useful work(MUW, or exergy)done by unequilibrium system are deriverd by a concise and rigorous approach.
A system combining with the environment with fixed pressure and fixed temperature, or the heat reservoir with fixed temperature, or the finite system, or subsystem of infinite system may offer the MUW to external bodies.
For heat reservoir and environment combination, the reversible Carnot heat engine must be introduced for obtaining MUW , and this is the sole case for adopting the Carnot heat engine to derive the result. For two finite system with different thermodynamic parameters, the general mathematic formula of MUW is derived; if two finite systems are different in composition, it is shown that the MUW can be calculated from the irreversible mixing process. For a subsystem of the infinite system, it changes from the initial state with the same parameters as the infinite system to the final state with the same parameters as the environment, the MUW can be derived form considering the subsystem as a closed system, the result is just the exergy of steady flow process.
It is emphasized that if a uniform system has to be caused to any difference or unequilibrium parameters, the minimum work (from mathematical meaning, it is the maximum work) done by external to the system is necessary, and the calculation is based on the same formula for the exergy problem.