I have been looking at this derivation
The mean photon number is given by: \begin{align} \bar n&=\sum_{n=0}^\infty n\ \cal P_\omega(n)\\ &=\sum_{n=0}^\infty nx^n(1-x)\\ &=(1-x)x\ \frac{\text d}{\text dx}\left(\sum_{n=0}^\infty x^n\right)\\ &=(1-x)x\ \frac{\text d}{\text dx}\left(\frac1{1-x}\right)\\ &=(1-x)x\ \frac1{(1-x)^2}\\ &=\frac{x}{1-x} \end{align}
and I cannot for the life of me understand how the author simplified it. Where does the derivative come from? Any help understanding this would be greatly appreciated.