For what sequences of real numbers $\left\{ k_{n}\right\}$ is the set of functions $\left\{ e^{ik_{n}x}\right\}$ a basis? It is well known that the set of functions $\left\{ e^{^{inx}}\right\}$, for integer $n$, is an othonormal basis for the space of square integrable real functions in the interval $[-\pi,\pi]$.
Now let $\left\{ k_{n}\right\}$ be a sequence of real numbers and consider the set of functions $\left\{ e^{ik_{n}x}\right\}$. For what sequences $\left\{ k_{n}\right\}$ do the functions $\left\{ e^{ik_{n}x}\right\}$ form a basis (not necessarily orthonormal) for the space of square integrable real functions in some interval (not necessarily $[-\pi,\pi]$)?
Thanks.
 A: The question originally asked about infinite intervals, but the functions $e^{ikx}$ aren't square integrable over infinite intervals, so they can't form a basis for $\mathcal L ^2(\mathbb R)$. The analogous object for infinite intervals is the Fourier transform.
For finite intervals, the key phrase to search for is nonharmonic fourier series. There are entire books dedicated solely to this subject, but one can start with the 1952 paper by Duffin & Schaefer. There they introduce the notion of a frame, which can be easier to work with than a basis.
Another topic to search for is nonuniform sampling. By inverting the roles of the time domain and frequency domain, one can show that your question is equivalent to "What sets of samples are sufficient to reconstruct a bandlimited function?". From an article on nonuniform sampling by Aldroubi and Gröchenig:

Kadec’s theorem states that if $X =
\{x_k ∈ \mathbb R : |x_k−k| \le L < 1/4\}$ for all $k \in \mathbb Z$, then the set $\{e^{ i 2 \pi x_k \xi}: k \in \mathbb Z\}$ is a Riesz basis of $\mathcal L^2(−1/2, 1/2)$.

(Kadec's original paper is in Russian.) Converting to your notation: the collection $\{e^{ i k_n x}: n \in \mathbb Z\}$ is a Riesz basis of $\mathcal L^2(−\pi, \pi)$ if for all $n \in \mathbb Z$, $|k_n-n|\le L <1/4$. In other words, if you perturb the frequencies slightly from the integers, you still get a basis. This isn't a necessary condition, but see the literature if you're interested in more general conditions.
A: For every $k\in\mathbb R$, let $e_k:x\mapsto \mathrm e^{\mathrm ikx}$. Let $C=\{e_k;k\in\mathbb R\}$. Fix a positive $T$ and consider the space $E$ of square integrable $T$-periodic functions. Let $K=2\pi\mathbb Z/T$ and $B=\{e_k;k\in K\}$. 
We know that $B$ is a basis of $E$. If $k\notin K$, $e_k$ is not $T$-periodic hence $e_k\notin E$. Thus a basis of $E$ cannot contain functions in $C\setminus B$. If $k\in K$, $e_k$ is not in the vector space spanned by $B\setminus\{e_k\}$ because $B$ is free. Finally the only basis of $E$ included in $C$ is $B$.
A: One generalization of Fourier series comes from Sturm Liouville theory.
This arises naturally in the study of PDEs. For example, consider a 1-D wave equation on a finite interval:
$$
\begin{eqnarray}
u_{tt}(x,t) &=& u_{xx}(x,t) \\
\forall t, \ \alpha_1 u(a,t) + \alpha_2 u_x(a,t)=0 & \quad \quad &
\forall t, \ \beta_1 u(b,t) + \beta_2 u_x(b,t) = 0\\
\forall x \in [a,b], \ u(x,0) = f(x) & \quad \quad &
\forall x \in [a,b], \ u_t(x,0) = g(x)
\end{eqnarray}
$$
One way to solve this is to look for a solution of the form $u(x,t) = \sum_{n=1}^\infty w_n(t) \phi_n(x)$ where $\phi_n(x)$ are the eigenmodes of the system. If we had periodic boundary conditions, then these would be the standard Fourier basis functions. It's important that the eigenmodes form a basis so that the initial conditions can be satisfied for all $f,g \in \mathcal L^2 (a,b)$.
To find the eigenmodes, you solve for nontrivial solutions to $y''=-\lambda y$ with the boundary conditions $\alpha_1 y(a)+ \alpha_2 y'(a)=0$, and $\beta_1 y(b)+ \beta_2 y'(b)=0$. These solutions are: $\mathcal B = \{c_n e^{i \sqrt{\lambda_n} x} + d_ne^{-i \sqrt{\lambda_n} x}\}_{n=1}^\infty$, where where $\lambda_n$ are the positive solutions to
$$
\tan((b-a)\sqrt{\lambda_n})=\frac{\sqrt{\lambda_n}(\alpha_1 \beta_2+\alpha_2 \beta_1)}{\lambda_n \alpha_2 \beta_2-\alpha_1 \beta_1}.
$$
For general boundary conditions there's no closed-form solution for $\lambda_n$ other than the above implicit definition. (There are formulas for $c_n$ and $d_n$, but I'm omitting them.) Then by the Sturm Liouville theorem, the set $\mathcal B$ is an orthonormal basis for $\mathcal{L}^2(a,b)$.
In the basic case, $\alpha_1=\beta_1=1,$ $\ \alpha_2=\beta_2=0$, we get $\lambda_n = (n\pi/(b-a))^2$, and the orthonormal basis $\left\{ \sin\left(n \pi\frac{x-a}{b-a}\right)\right\}_{n=1}^\infty$. For the wave equation, this corresponds to the eigenmodes when the ends are held at $0$. 
Admittedly, this isn't the same thing as the collection $\mathcal{\tilde{B}}=\{e^{\pm i \sqrt{\lambda_n}x}\}_{n=1}^\infty$ being a basis, but it does show that $\mathcal{\tilde{B}}$ spans $\mathcal{L}^2(a,b)$.
