Solution (source code)

= Solution

Choose zero potential for $0<x<L$. In an <infinite square well>,
$$
\psi_n(x)=\sqrt{\frac2L}\sin\frac{n\pi x}{L},\qquad
E_n=\frac{n^2\pi^2\hbar^2}{2mL^2}.
$$
The first three levels have ratios \b[$1:4:9$], with zero, one and two interior nodes; the <wavefunctions> vanish outside.

For a <finite square well> with exterior potential $V_0$, bound states have $0<E<V_0$, sinusoidal interiors and tails with $\kappa=\sqrt{2m(V_0-E)}/\hbar$. Matching <wavefunction> and derivative for equal masses gives
$$
k\tan(kL/2)=\kappa\ \text{(even)},\qquad
-k\cot(kL/2)=\kappa\ \text{(odd)},\qquad
k=\sqrt{2mE}/\hbar,
$$
when parity is taken about the well center. Corresponding energies fall below the infinite-barrier values, and the <wavefunctions> spread beyond the walls. There are finitely many bound states; a shallow well need not possess three. States above $V_0$ form a scattering continuum.

\Image[/past-exam-of-the-mphil-in-micro-and-nanotechnology-enterprise-course-of-the-university-of-cambridge/2020/paper-2-wells.png]
{title=Wavefunctions, probability densities and core-shell confinement}
{description=Original normalized infinite- and finite-well calculations with a chosen dimensionless barrier, plus qualitative type-I envelope sketches. The envelope panel is not a two-particle probability density or material-specific fit.}