DFT of a complex sinusoid I'm attending this course (Coursera: Audio Signal Processing for Music Applications) in which the professor derives a general equation for Discrete Fourier Transform (DFT) for a complex sinusoid. The following is the screenshot of the slide he used:



While the derivation is totally fine, I'm having trouble understanding the concluding statement 


  if $k \neq k_0, denominator \neq 0$ &amp; $numerator = 0$
  thus $ X_1[k]=N$ for $k=k_0$ &amp; $X_1[k]=0$ for $k \neq k_0$


I did try value substitution and all, but all that can't seem to justify the statement. My understanding is that if $k=k_0$, both the numerator and the denominator would be zero and there would be no way the result is $N$ and I have no clue about the first part of the statement either. Or I'm missing something here (or forgotten some basic school math here). What's going on here?
The last expression (sum of  a geometric series) is a common abuse of notations: it should have been:


$N$ if $k= k_0$
$f(r)=\frac{1-r^N}{1-r}$ with $r=e^{-j 2\pi(k-k_0)/N}$ if $k\neq k_0$


Indeed, as you correctly remarked, numerator and denominator would vanish for $r=1$ (or $k= k_0$), so the fraction is not "theoretically" defined. However, it is consistent to the limit, as $f(r)\to N$ as $r\to 1$  since $e^{-j 2\pi(k-k_0)/N}\to 1$ when $k \to k_0$ (allowing real $k$).

Mathematically, the fraction gives one single expression, defined by continuity at $k= k_0$. It is a bit like saying that $\frac{r^2-1}{r-1}$, not defined at $r=1$, is in some way equivalent  to $r+1$ (using $r^2-1=(r-1)(r+1)$  and wrongfully simplifying the fraction. This is not correct, but makes sense.