See e.g. these course notes:
https://ocw.mit.edu/courses/22-51-quantum-theory-of-radiation-interactions-fall-2012/00e219fe9b8a81b64613f1428e87cb00_MIT22_51F12_Ch7.pdf
In particular, I'm asking for a mathematical demonstration regarding a Bose-Einstein distribution.
Thank you.