Find a closed form of the series $\sum_{n=0}^{\infty} n^2x^n$
Solution 1:
$\displaystyle \frac{1}{1-x} = \sum_{n=0}^{\infty}x^n$
Differentiating (and multiplying with $x$)we have,
$\displaystyle \frac{x}{(1-x)^2}=\sum_{n=0}^{\infty}nx^n$
Differentiating(and multiplying with $x$) we have,
$\displaystyle \frac{[(1-x)^2(1)-(x)2(1-x)(-1)]x}{(1-x)^4}= \frac{x^2+x}{(1-x)^3}= \sum_{n=0}^{\infty}n^2x^n$
Solution 2:
there is a wrong sign in the first differentiation. I'd say:
$\displaystyle \frac{1}{1-x} = \sum_{n=0}^{\infty}x^n$
Differentiating (and multiplying with $x$)we have,
$\displaystyle \frac{x}{(1-x)^2}=\sum_{n=0}^{\infty}nx^n$
Differentiating(and multiplying with $x$) we have,
$\displaystyle \frac{x(1+x)}{(1-x)^3}=\sum_{n=0}^{\infty}n^2x^n$
Solution 3:
We can write any monomial, or polynomial in $n$, as a falling factorial polynomial using Stirling numbers of the second kind or this simple algorithm.
After we can use the following identities of finite calculus
$$\Delta_n n^\underline m=(n+1)^\underline m- n^\underline m=m n^\underline{m-1},\quad \sum n^\underline m\delta n=\frac{n^\underline{m+1}}{m+1}+C\tag{1}$$
$$\Delta_n x^n=(x-1)x^n,\quad\sum x^n\delta n=\frac{x^n}{x-1}+C\tag{2}$$
$$\sum f(n)\Delta_n g(n)\delta n=f(n)g(n)-\sum \Delta_n f(n)\mathrm E_n g(n)\delta n\tag{3}$$
$$\sum_{n=0}^h f(n)=\sum\nolimits_0^{h+1} f(n)\delta n\tag{4}$$
where $\mathrm E_n g(n):=g(n+1)$ is the shift operator and $C$ is any $1$-periodic function. This case is particularly easy, we have that $n^2=n^\underline 2+n^\underline 1$, hence
$$\sum n^2 x^n\delta n=\sum n^\underline 2 x^n\delta n+\sum n^\underline 1 x^n\delta n=\frac{n^\underline 2x^n}{x-1}-\frac2{x-1}\sum n^\underline 1x^{n+1}\delta n+\sum n^\underline 1 x^n\delta n+C=\\=\frac{n^\underline 2x^n}{x-1}+\left(1-\frac{2x}{x-1}\right)\left(\frac{n^\underline1 x^n}{x-1}-\frac1{x-1}\sum x^{n+1}\delta n\right)+C=\\=\frac{n^\underline 2x^n}{x-1}-\frac{x+1}{(x-1)^3}\left((n+1)x^{n+1}-nx^n\right)+C$$
Then for $|x|<1$ from above we have that
$$\sum_{n=0}^\infty n^2x^n=\sum\nolimits_0^\infty n^2x^n\delta n=\frac{(x+1)x}{(x-1)^3}$$