# Calculating average energy and black body energy spectrum using Boltzman probability

The question is as follows:

The black body energy spectrum is $$\rho$$(T,v)dv=$$\frac{8\piv2<E(v)>}{c3}$$dv where v is the frequency of the EM wave and <E(v)> is the average energy at v. Assuming the energy of a EM wave of v can only take multiples of hv, the from the Boltzman probability P(E)=exp(-E/kbT/$$\sumexp(-E/kbT$$), calculate the average energy <E(v)>=$$\sumEP(E)$$ and $$\rho$$(T,v). Discuss the result in the limits of hv<<kbT and hv>>kbT, and compare the results with the Rayleigh-Jean Law and Wien's result.

I am fairly sure that answering this question intails basically deriving $$\rho$$(T,v) which involves putting the probabilty series within the average energy series. Then taking the simplified expression for average energy and inserting it into the black body spectrum equation. I know from online research that $$\rho$$(T,v)=$$\frac{2hv3}{c2}$$$$\frac{1}{e\frac{hv}{kbT}-1}$$.

Basically I get to the point where <E>=-$$\partiallnZ$$/$$\partial$$$$\beta$$ where z=$$\sum$$exp(-nhv$$\beta$$) and $$\beta$$=1/kbT.

I can see that if I am able to continue the derivation then the exp term can allow me to answer the questions about limit behavior. My problem is with finishing the derivation. Can anyone help?