Symmetric and self-adjoint unbounded operator I'm using the definitions here: Distinguishing between symmetric, Hermitian and self-adjoint operators.
Let $\mathcal{D}(D) = \{ (x_n)_n \in \ell^2 : \sum_{n} n^2|x_n|^2 < \infty \}$.
Let $D: \mathcal{D}(D) \rightarrow \ell^2$ be the diagonal operator $De_n=ne_n$.
Show is symmetric. Is $D$ self-adjoint?
My attempt:
To show it's symmetric, we want to show that $\langle x, Dy \rangle = \langle Dx, y \rangle$.
We have $\langle D^* e_n, e_m \rangle = \langle e_n, De_m \rangle = \langle e_n, n e_m \rangle = \bar{n} \delta_{mn} = n \delta{mn}$.
Now the definitions are messing me up.. I'm not sure if I'm proving that it's symmetric or self-adjoint...
Thank you for your help!
 A: The difference is where you are testing your operator.
To see that an operator is symmetric, you proceed as you did and show that given two generic elements of your domain $x,\ y\in\mathcal D\left(D\right)$ you have that $ \langle x, Dy\rangle= \langle Dx,y\rangle $ (with the same $ D $!).
On the other hand, the concept of self-adjoint goes hand in hand with the concept of adjoint; if you have that $ D^* $ is the adjoint of $ D $, then self-adjoint means only that as operators $ D $ and $ D^* $ coincide, i.e., their domains are equal and the action on the domains are equal.
So we are reduced to understand what the adjoint of an operator $ D $ is. To do so, you first assume that your operator $ D $ is densily defined (which is your case) and define the domain
$$
\mathcal D\left(D^*\right):=\left\{x\in\ell^2|\ \exists C\mbox{ s.t. }\left|\langle x,Dy\rangle\right|\le C\left\|y\right\| \forall y\in \mathcal D\left(D\right)\right\}.
$$
Then, for any element in $ \mathcal D\left(D^*\right) $ the mapping $ y\mapsto\langle x,Dy\rangle $ is define on a dense of your Hilbert space $ \ell^2 $ and it is bounded, so it can be extended to an element of the dual, and therefore, via Riesz representation theorem there is a unique element of your space $ z $ such that $ \langle x,Dy\rangle=\langle z,y\rangle $ for any $ y\in\mathcal D\left(D\right) $. By definition, $ D^*x:=z $.
Getting to the exercise. As you noticed, $ \langle e_n, De_m\rangle=n\delta_{nm}=\langle De_n, e_m\rangle $, therefore, given $ x,\ y\in\ell^2 $ we have
\begin{align}
\langle x,D y\rangle
&=\langle\sum_{n\in\mathbb N}x_ne_n,D\sum_{m\in\mathbb N}y_me_m\rangle
=\sum_{n\in\mathbb N}\sum_{m\in\mathbb N}x_n y_m\langle e_n,De_m\rangle
\\
&
=\sum_{n\in\mathbb N}\sum_{m\in\mathbb N}x_n y_mm\delta_{nm}
=\sum_{n\in\mathbb N}\sum_{m\in\mathbb N}x_n y_mn\delta_{nm}
=\langle Dx,y\rangle,
\end{align}
and $ D $ is symmetric.
Now I will show you that $ \mathcal D\left(D^*\right)=\mathcal D\left(D\right) $. The inclusion $ \supseteq $ is trivial, so let's show the other inclusion. Let $ x $ be in $ \mathcal D\left(D^*\right) $. Consider the sequence of elements $ y(k) $ of $ \mathcal D\left(D\right) $ (a sequence of sequences) defined as
$$
y(k)=\sum_{n=0}^k\frac{nx_n}{\left\|\sum_{n=0}^knx_ne_n\right\|}e_n.
$$
With this definition $ \|y(k)\|=1 $ and $ y(k)\in\mathcal D\left(D\right) $ trivially, given that it is a finite sequence. Therefore we get that, given that $ x\in\mathcal D\left(D\right) $, there exists a constant $ C $ such that
\begin{align}
C=C\left\|y(k)\right\|&\ge\left|\langle x,Dy\left(k\right)\rangle\right|
=\left|\sum_{n\in\mathbb N}\overline{x_n}ny(k)_n\right|
=\frac1{\left\|\sum_{n=0}^knx_ne_n\right\|}\left|\sum_{n=0}^kn^2\left|x_n\right|^2\right|
\\
&=\left(\sum_{n=0}^kn^2\left|x_n\right|^2\right)^\frac12.
\end{align}
It follows immediately that we can send $ k $ to infinity and get that the series in the last term is convergent and $ x\in\mathcal D\left(D\right) $ and the two domains coincide.
Finally is an exercise of dialectic to prove that now the actions of $ D $ and $ D^* $ coincide on their (common) domain. Indeed let $ x,y\in\mathcal D\left(D\right)=\mathcal D\left(D^*\right) $, by definition of $ D^* $ and using the symmetry we get
\begin{align}
\langle x,D^* y\rangle
=\langle Dx,y\rangle
=\langle x,D y\rangle.
\end{align}
Given that the domain of $ D $ is dense, this implies $ D^*y=Dy $ for every y in the domain, and therefore $ D=D^* $. Hence, $ D $ is also self-adjoint.
