$$E=E_{tr}+E_{rot}+E_{vib}+E_{ele}$$

Calculation of internal translational energy

$$E_{tr}=NkT^2 \left(\frac{\partial lnq_{tr}}{\partial T}\right)_{V}$$

$$q_{tr}=\left(\frac{2\pi mkT }{h^2}\right)^{3/2}V \Rightarrow lnq_{tr}=\frac{3}{2}lnT+ln\left(\frac{2\pi mk}{h^2} \right)_V$$

Differentiating:

$$\left(\frac{\partial q_{tr}}{\partial T}\right)_V=\frac{3}{2}\frac{ 1}{T}$$

$$E_{tr}=NkT^2 \cdot \frac{3}{2T}=\frac{3}{2}NkT=\frac{3}{ 2}nRT$$

Calculation of rotational internal energy

$$E_{rot}=NkT^2\left(\frac{dlnq_{rot}}{dT}\right)$$

$$q_{rot}=\frac{T}{\sigma\theta_{rot}} \Rightarrow lnq_{rot}=lnT-ln\sigma\theta_{rot}$$

Deriving: $$\frac{dlnq_{rot}}{dT}=\frac{1}{T}$$

Substituting the derivative into the energy expression

$$E_{rot}=NkT^2\ cdot \frac{1}{T}=NkT=nRT$$

Calculation of internal vibrational energy

$$E_{vib}=NkT^2\left(\frac{dlnq_{vib}}{dT}\right)$$

$$q_{ vib}=\frac{1}{1-e^{-\theta_{vib}/T}}\Rightarrow lnq_{vib}=-ln(1-e^{-\theta_{vib}/T})$$

Deriving:

$$\frac{dlnq_{vib}}{dT}=\frac{\theta_{vib}/T^2 e^{-\theta_{vib}/T}}{1 -e^{-\theta_{vib}/T}}=\frac{\theta_{vib}/T^2}{e^{\theta_{vib}/T}-1}$$

Substituting this derivative in the energy equation

$$E_{vib}=nR\theta_{vib}\frac{1}{e^{\theta_{vib}/T}-1}$$