let
S = 1.x^0+2.x^1+...+n.x^(n-1) (1)
xS = 1.x^1+2.x^2+...+n.x^n (2)
(1)-(2)
(1-x)S = [1+x+x^2+...+x^(n-1)]-n.x^n
= (1-x^n)/(x-1) - nx^n
S = [1/(1-x)] [(1-x^n)/(x-1) - nx^n]
let
S = 1.x^0+2.x^1+...+n.x^(n-1) (1)
xS = 1.x^1+2.x^2+...+n.x^n (2)
(1)-(2)
(1-x)S = [1+x+x^2+...+x^(n-1)]-n.x^n
= (1-x^n)/(x-1) - nx^n
S = [1/(1-x)] [(1-x^n)/(x-1) - nx^n]