Internal Energy and the Equipartition of Energy

The internal energy is the total of all the energy associated with the motion of the atoms or molecules in the system. This includes energy associated with translation, rotation, and vibration.

Equipartition of Energy: Each contribution to the internal energy contributes an equal amount of energy.

For a monatomic ideal gas, the only contribution to the energy comes from translational kinetic energy. The internal energy is therefore:
Monatomic ideal gas: Eint =
3
2
NkT =
3
2
nRT

Each direction (x, y, and z) contributes ½NkT to the energy. This is where the equipartition of energy idea comes in - any other contribution to the energy must also contribute ½NkT.

For a diatomic molecule there are three translation directions, and rotational kinetic energy also contributes, but only for rotations about two of the three perpendicular axes. The five contributions to the energy (five degrees of freedom) give:
Diatomic ideal gas: Eint =
5
2
NkT

This actually applies at intermediate temperatures. At low temperatures only the translational kinetic energy contributes, and at higher temperatures two additional contributions (kinetic and potential energy) come from vibration.