Finding the sum of $1+4k+9k^2+...+n^2k^{n-1}$
Solution 1:
Hint
In one hand, $$S_n(x)=\sum_{k=1}^nkx^k=x\cdot \frac{d}{dx}\sum_{k=0}^nx^k.$$
Finally, $$\text{Your sum}=\frac{d}{dx}S_n(x).$$
Solution 2:
Surb’s method is much cleaner, but you can also use the method used to find the sum of geometric series to solve this.
\begin{align} v &= \sum_{k=1}^nk^2x^{k-1} \\ v-vx &= -n^2x^n+\sum_{k=0}^{n-1}(2k+1)x^k \\ &= -n^2x^n+2\sum_{k=0}^{n-1}kx^k+\sum_{k=0}^{n-1}x^k \end{align}
At which point solving for $v$ should be pretty easy (the same method can solve $\sum_{k=0}^{n-1}kx^k$ if you want to use it).