Sum of Arithmetic-Geometric Sequence

Theorem
Let $\left \langle{a_k}\right \rangle$ be an arithmetic-geometric progression defined as:
 * $a_k = \left({a + k d}\right) r^k$ for $k = 0, 1, 2, \ldots, n - 1$

Then its closed-form expression is:


 * $\displaystyle \sum_{k \mathop = 0}^{n - 1} \left({a + k d}\right) r^k = \frac {a \left({1 - r^n}\right)} {1 - r} + \frac {r d \left({1 - n r^{n - 1} + \left({n - 1}\right) r^n}\right)} {\left({1 - r}\right)^2}$