Im reading "Condensed Matter Field Theory" by Atland and Simons. I have a fairly simple question. They are talking about a 1d chain of $N$ atoms, the Lagrangian for this system is straight forward: $$ L = \sum_{n=1}^{N} (\frac{m}{2}\dot{\phi}_n^2 - \frac{k_s}{2}(\phi_{n+1} - \phi_n)^2) $$ where $\phi_n$ is simply the displacement from equilibrium. He argues that iff $\phi_{n+1}-\phi_n << a \,\,\forall n$, where $a$ is the lattice spacing then: $$ \mathcal{L} = (\frac{m}{2}\dot{\phi}(x,t) - \frac{k_sa}{2}(\partial_x \phi(x,t))^2). $$ I have the following problem:
With this continuum business, one also identifies the integral as usual: $$ \int_0^{L=NA} f(x) dx= \sum_{n=0}^N f(an)a $$ Say, you choose $f(x)=x^2$, where $x$ would be the stretching of the spring like in the Lagrangian. Suppose we choose to integrate between two points $A$ and $B=A+a$ such that in the discrete case $\phi_{A+1}-\phi_{A}=0$ i.e. no stretching, but in the continuum only the endpoints are under no stretching, in between the continuum "continuation" would yield a non zero value of the integral. If this is true, the continuum approximation is adding non existing potential energy to the system. Why is my reasoning wrong or why is it okay to use this approximation.
Tl;dr: I basically need a detailed step by step derivation of going from the discrete Lagrangian of a 1d atomic chain to its continuum Lagrangian density.