I read that the operator $T= -i \frac{d}{dx}$ on the Hilbert space $H_l = L^2([-l,l], (2l)^{-1}m)$, where $m$ is the normalized Lebesgue measure, can be defined as follows. Take the orthonormal basis for $H_l$ given by $(e^{\frac{\pi kx}{l}})_{k \in \mathbb{Z}}$. Then $T$ can be defined as the closure of the restriction of $T$ to this orthonormal basis. I am having trouble seeing this equivalence rigorously. I see that this definition of $T$ is densely defined on $H_l$. (Ultimately, I want $T$ to be a densely defined operator on $H_l$ that is essentially self-adjoint.)
Since an operator is self-adjoint if it is symmetric and densely defined, I think that one should consider functions $f$ on $[-l,l]$ that are smooth and have periodic boundary conditions. So, are the two definitions of $T$ equivalent because they are weakly equivalent? If this is not the reason, then why can $T$ be written as the closure of the restriction of $-i \frac{d}{dx}$ to this orthonormal basis of $H_l$?