I'm currently learning the [prove of sum of geometric series](https://www.khanacademy.org/math/integral-calculus/ic-series/ic-series-proofs/v/infinite-geometric-series) on Khan Academy. 

I understand the behaviour of the function when $|r| > 1$, when $|r| < 1$, when $r = 0$ and when $r = -1$, but I am a bit confused by its behaviour when $r = 1$. 

[![enter image description here](https://i.stack.imgur.com/2SL6M.png)](https://i.stack.imgur.com/2SL6M.png)

The narrator said that when $r = 1$, the limit function is undefined because the denominator of the limit function would be $0$, and the behaviour of the limit function is UNDEFINED, which I do understand. 

My confusion arises when I tried to substitute $r = 1$ into the original function for sum of geometric series,

[![enter image description here](https://i.stack.imgur.com/eyvkV.png)](https://i.stack.imgur.com/eyvkV.png)

if $r = 1$, then every term would equal to a, and the sum of the geometric series would approach infinity, so its behaviour is DEFINED.

So when $r = 1$, behaviour of sum function is DEFINED, but behaviour of limit function is UNDEFINED, but sum function also equal to limit function?!

This is causing me so much confusion.