I know how to derive below equations found on wikipedia and have done it myselt too:
\begin{align} \hat{H} &= \hbar \omega \left(\hat{a}^\dagger\hat{a} + \frac{1}{2}\right)\\ \hat{H} &= \hbar \omega \left(\hat{a}\hat{a}^\dagger - \frac{1}{2}\right)\\ \end{align}
where $\hat{a}=\tfrac{1}{\sqrt{2}} \left(\hat{P} - i \hat{X}\right)$ is a annihilation operator and $\hat{a}^\dagger=\tfrac{1}{\sqrt{2}} \left(\hat{P} + i \hat{X}\right)$ a creation operator. Let me write also that:
\begin{align} \hat{P}&= \frac{1}{p_0}\hat{p} = -\frac{i\hbar}{\sqrt{\hbar m \omega}} \frac{d}{dx}\\ \hat{X}&=\frac{1}{x_0} \hat{x}=\sqrt{\frac{m\omega}{\hbar}}x \end{align}
In order to continue i need a proof that operators $\hat{a}$ and $\hat{a}^\dagger$ give a following commutator with hamiltonian $\hat{H}$:
\begin{align} \left[\hat{H},\hat{a} \right] &= -\hbar\omega \, \hat{a}\\ \left[\hat{H},\hat{a}^\dagger \right] &= +\hbar\omega \, \hat{a}^\dagger \end{align}
These statements can be found on wikipedia as well as here, but nowhere it is proven that the above relations for commutator really hold. I tried to derive $\left[\hat{H},\hat{a} \right]$ and my result was:
$$ \left[\hat{H},\hat{a} \right] \psi = -i \sqrt{\frac{\omega \hbar^3}{4m}}\psi $$
You should know that this this is 3rd commutator that i have ever calculated so it probably is wrong, but here is a photo of my attempt on paper. I would appreciate if anyone has any link to a proof of the commutator relations (one will do) or could post a proof here.