Sum of Arithmetic-Geometric Sequence

Theorem
Let $\sequence {a_k}$ be an arithmetic-geometric sequence defined as:
 * $a_k = \paren {a + k d} r^k$ for $k = 0, 1, 2, \ldots, n - 1$

Then its closed-form expression is:


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