A guitar string clamped at both ends cannot vibrate at just any frequency. It is restricted to a fundamental note and its harmonics, because the fixed ends demand a whole number of half-waves between them. Anyone who has tuned an instrument has felt this without naming it: confinement plus a wave equals a discrete set of allowed states.
Quantum mechanics says a particle behaves the same way. Trap an electron in a small enough region and its energy stops being a smooth, continuous quantity. It is allowed only certain values — and nothing in between. The "particle in a box" is the cleanest place to see why. It is the first model every quantum course reaches for, not because real systems are boxes, but because it isolates one idea: confinement quantises energy.
Why this calculation matters
The particle in a box looks like a toy, and it is — deliberately so. Stripping away every complication leaves the single mechanism responsible for quantisation, and that mechanism reappears everywhere. The discrete colours in an atomic spectrum, the energy gaps in a semiconductor, the tunable emission of a quantum dot, the behaviour of electrons in a conjugated molecule — all of them are, at heart, particles confined to a small region with quantised energy levels.
It also delivers a result with real predictive teeth. The model tells you that energy levels scale inversely with the square of the box length. Shrink the box and the levels spread apart; enlarge it and they crowd together toward a continuum. That single scaling law explains why quantum effects are dramatic at the nanometre scale and invisible at the scale of everyday objects. For anyone designing nanostructures or interpreting spectra, getting comfortable with this calculation is the entry fee.
The core formula
Picture a particle of mass m free to move along a line of length L, but completely forbidden from leaving — the walls are infinitely high. Inside, it feels no force. Outside, it cannot exist. The Schrodinger equation under these conditions has solutions only when the wavefunction fits the box with zeros at both walls, exactly like the standing waves on a clamped string.
That boundary condition admits a whole number of half-wavelengths, indexed by an integer n = 1, 2, 3, ... Working the energy of each standing-wave state gives:
E_n = n^2 * h^2 / (8 * m * L^2)
Here h is Planck's constant, m is the particle mass, L is the box length, and n is the quantum number that labels the level. Three things are worth reading off this expression directly.
First, energy is quantised. Only the values produced by n = 1, 2, 3, ... are allowed; the particle cannot have an energy that falls between two of them.
Second, the levels scale as n squared, so they spread out as you climb. The gap between n = 1 and n = 2 is three times the ground-state energy; the gap between n = 2 and n = 3 is five times it. The ladder gets wider, not evenly spaced.
Third, the ground state — n = 1 — has energy above zero. A confined quantum particle can never be perfectly at rest. This irreducible minimum is the zero-point energy, and it is a direct consequence of confinement.
E_1 = h^2 / (8 * m * L^2) (ground state, n = 1)
E_n = n^2 * E_1 (every higher level)
A worked example
Take the most common case: a single electron confined to a box one nanometre across — roughly the scale of a small molecule. The numbers are mass m = 9.109e-31 kg, box length L = 1 nm = 1e-9 m, and Planck's constant h = 6.626e-34 J.s.
Step 1 — assemble the ground-state energy. Set n = 1 and substitute:
E_1 = 1^2 * (6.626e-34)^2 / (8 * 9.109e-31 * (1e-9)^2)
Step 2 — evaluate numerator and denominator separately.
numerator = (6.626e-34)^2 = 4.39e-67
denominator = 8 * 9.109e-31 * 1e-18 = 7.287e-48
Step 3 — divide.
E_1 = 4.39e-67 / 7.287e-48 = 6.03e-20 J
That is a small number in joules, which is why the electron-volt is the natural unit at this scale. Converting:
E_1 = 6.03e-20 J / 1.602e-19 J/eV = 0.38 eV
Step 4 — climb the ladder. Because each level scales as n squared:
E_2 = 4 * E_1 = 1.50 eV
E_3 = 9 * E_1
So the ground state sits at 0.38 eV, the first excited state at 1.50 eV, and the gap between them — about 1.1 eV — is squarely in the range of visible-to-near-infrared photon energies. That is the whole point: confine an electron to a nanometre and the energy steps land in a range you can probe with light.
Common mistakes
Forgetting the n-squared scaling. The levels are not evenly spaced. A common slip is to assume E_3 is "three times" E_1; it is nine times. The energy ladder widens as you go up.
Dropping the square on L. The denominator carries L squared, not L. Halving the box length quadruples every energy level. Because confinement effects are so sensitive to size, an error here scales fast.
Mixing up h and h-bar. This form of the energy uses Planck's constant h. The version written with the reduced constant h-bar = h/(2*pi) carries a different numerical prefactor. Pick one convention and use the matching prefactor throughout.
Assuming the ground state is zero. Quantum number n starts at 1, never 0. An n = 0 state would have a wavefunction that is zero everywhere — no particle at all. The lowest real energy is E_1, and it is strictly positive.
Treating the infinite well as physically exact. Real confining potentials have finite walls, so the wavefunction leaks slightly outside and the true levels sit a little below the infinite-well prediction. The model is an excellent first estimate, not the final word.
Try the interactive NovaSolver calculator
The algebra is short, but the intuition is easier to build when you can watch the wavefunctions and energy levels respond to the parameters. The Particle in a Box — Quantum Mechanics Visualizer on NovaSolver lets you set the box length, choose the particle type — electron, proton, neutron, or a custom mass — and pick the quantum number n, then returns the energy in both electron-volts and joules, the de Broglie wavelength, the number of nodes, and the spacing to the next level, while drawing the wavefunction and even animating the time evolution of a superposition state.
Related calculators
- Quantum Tunneling Simulator — see what happens when the confining walls are finite and a particle can leak through a barrier.
- Quantum Well Calculator — the realistic finite-depth cousin of the infinite box, central to semiconductor design.
- Photoelectric Effect Simulator — connect quantised energy levels to the photon energies that drive transitions.
You can browse the rest in the quantum physics tools hub.
Closing note
The particle in a box earns its place at the start of every quantum course because it does one job perfectly: it shows that confinement, plus the wave nature of matter, forces energy into discrete steps. The formula E_n = n-squared times h-squared over 8mL-squared carries three lessons in one line — energy is quantised, the levels spread as n squared, and a trapped particle always keeps a minimum zero-point energy. Once those ideas are solid, atomic spectra, semiconductor band gaps, and quantum dots stop looking like separate topics and start looking like the same physics at different scales.
Top comments (0)