TITLE: Integral approximation of Fourier series.
QUESTION [7 upvotes]: Consider a function $f$ defined on the real line. Consider the restriction of the function to the interval $[-L,L]$ and periodically extend the function using a Fourier series
$$f_L(x) = \sum_{n=-\infty}^\infty \hat{f}(k_n)e^{ik_nx}$$
where $k_n=\pi n/L$ and where $\hat{f}(k_n)$ denotes the Fourier coefficient. For sufficiently large $L$, it seems plausible that we may approximate the Fourier series with an integral. In particular, let us extend $\hat{f}(k_n)$ to non-integral values through
$$\hat{f}(k)=\frac{1}{2L}\int_{-L}^L f_L(x)\,e^{-ikx}\ dx $$
and write the approximation as
$$\tilde{f}_L(x)=\frac{2L}{(2\pi)}\int_{-\infty}^\infty\hat{f}(k)\,e^{ikx}\ dk$$
To provide a bit of context, I first encountered such integral approximations when studying cosmology. It seems common in physics to take such approximations where we formally make the replacement
$$\sum_{n=-\infty}^\infty \longrightarrow \frac{2L}{(2\pi)}\int_{-\infty}^\infty$$
in the limit of large $L$, which is called the continuum limit. 
My question is under what conditions is such an approximation valid? What kind of smoothness and regularity conditions need to be placed on $f$? How well does $\tilde{f}$ approximate $f$ on $[-L,L]$ (for sufficiently large $L$)? Are there any error bounds?

REPLY [7 votes]: I claim that $\tilde f_L$ is in fact equal to $f$ on $(-L,L)$, and equal to $0$ outside $[-L,L]$.
To see this, we write
$$
\hat{f}(k)
=\frac{1}{2L}\int_{-L}^L f_L(x)\,e^{-ikx}\ dx 
=\frac{1}{2L}\int_{-\infty}^\infty \chi_L(x)f(x)\,e^{-ikx}\ dx,
$$
where 
$$
\chi_L(x) = 
\begin{cases}
1,&|x|<L,\\
0,&\textrm{otherwise},
\end{cases}
$$
is the characteristic function of the interval $(-L,L)$.
We substitute it into the formula for $\tilde f_L$, to get
$$
\tilde f_L(x)
=\frac{1}{2\pi}\int_{-\infty}^\infty \int_{-\infty}^\infty \chi_L(y)f(y)\,e^{-iky}e^{ikx}\ dy \ dx.
$$
This is just the Fourier inversion formula for the function $\chi_Lf$, which means that $\tilde f_L=\chi_Lf$.
Possible assumptions that make this true are very mild. For instance, it is true if $f$ is locally integrable, i.e., $f\in L^1_{\mathrm{loc}}(\mathbb{R})$. Under this assumption, of course, the equality $\tilde f_L=\chi_Lf$ must be treated in the $L^1$ sense.