I am trying to apply the spectral theorem to the operator:
$$Lu = -\partial_x^2u + u $$
in $L^2([0,1])$ with domain $D(L)=\{u\in H^2([0,1]) s.t. \partial_xu(0)=\partial_xu(1)=0\}$.
I need to prove that $L$ is self-adjoint and compact. For the first point, denote $\langle \cdot,\cdot\rangle$ the standard inner product in $L^2$ and let $u,v\in D(L)$:
$$
\langle Lu,v\rangle = \int_0^1 (-\partial_x^2u)v + uv = \int_0^1 u(-\partial_x^2v) +uv = \langle u,Lv\rangle.
$$
Now for the compactness, I am no certain about my argument. Here is the definition of compact operator I have:
A bounded linear operator $K:X\rightarrow Y$ ($X,Y$ Banach spaces) is called compact if for any bounded sequence $(u_k)_k$ in $X$, there exists a subsequence such that $\bigl(Ku_{\phi(k)}\bigr)_k$ converges in $Y$.
In my case, $X=D(L)$ with the norm $\lVert u\rVert_{H^2}$, $Y=L^2([0,1])$. Thanks to the Reilich-Kondrachov theorem, the embedding $H^2([0,1])\subset L^2([0,1])$ is compact.
Then I use the fact that $L$ is continuous, i.e. $\forall u\in D(L)$:
$$
\lVert Lu\rVert_{L^2}^2=\int_0^1\lvert -\partial_x^2 u + u \rvert^2 \leq \lVert u \rVert^2_{H^2}
$$
to show that $\forall (u_k)_k$ bounded in $D(L)$, $\exists (u_{\phi(k)})_k$ converging in $L^2$ (compact embedding) and by continuity $Lu_{\phi(n)}$ converges in $L^2$.
Is my proof correct? In particular, I am always confused by which norm I should use at each step. Thank you.
Yes your proof is correct, let's just walk real quick through the steps and the norm you are using:
Remember to show the operator $L$ is compact you want to show that if $\{u_k\}_{k}$ is bounded in the domain (here $X$ which has the $H^2$ norm) then you want to show that within $\{Lu_k\}_k$ has a convergent subsequence, convergent in its own space which is $Y$ with the $L^2$ norm. Since as you said by the Reilich-Kondrachov theorem, the embedding $H^{2}([0,1])⊂L^{2}([0,1])$ is compact, then the boundedness of $\{u_k\}_k$ in the $H^2$ norm is sufficient to show that $\{Lu_k\}_k$ has a convergent subsequence in the $L^2$ norm, thus your operator $L$ is compact.