# Find a closed form of the series $\sum_{n=0}^{\infty} n^2x^n$

The question I've been given is this:

Using both sides of this equation:

$$\frac{1}{1-x} = \sum_{n=0}^{\infty}x^n$$

Find an expression for $$\sum_{n=0}^{\infty} n^2x^n$$ Then use that to find an expression for $$\sum_{n=0}^{\infty}\frac{n^2}{2^n}$$

This is as close as I've gotten:

\begin{align*} \frac{1}{1-x} & = \sum_{n=0}^{\infty} x^n \\ \frac{-2}{(x-1)^3} & = \frac{d^2}{dx^2} \sum_{n=0}^{\infty} x^n \\ \frac{-2}{(x-1)^3} & = \sum_{n=2}^{\infty} n(n-1)x^{n-2} \\ \frac{-2x(x+1)}{(x-1)^3} & = \sum_{n=0}^{\infty} n(n-1)\frac{x^n}{x}(x+1) \\ \frac{-2x(x+1)}{(x-1)^3} & = \sum_{n=0}^{\infty} (n^2x + n^2 - nx - n)\frac{x^n}{x} \\ \frac{-2x(x+1)}{(x-1)^3} & = \sum_{n=0}^{\infty} n^2x^n + n^2\frac{x^n}{x} - nx^n - n\frac{x^n}{x} \\ \end{align*}

Any help is appreciated, thanks :)

$\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$

• Awesome, what about the index of summation though? Doesn't it increase by one per each differentiation? Mar 23, 2013 at 16:20
• @snario: It isn't needful to increase the index. When $n=0$, then $nx^n$ vanishes, so while we might not need to include it in the sum, it is still useful to do so here. Likewise with $n^2x^n$ when $n=0$. Mar 23, 2013 at 16:38
• I agree that for the first derivative it isn't important, but for the second derivative we would have gone from $n = 1$ to $n = 2$, so we're including a $(1)^2x^{(1)} = x$ in our sum. I agree that this is the correct answer, but I don't see why the $n = 1$ case isn't important Mar 23, 2013 at 16:49
• I suggest that you check it yourself by writing the first few terms explicitly . You will understand the reason @snario Mar 23, 2013 at 16:52

$\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$

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

\begin{align*} \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}{(1-x)^3}(nx^n(x-1)-x^{n+1})+C\tag5 \end{align*}

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}{(1-x)^3}\tag6$$

Hint: $n^2=n(n-1)+n$ and $x^2 x^{n-2}=x^n$.

It is Eulerian polynomials: $$\sum\limits_{{\rm{n = }}0}^\infty {{x^n}{n^M} = {{x{A_M}(x)} \over {{{(1 - x)}^{M + 1}}}}} ,{A_M}(x) = \sum\limits_{k = 0}^M {\left\langle {_k^M} \right\rangle } {x^k},\left\langle {_k^M} \right\rangle \,\,is{\kern 1pt} {\kern 1pt} Eulerian{\kern 1pt} {\kern 1pt} {\kern 1pt} number$$ Other expressions are： $${A_M}(x) = {x^{ - 1}}\sum\limits_{k = 0}^M {{{(1 - x)}^{M - k}}{x^k}{S_2}} (M,k)k! = \sum\limits_{k = 0}^M {{{(x - 1)}^{M - k}}{S_2}} (M,k)k!$$ S2(M,k) is stirling number of the second kind. $${A_2}(x) = 1 + x$$

You've got $\sum_{n\geq 0} n(n-1)x^n$, modulo multiplication by $x^2$. Differentiate just once your initial power series and you'll be able to find $\sum_{n\geq 0} nx^n$. Then take the sum of $\sum_{n\geq 0} n(n-1)x^n$ and $\sum_{n\geq 0} nx^n$. What are the coefficients?