the calculation of a power series I am struggling a bit with power series. I found the following question through my reading to a basic book of probability in French, and I don't quite understand what this question is asking me to do?
Let $\rho \in (0,1)$. By differentiating the power series coefficient $$a_n := 1, n \geq 0,$$
calculate , for all $k \in \{1,2 \},$
$$(1- \rho) \sum_{n=1}^{\infty}n^k \rho^{n-1}$$
I know that in general,
$$1 + n + n^2 + \cdots = \frac{1}{1 - n}, \quad |n| < 1.$$
and for sure, since power series could be differentiated term by term, we have
$$1 + 2n + 3n^2 + \cdots = \frac{1}{(1 - n)^2}, \quad |n| < 1.$$
I think it's a pretty basic question but I don't know what to do! Thanks for help
 A: The problem is with $\rho$ and not $n$.
Suppose that $k$ is an integer and call 
$$S_k=\sum_{n=1}^{\infty}n^k \rho^{n-1}$$
$$S_1=\sum_{n=1}^{\infty}n \rho^{n-1}=\left(\sum_{n=1}^{\infty} \rho^{n}\right)'$$
$$S_2=\sum_{n=1}^{\infty}n^2 \rho^{n-1}=\sum_{n=1}^{\infty}[n(n-1)+n] \rho^{n-1}=\sum_{n=1}^{\infty}n(n-1) \rho^{n-1}+\sum_{n=1}^{\infty}n \rho^{n-1}$$ The last sum is $S_1$ that you know. Now
$$\sum_{n=1}^{\infty}n(n-1) \rho^{n-1}=\rho\sum_{n=1}^{\infty}n(n-1) \rho^{n-2}=\rho\left(\sum_{n=1}^{\infty} \rho^{n}\right)''$$
A: Consider a generating function 
$$
\sum_{k=0}^\infty \frac{t^k}{k!}\sum_{n=1}^\infty n^kρ^{n-1}=\sum_{n=1}^\infty e^{nt}ρ^{n-1}=\frac{e^t}{1-ρe^t}
$$
To get the first series values, truncate the power series appropriately,
$$
\frac{1-ρ}{e^{-t}-ρ}+O(t^3)=\frac{1}{1-\frac{t}{1-ρ}+\frac{t^2}{2(1-ρ)}+O(t^3)}
=\frac{1+\frac{t}{1-ρ}}{1-\frac{t^2}{(1-ρ)^2}+\frac{t^2}{2(1-ρ)}+O(t^3)}
\\
=\left(1+\frac{t}{1-ρ}\right)\left(1+\frac{t^2}{(1-ρ)^2}-\frac{t^2}{2(1-ρ)}\right)+O(t^3)
$$
so that, as is known,
$$
(1-ρ)\sum_{n=1}^\infty nρ^{n-1}=\frac1{1-ρ}
$$
and the next one is
$$
(1-ρ)\sum_{n=1}^\infty n^2ρ^{n-1}=\frac2{(1-ρ)^2}-\frac1{1-ρ}=\frac{1+ρ}{(1-ρ)^2}
$$
This approach works best in a computer algebra system where you could obtain arbitrarily large powers by (setting $ρ=1-a$)
A<a>:=FunctionField(Rationals());
P<t>:=PowerSeriesRing(A);
g:=a/(Exp(-t+O(t^7))-(1-a));
for k in [0..6] do k,Coefficient(g,k)*Factorial(k); end for;

0 1
1 1/a
2 (-a + 2)/a^2
3 (a^2 - 6*a + 6)/a^3
4 (-a^3 + 14*a^2 - 36*a + 24)/a^4
5 (a^4 - 30*a^3 + 150*a^2 - 240*a + 120)/a^5
6 (-a^5 + 62*a^4 - 540*a^3 + 1560*a^2 - 1800*a + 720)/a^6

