Using the equation (\ref{7}) we will obtain the equilibrium criterion at constant T and V. We must bear in mind that these conditions assume $dV=0$ and $dT=0$. Substituting in (\ref{7}) $dw=-PdV$ in addition to adding and subtracting $SdT$ is obtained. $$dU\leq TdS +SdT-sdT -PdV$$ Since $d(TS)=TdS+SdT$ the previous equation remains: $$dU\leq d(TS)- SdT-PdV$$ Passing the term $d(TS)$ to the first term of the inequality $$d(U-TS)\leq -SdT-PdV$$ Holding T and V constant during the process, $dT=dV=0$ $$d(U-TS)\leq 0$$ This means that during an irreversible process (chemical reaction or mass transfer between phases) the function of state $U-TS$ decreases until equilibrium. Once equilibrium is reached, this function remains constant. Therefore, the equilibrium criterion at constant T, V consists in minimizing the state function $U-TS$. This function is called the Helmholtz free energy, and is represented by A. $$A=U-TS$$

Finally we have to find the material equilibrium criterion at constant T, P. Adding and subtracting from the equation (\ref{7}) $SdT$ and VdP: $$dU \leq TdS+SdT-SdT-PdV+VdP-VdP$$ Grouping: $$dU\leq d(TS)-SdT-d(PV)+VdP$$ $$d(U+PV-TS)\leq-SdT-VdP$$ Given that $dT=dV=0$ and that $H=U+PV$ $$d(H-TS)\leq 0$$ The state function $H-TS$ is called the Gibbs free energy and is represented by G. $$G=H-TS$$ The function G decreases as the thermodynamic system approaches material equilibrium, reaching its minimum value at equilibrium.