<s>[INST] Simple way to compute the finite sum $\sum\limits_{k=1}^{n-1}k\cdot x^k$ I'm looking for an elementary method for computing a finite geometric-like sum,
$$\sum_{k=1}^{n-1} k\cdot3^k$$
I have a calculus-based solution: As a more general result, I replace $3$ with $x$ and denote the sum by $f(x)$. Then
$$f(x) = \sum_{k=1}^{n-1} k\cdot x^k = x\sum_{k=1}^{n-1}k\cdot x^{k-1} = x\frac{\mathrm d}{\mathrm dx}\left[\sum_{k=1}^{n-1}x^k + C\right]$$
for some constant $C$. I know that
$$\sum_{k=1}^{n-1}x^k = \frac{x-x^n}{1-x}$$
so it follows that
$$\begin{align}
f(x) &= x\frac{\mathrm d}{\mathrm dx}\left[\frac{x-x^n}{1-x}+C\right] \\[1ex]
&= x\cdot\frac{(1-x)\left(1-nx^{n-1}\right) + x-x^n}{(1-x)^2} \\[1ex]
&= \frac{x-nx^n(1-x)-x^{n+1}}{(1-x)^2}
\end{align}$$
which means the sum I started with is
$$\sum_{k=1}^{n-1}k\cdot3^k = \frac{3+2n\cdot3^n-3^{n+1}}4$$
I am aware of but not particularly adept with summation by parts, and I was wondering if there was another perhaps simpler method I can employ to get the same result?
 [/INST] Let $$S=\sum_{k=1}^{n-1} k\cdot3^k$$
Then $$3S=\sum_{k=1}^{n-1} k\cdot3^{k+1}$$
Subtracting , we get $$2S=\sum_{k=1}^{n-1} k\cdot3^{k+1}-\sum_{k=1}^{n-1} k\cdot3^k$$
$$2S=(1.3^2+2.3^3+3.3^4+\cdots+(n-1)3^n)-(3+2\cdot3^2 + 3\cdot3^3+\cdots+(n-1)3^{n-1})$$
$$-2S=(3+2\cdot3^2+3\cdot3^3+\cdots+(n-1)3^{n-1})-(1\cdot3^2 + 2\cdot3^3 + 3\cdot3^4+\cdots+(n-1)3^n))$$
$$-2S=3+(2-1)3^2+(3-2)3^3+\cdots+((n-1)-(n-2))3^{n-1})-(n-1)3^n$$
$$-2S=3+3^2+3^3+3^4+\cdots+3^{n-1}-(n-1)3^n$$
$$2S=(n-1)3^n-3\frac{3^{n-1}-1}{3-1}$$
$$2S=(n-1)3^n-\frac{3}{2}({3^{n-1}-1})$$
$$S=\frac{2(n-1)3^n-3({3^{n-1}-1})}{4}$$
This type of series is called $\text{ Arithmetico-Geometric Series }$ https://en.wikipedia.org/wiki/Arithmetico%E2%80%93geometric_sequence
</s>