Evaluating a formula as the denominator goes to $0$

I came across a theroem which says that if $S=(ar^{n-1}-a)/(r-1)$ when $r \neq 1$ then $S=(n+1)a$ if $r=1$. But for $r=1$ the above equation isn't well-defined. How do they come to this result?

-
Have a look at De l'Hôpital's Theorem. – Lord_Farin Oct 24 '12 at 14:04
It should be $S=(n-1)a,$ or $S=(ar^{n+1}-a)/(r-1)$. – Kevin Carlson Oct 24 '12 at 15:06

Be careful: we understand what you mean, but you wrote a rather arbitrary thing. What is true is that $$\lim_{r \to 1} \frac{ar^{n+1}-a}{r-1}=(n+1)a, \tag{1}$$ but $S$ is undefined at $r=1$. The limit (1) is simply $a$ times the derivative of $r \mapsto r^{n+1}$ at $r=1$.
@F'OlaYinka ... but you need a different proof of the formula $\frac{d}{dr}r^{n+1}=(n+1)r^n$ :-) – Siminore Oct 24 '12 at 14:29
This is the formula for a geometric progression. When $r\neq 1$, the sequence is $a,ar,ar^2,...$ so that the sum of the first $n$ terms is $\frac{a(r^n-1)}{r-1}$. When $r=1$, the sequence is $a,a,a,...$ so that the sum of the first $n$ terms is $na$.