I am trying to find the action associated with the Lagrangian density $$ \mathcal{L} = \frac{1}{2}\left( \frac{\partial\phi}{\partial x} \right)^2 + \frac{1}{2}m^2\phi^2. \tag{1} $$ I am supposed to use the discrete expansions $$\phi_j = \frac{1}{\sqrt{Na}}\sum_p \tilde{\phi}_pe^{ipja} = \frac{1}{\sqrt{Na}}\sum_{-p} \tilde{\phi}_{-p}e^{-ipja}. \tag{2} $$
So, first I find the Lagrangian, using
$$ L = \int dx \mathcal{L} = a \sum_j \mathcal{L} = \frac{a}{2}\sum_j \left[ \left( \frac{\phi_{j+1}-\phi_j}{a} \right)^2 + m^2\phi_j^2 \right] \tag{3} $$
where $j$ labels the 1D lattice sites and $a$ is the equilibrium distance between each site.
Now I plug in the expansion for $\phi_j$ into the Lagrangian, and where $\phi_j$ is squared, I use one copy of the middle ($+p$) term in eq (2) and one copy of the right ($-p$) term in eq (2), multiplied together. This is motivated by the form of the action I am supposed to get in the end.
When I do the substitution into $L$, I end up with
$$ L = \frac{1}{2} \sum_p \tilde{\phi_p}\tilde{\phi_{-p}}\left[ \frac{2}{a^2}\left( 1-\cos{pa} \right) +m^2 \right] \tag{4}. $$
Now to get the action, I know that $$ S = \int L dt, \tag{5}$$ but I have no idea where time is supposed to come into this problem at all. When integrating the Lagrangian density to get the Lagrangian, I know that I had to realize that the integral over one spatial dimension becomes, in the discrete case, a sum over the positions $x_j$ times the lattice constant $a$, or just a sum over $j$, again times $a$. In addition, the spatial derivative in the Lagrangian becomes a discrete difference, as I have shown above.
Furthermore, the expression that I obtained for the Lagrangian $L$ is exactly what my textbook says I should obtain for the action $S$! Is this somehow the result of the problem not having any obvious time-dependence? So, in total, I suppose I want to know how the action relates to the Lagrangian in the case of a problem that doesn't involve time.
Just for clarity, I am going to write the question as phrased in the textbook (QFT for the Gifted Amateur):
Exercise 17.5 (a): Consider a one-dimensional system with Lagrangian $$ \mathcal{L} = \frac{1}{2}\left( \frac{\partial \phi(x)}{\partial x} \right)^2 + \frac{m^2}{2} \left[ \phi(x) \right]^2. $$ The choice of sign makes this a Euclidean theory. Descretize this theory (that is, put it on a lattice) by defining $$ \phi_j = \frac{1}{\sqrt{Na}} \sum_p \tilde{\phi}_p e^{ipja}, $$ where $j$ labels the lattice site, $a$ is the lattice spacing, and $N$ is the number of lattice points. Using the method in exercise 17.3 show that the action may be written $$ S = \frac{1}{2} \sum_p \tilde{\phi}_{-p} \left( \frac{2}{a^2}-\frac{2}{a^2}\cos{pa} + m^2 \right) \tilde{\phi}_p, $$ and read off the propagator for this theory.
The "method in exercise 17.3" is just what I described in between eq (3) and eq (4), where you expand $\phi_j$ in terms of its Fourier transforms $\tilde{\phi}_p$ and $\tilde{\phi}_{-p}$. Problem 17.3 also is the one that shows that the free propagator is $\frac{i}{2}$ times the inverse of the quadratic term in the momentum-space action, which is why this problem is asking us to find the action in the first place.