🧠 Remember: classical approach
Consider a mass $m$ attached to a fixed point by a string of some natural length and spring constant $k$ we start with Hook’s law then newtons
$$ \begin{aligned} F&=-kx \\ m\ddot{x}&=-kx \end{aligned} $$
This has solutions
$$ x = A\sin\omega t+B\cos\omega t \qquad \omega=\sqrt{\frac{k}{m}} $$
The potential energy can be found to be
$$ V(x)=\frac12k\,x^2 \qquad (\text{so } F=-\frac{\partial V}{\partial x}=-k\,x) $$
Which gives a total energy of
$$ E = \frac{p^2}{2m}+\frac12k\,x^2 = \frac12m\omega^2(A^2+B^2) = \text{const.} $$
We will use $k=m\omega^2$
$$ E = \frac{p^2}{2m}+\frac12m\omega^2\,x^2 $$
We can simply write down the expression for the classical Hamiltonian and replace all functions of $p$ and $x$ by their respective operators
$$ \widehat{H} = \frac{\widehat{p}^2}{2m}+\frac12m\omega^2\,\widehat{x}^2 $$
So the TISE becomes
$$ -\frac{\hbar^2}{2m}\,\frac{\mathrm{d}^2\psi}{\mathrm{d}x^2}+\frac12m\omega^2\,x^2\,\psi=E\,\psi $$
🗒️ Note: the wavefunction must be smooth everywhere and can be normalized ($\psi(\pm\infty)=0)$
Initial guess
Let us guess that a solution has the form
$$ \psi(x)=Ae^{-x^2/2a^2} $$
where $a$ and $A$ are constants (it is a gaussian distribution with width $\Delta x = a$
we can calculate the 1st and 2nd derivatives
$$ \begin{aligned} \psi'(x)&=-\frac{x}{a^2}\,A\,\mathrm{e}^{-x^2/2a^2} \\ \psi''(x)&=\left(\frac{x^2}{a^4}-\frac1{a^2}\right)A\,\mathrm{e}^{-x^2/2a^2}\end{aligned} $$
we plug this in and get
$$ -\frac{\hbar^2}{2m}\left(\frac{x^2}{a^4}-\frac1{a^2}\right)+\frac12m\omega^2\,x^2=E $$
which can be rearranged to
$$ \left(-\frac{\hbar^2}{2ma^4}+\frac12m\omega^2\right)x^2+\left(\frac{\hbar^2}{2ma^2}-E\right)=0 $$
We want this solution to be true for all values of $x$ which only works if all the coefficients are zero
$$ \begin{aligned} -\frac{\hbar^2}{2ma^4}+\frac12m\omega^2&=0 \quad \Rightarrow\quad a=\sqrt{\frac{\hbar}{m\omega}} \\ \frac{\hbar^2}{2ma^2}-E&=0 \quad \Rightarrow\quad E={\textstyle\frac12}\hbar\omega\end{aligned} $$
that is:
$$ \boxed{\psi_0(x)=A\,\mathrm{e}^{-m\omega x^2/2\hbar}} $$
with $A$ given by the normalization condition.
💡 This solution is the ground state solution
Second guess
Let us guess the following solution
$$ \psi_1(x)=A\,x\,\mathrm{e}^{-x^2/2a^2} $$
with the same as before we get
$$ a=\sqrt{\frac{\hbar}{m\omega}} \qquad E={\textstyle\frac32}\hbar\omega $$
All the other guesses
Let us assume there is an infinite number of solutions labelled by an integer $n$
$$ \psi_n(x) = A\,H_n\left (\frac xa\right )\,\mathrm{e}^{-x^2/2a^2} \qquad a=\sqrt{\frac{\hbar}{m\omega}} $$
where we put $\frac{x}{a}$ inside the Hermite polynomial to make it unitless, $H_n$ is defined as $H_n(x)=(-1)^n\mathrm{e}^{x^2}\!\frac{\mathrm{d}^n}{\mathrm{d}x^n}\mathrm{e}^{-x^2}$
If we do this for many values of $n$ we get the following:
$$ \begin{align*} H_0(y)&=1 & E_0 &= {\textstyle{\frac12}}\hbar\omega \\ H_1(y)&=2y & E_1 &= {\textstyle{\frac32}}\hbar\omega \\ H_2(y)&=4y^2-2 & E_2 &= {\textstyle{\frac52}}\hbar\omega \\ H_3(y)&=8y^3-12y & E_3 &= {\textstyle{\frac72}}\hbar\omega \\&&& \;\,\vdots \\&& E_n &= (n+{\textstyle{\frac12}})\hbar\omega\end{align*} $$
solutions to the quantum harmonic oscillator
💃 Definitions:
🗒️ Notes: