Potential energies are not always quadratic in the position. However, the equipartition theorem also shows that if a degree of freedom x contributes only a multiple of x (for a fixed real number s) to the energy, then in thermal equilibrium the average energy of that part is k B T / s.