Solution (source code)

= Solution

The <expectation value> is the mean outcome over many identically prepared measurements of the <observable>. For real $\lambda$, positivity of the <norm> in the <Hilbert space> gives
$$
0\leq\|(Q+i\lambda P)\psi\|^2
=\langle Q^2\rangle+\lambda^2\langle P^2\rangle+i\lambda\langle[Q,P]\rangle.
$$
This real quadratic has nonpositive <quadratic discriminant>, so
$$
\langle Q^2\rangle\langle P^2\rangle\geq\frac14|\langle[Q,P]\rangle|^2.
$$
Apply this to the centered observables $Q-\langle Q\rangle$ and $P-\langle P\rangle$ to obtain the <Robertson uncertainty principle>
$$
\boxed{\Delta Q\,\Delta P\geq\frac12|\langle[Q,P]\rangle|.}
$$

For the <quantum harmonic oscillator>, $[x,p]=i\hbar$ and
$$
E=\frac{\langle p^2\rangle}{2m}+\frac{m\omega^2\langle x^2\rangle}{2}
\geq\frac{(\Delta p)^2}{2m}+\frac{m\omega^2(\Delta x)^2}{2}.
$$
The <arithmetic-geometric mean inequality> and $\Delta x\Delta p\geq\hbar/2$ now give
$$
\boxed{E\geq\omega\Delta x\Delta p\geq\frac12\hbar\omega.}
$$