$$S=1.P+2.P^2+3.P^3\cdots +(N-1)P^{N-1}+N.P^N$$
Now $$S.P=1.P^2+2.P^3\cdots+(N-1)P^N+(N+1)P^{N+1}$$
So $$S-SP=P+P^2+P^3+\cdots+P^N+(N+1)P^{N+1}$$
Which implies $$S(1-P)=\frac{P(1-P^N)}{1-P}+(N+1)P^{N+1}$$
Now simplify to get the value of $S$