<s>[INST] Calculating $\sum_{n=0}^{\infty} {\frac{(2n+1)(n+1)}{3^n}}$ I had this problem on my recent exam and i got 0 points for my solution and I'd really like to know why :) 

Calculate $$\sum_{n=0}^{\infty} {\frac{(2n+1)(n+1)}{3^n}}$$

My attempt:
Let us consider the following series:
 $$\sum_{n=0}^{\infty} {\frac{(2n+1)(n+1)}{3^n}x^n}=\sum_{n=0}^{\infty} {\frac{(2n^2+3n+1)}{3^n}x^n}
$$
$$
\sum_{n=0}^{\infty} {\frac{(2n^2+3n+1)}{3^n}x^n}==\sum_{n=0}^{\infty} {\frac{2n^2}{3^n}x^n} + \sum_{n=0}^{\infty} {\frac{3n}{3^n}x^n}+\sum_{n=0}^{\infty} {\frac{1}{3^n}x^n}
$$
All three series have the radius of convergence $R=3$. Let us transform these series as follows: 
$$
\sum_{n=0}^{\infty} {\frac{1}{3^n}x^n} = \sum_{n=0}^{\infty} {t^n}
$$
where $t=\frac{x}{3}$. This becomes:
$${\frac{1}{1-t}}$$
For $t=\frac{1}{3}$ this becomes $\frac{3}{2}$.
Using the same logic i transformed the remaining two series:
$$
\sum_{n=0}^{\infty} {\frac{3n}{3^n}x^n} = 3\sum_{n=0}^{\infty} n{t^n}= 3t\sum_{n=0}^{\infty} n{t^{n-1}}=3t \bigg( \sum_{n=0}^{\infty} {t^n} \bigg)'=3t \bigg( {\frac{1}{1-t}} \bigg)'={\frac{3t}{(1-t)^2}}
$$
Plugging in $t=\frac{1}{3}$ gives $\frac{9}{4}$
Doing the same for the remaining series gives me $3$ ( using the same method and derivating twice ) . Hence 
$$\frac{3}{2} + \frac{9}{4}+3 = \frac{27}{4}$$
What is wrong with my method? I got no real explanation, even though the result is the same as the one Wolfram Alpha gave me. Is this mere coincidence that my result is correct ?
 [/INST] Your solution is correct, and it seems wrong to give you $0$ points for it. However, there are two things to improve if you want. One is that introducing both $x$ and $t$ was wasteful; you could have just considered $\sum_n(2n+1)(n+1)x^n$ and substituted $1/3$ for $x$. The other is that you somewhat unnecessarily multiplied out the nice product and then had to juggle a lot of different terms with different orders of derivatives. The more elegant solution would be
$$
\sum_{n=0}^\infty\frac{(2n+1)(n+1)}{3^n}=\frac12\sum_{n=0}^\infty(2n+1)(2n+2)\left(3^{-1/2}\right)^{2n}
$$
with
\begin{align}
\frac12\sum_{n=0}^\infty(2n+1)(2n+2)x^{2n}&=\frac12\frac{\mathrm d^2}{\mathrm dx^2}\sum_{n=0}^\infty x^{2n+2}\\
&=\frac12\frac{\mathrm d^2}{\mathrm dx^2}\frac{x^2}{1-x^2}\\
&=\frac{1+3x^2}{(1-x^2)^3}\;,
\end{align}
whereupon substituting $x=3^{-1/2}$ yields your result.
</s>