We have four fundamental functions: internal energy U, enthalpy H, Helmholtz free energy F, and Gibbs free energy G. They are potential energy defined as capacity to do work. Starting from the first and second laws of thermodynamics, we derive expressions for the differential form of four thermodynamic potentials.