n=2(nx^n)
S=2(x+2x^2+3x^3+……+nx^n)
xS=2[x^2+2x^3+3x^4+……+nx^(n+1)]
(1-x)S=2[x+x^2+x^3+……+x^n-nx^(n+1)]
=2(x-x^n)/(1-x)-2nx^(n+1)
=>S=2(x-x^n)/(1-x)^2-2nx^(n+1)/(1-x)
n=2(nx^n)
S=2(x+2x^2+3x^3+……+nx^n)
xS=2[x^2+2x^3+3x^4+……+nx^(n+1)]
(1-x)S=2[x+x^2+x^3+……+x^n-nx^(n+1)]
=2(x-x^n)/(1-x)-2nx^(n+1)
=>S=2(x-x^n)/(1-x)^2-2nx^(n+1)/(1-x)