I'm a physics student getting a bit out of my depth in maths, and I'd really like someone to confirm that my reasoning below is correct.
We're working in the Hilbert space $\mathcal{H}=L^2(\mathbb{R},dx)$. Define the operator with its maximal domain,
$$ A := \frac{d^2}{dx^2} + \frac{1}{4}x^2 , $$ $$ \mathcal{D}(A) = \{ \varphi \in \mathcal{H} | A\varphi \in \mathcal{H} \}. $$
$A$ is symmetric by a trivial by-parts calculation. To confirm that it's self-adjoint, we check the deficiency index. This means looking at
$$ n_\pm = \text{dim Ker}(A^\dagger \mp i). $$
This means solving the differential equation
$$ \frac{d^2 f}{dx^2} + \frac{1}{4} x^2 f(x) \mp if(x) =0 $$
which gives (according to Mathematica)
$$ f(x) = c_1 D_{-3/2}((-1)^{1/4} x) + c_2 D_{1/2}((-1)^{3/4} x) $$
in the "$-if$" case and
$$ f(x) = c_1 D_{1/2}((-1)^{1/4} x) + c_2 D_{-3/2}((-1)^{3/4} x) $$
in the "$+if$" case, where $D_n(z)$ is the parabolic cylinder function. These four solutions certainly aren't square-integrable, and I am fairly sure that $c_1$ and $c_2$ cannot be set to make either of the solutions square-integrable either, as I think that the parabolic cylinder functions diverge by different positive powers at infinity. Therefore there is no solution in $\mathcal{H}$, hence $n_-=n_+=0$, hence $A$ is Self-Adjoint. This means that I can apply the spectral theorem, which means that I can write any function $\psi(x) \in \mathcal{H}$ as
$$ \psi(x) = \sum_{k=1,2}\int_\mathbb{R} da \; \psi_k(a) f_k(a;x) $$
where $f_k(a;x)$, $k=1,2$ are two linearly independent solutions of
$$ \frac{d^2 f}{dx^2} + \frac{1}{4} x^2 f(x) - af(x) =0. $$
Is this all correct? It very much seems correct to me but I've learned half the definitions I've used for it this week so I'm not at all confident, and I really need to be able to rely on the result!