From here: http://en.wikipedia.org/wiki/Brillouin_function
Define $$B_j(x)=\frac{2j+1}{2j} \coth \left( \frac{2j+1}{2j} x \right) - \frac{1}{2j} \coth \left( \frac{1}{2j} x \right)$$
I want to do this calculation ($m,j$ are integers):
$$\langle m \rangle = \sum_{-j\le m\le j} m \ P(m)$$
where $$P(m)=\frac{e^{xm/j}}{Z}$$
and
$$Z = \sum_{-j\le m\le j} e^{xm/j}$$
The answer is supposed to be
$$\langle m \rangle = j \cdot B_j (x)$$
But I'm unable to grind through this calculation. I keep getting stuck with an awful expression with exponentials that I can't seem to simplify. I tried expressing them as the cotangents and the best I got was the two cotangents from the original formula plus a ton of garbage that didn't seem to cancel. I'm guessing there is some sort of trick to calculating stuff like this that I'm unaware of.