Calculate $\sum_{n=0}^\infty(n+2)x^n$ I am trying to calculate   $\sum_{n=0}^\infty(n+2)x^n$.
I was thinking it is like the second derivative of $x^{n+2}/(n+1)$ but I am not sure how to go about calculating it. Any hints?
 A: Hint. You are on the right track, one may recall that
$$
\sum_{n=0}^\infty\frac{x^{n+2}}{n+1}=-x\ln(1-x),\quad |x|<1.
$$ Then differentiate termwise twice.
A: $$\sum_{n=0}^{\infty}(n+2)x^n=\sum_{n=0}^{\infty}nx^n+2\sum_{n=0}^{\infty}x^n$$
we know $$\sum_{n=0}^Nnx^n=-\frac{x(x^N-1)}{(x-1)^2}+\frac{Nx^{N+1}}{x-1}$$ and $$\sum_{n=0}^Nx^n=\frac {1-x^{N+1}}{1-x}$$
When $x\lt 1$ and $N \to \infty$ $$\sum_{n=0}^{\infty}(n+2)x^n=\frac{x}{(x-1)^2}+2\frac {1}{1-x}=\frac{2-x}{(x-1)^2}$$
A: Hint: It is sometimes convenient to work with operators. Since
\begin{align*}
\left(x\frac{d}{dx}\right)\sum_{n=0}^\infty a_nx^n=x\sum_{n=0}^\infty na_nx^{n-1}=\sum_{n=0}^\infty na_nx^{n}
\end{align*}
we consider $xD:=\left(x\frac{d}{dx}\right)$ as operator and obtain for $k\geq 0$
\begin{align*}
\left(xD\right)^k\sum_{n=0}^{\infty}a_nx^n=\sum_{n=0}^\infty n^ka_nx^{n}
\end{align*}

We conclude
  \begin{align*}
\sum_{n=0}^{\infty}(n+2)x^n&=\left(xD+2\right)\sum_{n=0}^{\infty}x^n\\
&=\left(xD+2\right)\frac{1}{1-x}\\
&=x\left(\frac{1}{1-x}\right)^\prime+\frac{2}{1-x}\\
&=\ldots
\end{align*}

