Entropy of non-interacting electrons

S=-gk_{\mathrm{B}}\Sigma_i[f_i \ln f_i + (1-f_i)\ln (1-f_i)]

[tex
g]:degree of degeneracy
[tex
f_i]:probability that a state is occpied f_i = \left[1+\exp\left(\frac{E-\mu}{T}\right)\right]^{-1}