Proof that the trigonometric functions form a basis for $L^2[0, 2\pi]$ My math teacher has recently talked about the Fourier series; any periodic function can be written as a sum of trigonometric functions. That's cool and stuff, but he didn't prove it. We only derived a "formula" for the coefficients and without proof, I will feel unsatisfied. I started to dig around the internet and found stuff about Hilbert spaces, Schauder bases and $L^2$ spaces (which is a Hilbert space). I then read that the set $\{\sin(nx), \cos(nx)\}_{n \in \mathbb{N}}$ is a Schauder basis for the space $L^p[0, 2 \pi]$ and, if I have not misunderstood, will prove the thing that I want to prove. I also read about orthonormal spaces and their connection to Hilbert spaces. So in this case I want to see proof that the set of trigonometric functions form an orthonormal basis for $L^2[0, 2\pi]$. The orthogonal part is quite easy and I have searched for proof of the rest for a while and I can't find anything. Maybe some kind person will give me proof of this? However, I don't know how complicated that proof actually is and considering that I have almost no knowledge in this field, a handwavy argument would satisfy me. If not that, then at least guidance. For example, what I need to learn to understand the proof etc.
 A: Look at the operator
$$
               Lf = \frac{1}{i}\frac{d}{dx}
$$
on the domain $\mathcal{D}(L)$ of absolutely continuous functions $f \in L^2[0,2\pi]$ for which $f' \in L^2[0,2\pi]$ and $f(0)=f(2\pi)$. This operator is self-adjoint. The operator $R(\lambda)=(\lambda I-L)^{-1}$ exists for all $\lambda\ne 0,\pm 1,\pm 2,\cdots$, and is given by
$$
             R(\lambda)f=\frac{e^{i\lambda x}}{1-e^{-2\pi i\lambda}}\int_0^{2\pi}ie^{-i\lambda t}g(t)dt-e^{i\lambda x}\int_0^xie^{-i\lambda t}g(t)dt,\;\;\; \lambda\notin\mathbb{Z}.
$$
The operator $R(\lambda)$ can be found by directly solving the ODE corresponding to $(\lambda I-L)g=f$ for $g$. $R(\lambda)$ has isolated poles at $0,\pm 1,\pm 2,\cdots$, and the residue of $R(\lambda)f$ at an integer $n$ is given by
$$
          R_{n}f= \lim_{\lambda\rightarrow n}(\lambda-n)R(\lambda)f=\frac{1}{2\pi}\int_0^{2\pi} e^{-int}f(t)dt\cdot e^{inx}=\langle f,e^{inx}\rangle e^{inx}.
$$
This is the one-dimensional projection of $f$ onto the eigenfunction $e^{inx}$. The task of showing $f=\sum_{n=-\infty}^{\infty}\langle f,e^{inx}\rangle e^{inx}$ is reduced to a problem of showing that the sum of the residues of $\lambda\mapsto R(\lambda)f$ in the finite plane is equal to the single "residue" of $R(\lambda)f$ at $\infty$, which is
$$
       \lim_{\lambda\rightarrow i\infty}\lambda(\lambda I-L)^{-1}f=f.
$$
It is a delicate matter to prove such a thing, but it is true in general, and the result can be used to prove the Plancherel theorem for the Fourier transform, as well as the Parseval identity for the Fourier series, and a more general result for self-adjoint operators with mixed discrete and continuous spectrum.
