I’m running into problems with a summation
$$\langle p \rangle = \frac{\sum_{p=0}^{N-1}px^p}{\sum_{p=0}^{N-1}x^p} = x\frac{d}{dx}ln(\sum_{p=0}^{N-1}x^p)$$
I know I’ve seen this before but I can’t remember the justification to get it summed to
$$\frac{Nx^N}{x^N-1}-\frac{x}{x-1}$$
Any help greatly appreciated
Okay this is pretty straightforward, posting for any future viewers... you need to start by breaking down the sum into $$\sum_{p=0}^{\infty}x^p = \sum_{p=0}^{N-1}x^p + \sum_{p=N}^{\infty}x^p$$ then
$$ \sum_{p=0}^{N-1}x^p = \sum_{p=0}^{\infty}x^p - \sum_{p=N}^{\infty}x^p$$ and we get $$x\frac{d}{dx}\ln\left(\frac{1-x^N}{1-x}\right) = x\frac{d}{dx}[\ln(1-x^N)-\ln(1-x)]$$ from which the result follows.