For the sake of simplicity, let us suppose that the water surface area is infinite, so that the immersion of the body does not generate any change in the water level. The potential energy of the body itself is , where is the body's weight, and the height of its center of gravity, , relative to the surface of the water. If the body displaces a volume of water then this effectively means that a weight of water, whose center of gravity is located at the center of buoyancy, , is removed, and then spread as an infinitely thin film over the surface of the water. This involves a gain of potential energy of , where is the height of relative to the surface of the water. Vertical force balance requires that . Thus, the potential energy of the system is (modulo an arbitrary additive constant), where is the height of the center of gravity relative to the center of buoyancy.
According to the principles of statics, an equilibrium state corresponds to either a minimum or a maximum of the potential energy (Fitzpatrick 2012). However, such an equilibrium is only stable when the potential energy is minimized. Thus, it follows that a stable equilibrium configuration of a floating body is such as to minimize the height of the body's center of gravity relative to its center of buoyancy.