Skip to content
Tutorials Center
My learning

Topics

Lesson 19 of 38 · Particle in a Box and Barriers

The Infinite Square Well

Solve the particle in a box: standing-wave wavefunctions, quantized energies E = n²h²/(8mL²), zero-point energy and a numerical check in Python.

The infinite square well is the first problem where you can solve the Schrödinger equation completely with pencil and paper. A particle is trapped between two perfectly rigid walls. Inside, it feels no force. Outside, it can never be found. It is a crude model of an electron confined to a thin wire, a dye molecule with delocalized electrons, or a quantum dot, but its real value is that it shows, in the simplest possible setting, why confinement produces quantized energy.

In this lesson you will write down the problem, solve it by matching a wave to the walls, and then check the result numerically. Keep one idea in mind: a wave that must vanish at both ends can only fit in the box in certain patterns, just like the standing waves on a guitar string.

The setup

Place the walls at x = 0 and x = L. The potential energy is

Text
V(x) = 0        for 0 < x < L
V(x) = ∞        otherwise

An infinite potential means the particle has no chance of being found where V = ∞, so the wavefunction is zero there: ψ(x) = 0 for x ≤ 0 and x ≥ L. Because a wavefunction in this problem is continuous, it must also go to zero at the walls: ψ(0) = ψ(L) = 0. These are the boundary conditions.

Inside the box the time-independent Schrödinger equation is

Text
-(ħ² / 2m) d²ψ/dx² = E ψ

Here ħ = h / 2π is the reduced Planck constant, m is the particle mass and E is the energy. Rewrite it as ψ'' = -k² ψ with k = √(2mE) / ħ. The general solution is ψ(x) = A sin(kx) + B cos(kx).

Applying the boundary conditions

At x = 0 we need ψ(0) = B = 0, so only the sine survives: ψ(x) = A sin(kx).

At x = L we need A sin(kL) = 0. We want a nonzero wave (A ≠ 0), so sin(kL) = 0, which means

Text
k L = n π,   n = 1, 2, 3, ...

(n = 0 gives ψ = 0 everywhere, no particle at all, and negative n gives the same states with a sign flip.) Only certain wavelengths fit, exactly like a string fixed at both ends. The allowed wavelengths are λ = 2L / n.

Substituting k = nπ / L into k = √(2mE) / ħ gives the energy levels:

Text
E_n = n² π² ħ² / (2 m L²) = n² h² / (8 m L²)

Three facts to notice:

  • Energy is quantized: only the values E₁, 4E₁, 9E₁, ... occur.
  • The lowest energy is not zero. E₁ = h² / (8 m L²) > 0 is the zero-point energy. Squeezing a particle into a smaller region raises this energy, a direct consequence of the uncertainty principle.
  • Levels spread apart as n², and a smaller box or a lighter particle spreads them further.

Normalizing the wavefunction

The probability of finding the particle somewhere in the box must be 1:

Text
∫₀ᴸ |ψ|² dx = A² ∫₀ᴸ sin²(nπx / L) dx = A² L / 2 = 1

so A = √(2 / L), and

Text
ψ_n(x) = √(2/L) · sin(nπx / L)

The state ψ_n has n − 1 interior nodes, points where the wavefunction is zero. More nodes mean a shorter wavelength, larger momentum and higher energy. The probability density |ψ_n|² is not uniform: for n = 1 the particle is most likely in the middle, which differs from the classical picture of a ball bouncing back and forth with equal time at every position. As n becomes large, the density oscillates faster and its average approaches the uniform classical value. This is an example of the correspondence principle.

The wavefunctions are also orthogonal: ∫ ψ_n ψ_m dx = 0 for n ≠ m. Together with normalization we say they are orthonormal. This property is what lets you write any state in the box as a sum of the ψ_n (you will use it in the lesson on measurement).

Worked example: an electron in a 1 nm box

Take an electron (m = 9.109 × 10⁻³¹ kg) in a box of length L = 1.0 nm. Then

Text
E₁ = h² / (8 m L²)
   = (6.626 × 10⁻³⁴ J·s)² / (8 × 9.109 × 10⁻³¹ kg × (1.0 × 10⁻⁹ m)²)
   ≈ 6.0 × 10⁻²⁰ J ≈ 0.376 eV

where 1 eV = 1.602 × 10⁻¹⁹ J. The next levels are E₂ = 4E₁ ≈ 1.50 eV and E₃ = 9E₁ ≈ 3.38 eV. A jump from n = 1 to n = 2 needs 3E₁ ≈ 1.13 eV, the energy of an infrared photon with wavelength about 1100 nm. This is why nanometer-scale structures can be tuned by changing their size.

Try it yourself in the first editor below. It computes the levels with CODATA constants from scipy.constants, and then checks normalization and orthogonality numerically.

Python Levels and orthonormality of the box states

Press Run (or Ctrl + Enter) to see the result here.

Program input · what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

Seeing the standing waves

The plot below shows the first three wavefunctions, each drawn at the height of its own energy (a common way to draw level diagrams), plus the probability densities. Notice how n counts the humps.

Python Plot wavefunctions and probability densities

Press Run (or Ctrl + Enter) to see the result here.

Program input · what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

Dependence on mass and size

Because E_n ∝ 1 / (m L²), two quick scaling rules follow. Halve the box length and every level goes up by a factor of 4. Use a proton instead of an electron (about 1836 times heavier) and every level drops by that factor: the quantum effects become tiny for heavy objects. For a 1 g bead in a 1 cm box the energy E₁ is of order 10⁻⁶⁵ J, so the spacing between levels is immeasurably small, and the object behaves classically.

Check your understanding

Quick check · 4 questions

of 4 answered You scored / 4 · perfect!

  1. 1. Why must the cosine term vanish in the infinite square well solution on 0 < x < L?

    The boundary condition ψ(0) = 0 gives B cos(0) = B = 0, so only the sine term remains. Cosine is a valid solution of the equation; it just fails the boundary condition.
  2. 2. A particle in a box has energy E₁ in its ground state. What is the energy of the n = 3 state?

    E_n is proportional to n², so E₃ = 9E₁.
  3. 3. If you halve the length L of the box (same particle), what happens to every energy level?

    E_n ∝ 1/L². Halving L multiplies 1/L² by 4.
  4. 4. How many nodes (excluding the walls) does the n = 4 state have?

    The state ψ_n has n − 1 interior nodes, so n = 4 has 3.

Summary

  • The infinite square well has V = 0 inside and V = ∞ outside, so ψ must vanish at the walls.
  • Allowed solutions are ψ_n = √(2/L) sin(nπx/L) with n = 1, 2, 3, ....
  • Energies are E_n = n²h² / (8mL²): quantized, growing as n², and never zero.
  • The states are orthonormal and ψ_n has n − 1 interior nodes.
  • Smaller boxes and lighter particles give larger energy gaps; for everyday objects the gaps are unobservably small.

Next: The Finite Square Well