# How to find $\sum_{n=1}^{\infty } n^{2} \frac{a^n}{(1+a)^{n+1}}$

How to find the sum ?

$$\sum_{n=1}^{\infty } n^{2} \frac{a^n}{(1+a)^{n+1}}$$

-

Let $f(x) = \displaystyle \sum_{n=0}^{\infty} x^n = \dfrac1{1-x}$, when $\vert x \vert <1$. Then $$f'(x) = \sum_{n=0}^{\infty} nx^{n-1} = \dfrac1{(1-x)^2}$$ $$g(x) = xf'(x) = \sum_{n=0}^{\infty} nx^{n} = \dfrac{x}{(1-x)^2}$$ $$g'(x) = \sum_{n=0}^{\infty} n^2x^{n-1} = \dfrac{1+x}{(1-x)^3}$$ $$xg'(x) = \sum_{n=0}^{\infty} n^2x^{n} = \dfrac{x(1+x)}{(1-x)^3}$$ Set $x = a/(1+a)$ to get that $$\sum_{n=0}^{\infty} n^2\dfrac{a^{n}}{(1+a)^n} = \dfrac{\dfrac{a}{1+a}\left(1+\dfrac{a}{1+a}\right)}{\left(1-\dfrac{a}{1+a}\right)^3}=(a+1)(2a^2+a)$$ So the final solution is $2a^2+a$