text: The definitions of the thermodynamic potentials may be differentiated and, along with the first and second laws of thermodynamics, a set of differential equations known as the fundamental equations follow. (Actually they are all expressions of the same fundamental thermodynamic relation, but are expressed in different variables.) By the first law of thermodynamics, any differential change in the internal energy  of a system can be written as the sum of heat flowing into the system subtracted by the work done by the system on the environment, along with any change due to the addition of new particles to the system:
  where  is the infinitesimal heat flow into the system, and  is the infinitesimal work done by the system,  is the chemical potential of particle type  and  is the number of the type  particles. (Neither  nor  are exact differentials, i.e., they are thermodynamic process path-dependent. Small changes in these variables are, therefore, represented with  rather than .)
  By the second law of thermodynamics, we can express the internal energy change in terms of state functions and their differentials. In case of reversible changes we have:
  where
  :  is temperature,
  :  is entropy,
  :  is pressure,
  and  is volume, and the equality holds for reversible processes.
  This leads to the standard differential form of the internal energy in case of a quasistatic reversible change:
  Since ,  and  are thermodynamic functions of state (also called state functions), the above relation also holds for arbitrary non-reversible changes. If the system has more external variables than just the volume that can change, the fundamental thermodynamic relation generalizes to:
  Here the  are the generalized forces corresponding to the external variables .
  Applying Legendre transforms repeatedly, the following differential relations hold for the four potentials (fundamental thermodynamic equations or fundamental thermodynamic relation):
  The infinitesimals on the right-hand side of each of the above equations are of the natural variables of the potential on the left-hand side. Similar equations can be developed for all of the other thermodynamic potentials of the system. There will be one fundamental equation for each thermodynamic potential, resulting in a total of  fundamental equations.
  The differences between the four thermodynamic potentials can be summarized as follows: