I am trying to derive the formula from continuous Fourier transform to discrete Fourier transform, however, I encountered a small problem. My derivations are the following.
For a periodic function $f(x)=f(x+a)$, the continuous Fourier transform read \begin{align} f(x) &= \sum_{n=-\infty}^{+\infty} c_n e^{i\frac{2\pi n}{a}x}\\ c_n &= \frac{1}{a} \int_0^a dx e^{-i\frac{2\pi n}{a}x}f(x) \end{align} In order to get the discrete Fourier tranform, I discretize the $x$-axis into $N$ pieces, and for the sampling $x$-points $x_j = \frac{a}{N}j$, they satisfy $f_j = f_{j+N}$, where I defined $f_j\equiv f(x_j)$. Therefore the first equation becomes \begin{equation} f_j = \sum_{n=-\infty}^{+\infty} c_n e^{i\frac{2\pi n}{a}x_j} = \sum_{n=-\infty}^{+\infty} c_n e^{i\frac{2\pi n}{N}j} \end{equation} and the second equation becomes \begin{equation} c_n = \frac{1}{a}\sum_{j=0}^{N-1} \frac{a}{N} e^{-i\frac{2\pi n}{a} j\frac{a}{N}} f_j = \frac{1}{N}\sum_{j=0}^{N-1} e^{-i\frac{2\pi n}{N}j} f_j \end{equation}
My question comes from in the third equation, the n-summation runs from $-\infty$ to $+\infty$ which differs from the standard DFT that from $0$ to $N-1$. What's wrong with my derivation? Thanks in advance.