The position operator $X$ is defined as multiplication by $x$, i.e. $$(X\psi)(x):=x\psi(x).$$
We take the domain $D(X)\subset L^2(\mathbb R)$ for $X$, which we can take
$$D(X):=\{\psi \in L^2(\mathbb R), \int_{\mathbb{R}} x^2 |\psi(x)|^2 dx<\infty\}.$$
The momentum operator is defined as $$(P\psi)(x)=-i \nabla \psi(x),$$ and $$D(P):=\{\psi \in L^2(\mathbb{R}), \frac{d}{dx}\psi \in L^2(\mathbb{R})\}.$$
Finally, given an external potential $V: \mathbb{R} \to \mathbb{R}$, the corresponding multiplication is given by the map $$V:D(V)\subset L^2(\mathbb{R})\to L^2(\mathbb{R}), \; (V\psi)(x):=V(x)\psi(x).$$ We take $$D(V):= \{\psi \in L^2(\mathbb{R}), V\psi \in L^2(\mathbb{R})\}.$$
From this we have the Hamiltonian operator $H\psi(x,t):= -\Delta\psi(x,t) + V(x)\psi(x,t).$
A densely-defined operator on $L^2(\mathbb{R}^d)$ is a pair $(A,D(A))$ where the domain $D(A)$ is a dense linear subspace of $L^2(\mathbb{R}^d)$ and $A:D(A)\to L^2(\mathbb{R}^d)$ is a linear map.
We say that a densely-defined linear operator $A$ on $L^2(\mathbb{R})$ is symmetric if for all $f,g \in D(A),$ we have $$\langle Af, g\rangle = \langle f, Ag \rangle.$$
I am trying to prove that the operators $X,P, H$ are symmetric.
For this, I have shown that $\langle Af, g\rangle = \langle f,Ag \rangle$ for $A=X,P,H$ when $f,g$ are Schwartz functions.
Now I am trying to use the density argument to generalize this to all functions in the domain of the operators. However, I have several problems.
First, given $f_n \to f, g_n \to g$ in $L^2$, how can I show that $\lim_n \langle Af_n, g_n \rangle= \langle Af, g\rangle$?
Next, is it true that if $f_n \to f$ in $L^2$ then $Af_n \to Af$ in $L^2$ as well for each of these operators? I am not sure why this holds, but if it doesn't then it doesn't seem like I can use the above density argument, so I don't know how to prove these results.
I would greatly appreciate some help.
Edit.
So I believe this isn't a straightforward application of the density argument. But restricted in the calculations.
For $P$, we have $$\langle Pf,g\rangle = \int \overline{-i \frac{d}{dx}f(x)}g(x)dx = i\int \overline{\frac{d}{dx}f(x)}g(x)dx.$$ And I need to move the derivative over to $g$, and to do this I need integration by parts which gives $$=-i\int \overline{f(x)} \frac{dg(x)}{dx} dx+i\overline{f(x)} \frac{d}{dx}g(x)|_{-\infty}^\infty.$$ And to get rid of the boundary terms I need to take $f,g \in \mathcal{S}(\mathbb{R})$.
Similarly, for the operator $V$, we have $$\langle Hf,g\rangle = \int \overline{(-\frac{d^2}{dx^2}f(x)+V(x)f(x))} g(x)dx = \int -\frac{d^2}{dx^2}\overline{f(x)}g(x)+V(x)\overline{f(x)}g(x)dx.$$
Now because $V$ is real valued, and we assume $Vf, Vg$ are in $L^2$, the right integral just becomes $\int \overline{f(x)}V(x)g(x)dx$, which is of the form we need for $Hg$.
But the first integral again needs integration by parts and to chage it to $\int -\overline{f(x)}\frac{d^2}{dx^2}g(x)dx$ we need the boundary terms to vanish.
So I believe we only need the density argument for establishing the integral identity $$ \int \frac{d}{dx}\overline{f(x)}g(x)dx = -\int \overline{f(x)}\frac{d}{dx}g(x)dx$$ and $$\int \frac{d^2}{dx^2}\overline{f(x)}g(x)dx=\int \overline{f(x)}\frac{d^2}{dx^2}g(x)dx.$$
And for these functions $f,g$ they belong to the domain $\{\psi \in L^2(\mathbb{R}), \frac{d}{dx}\psi \in L^2(\mathbb{R})\}$ and $\{\psi \in L^2(\mathbb{R}), \frac{d^2}{dx^2}\psi \in L^2(\mathbb{R})\}$ for the domains of $P$ and $H$, respectively. And the Schwartz class of functions $\mathcal{S}$ belongs to these domains, and is a dense subspace of $L^2$.
But to use a density argument, for example for the first integral, we have $$|\int \nabla \overline{f_n}g_n - \nabla \overline{f}g| \\ = |\int \nabla \overline{f_n}(g_n-g) + g(\nabla \overline{f_n} - \nabla \overline{f})| \le \Vert \nabla \overline{f_n}\Vert_L^2 \Vert g_n - g\Vert_L^2 + \Vert g\Vert_L^2 \Vert \nabla \overline{f_n} - \nabla \overline{f}\Vert_L^2. $$
But here to deal with the convergence of the derivative, I had to use the $H^2$ norm. I know that $H^2$ is a dense subspace of $L^2$, but I don't know how to pass from $H^2$ functions to the functions in the domain of the operators. How can I deal with this issue?