Solution (source code)

= Solution

The <time-independent Schrödinger equation> is
$$
-\frac{\hbar^2}{2m}\psi''(x)+\frac12m\omega^2x^2\psi(x)=E\psi(x).
$$
Put $\alpha=m\omega/\hbar$. For $\psi=e^{-\alpha x^2/2}$, differentiation gives $\psi''=(\alpha^2x^2-\alpha)\psi$. Substitution cancels the terms in $x^2$ and leaves $E_0=\hbar^2\alpha/(2m)=\hbar\omega/2$.

The <Gaussian integral> gives $\int e^{-\alpha x^2}\,dx=\sqrt{\pi/\alpha}$. Hence a normalized <wave function> is
$$
\boxed{\psi_0(x)=\left(\frac{m\omega}{\pi\hbar}\right)^{1/4}\exp\left(-\frac{m\omega x^2}{2\hbar}\right).}
$$
Multiplication by any constant of modulus one gives the same <quantum state>. The <position> <probability density> is $|\psi_0|^2=\sqrt{\alpha/\pi}e^{-\alpha x^2}$. Its first <moment> vanishes by oddness. <Integration by parts> gives $\int x^2e^{-\alpha x^2}\,dx=(2\alpha)^{-1}\int e^{-\alpha x^2}\,dx$, with the boundary term zero. Therefore
$$
\boxed{\langle x\rangle=0,\qquad\operatorname{Var}(x)=\langle x^2\rangle=\frac{\hbar}{2m\omega}.}
$$