---
title: Why atoms have energy levels
heading: Confine a wave and only certain energies fit
eyebrow: B9 · Lesson 1 · Why atoms have energy levels
xp: 40
---

::: hook
A guitar string pinned at both ends can only vibrate at certain frequencies: those where a whole number of half-waves fit along it. Electrons are waves too, and an electron trapped in an atom, or in a tiny box, has the same restriction. Only certain wave shapes fit, and each has its own energy. That's why atoms emit light only at sharp colors, why semiconductor lasers emit the wavelengths they do, and why quantum dots glow a color set by their size.

::: play
- An electron is trapped in a box of width $L$. The curve is the wave for level $n$; the readout gives that level's energy.
- Step $n$ up. How many half-waves fit in the box? How does the energy grow?
- Shrink the box. What happens to all the energies, and to the color of light emitted when the electron drops from level 2 to level 1?
:::
:::

```sim plot
view: graph
x: x = 0..1
y: psi = -1.5..1.5
slider: n = 1..6 step 1 = 1
slider: L = 0.5..5 step 0.1 = 1 nm
plot: sin(n*pi*x) | samples: 800 | label: wave ψ for level n (x in units of L)
plot: 0 | dashed | color: ch2
readout: energy of level n = n^2*0.376/L^2 eV
readout: photon from level 2 to 1 = 1240/(3*0.376/L^2) nm
```

::: predict
## An electron in a box drops from level 2 to level 1 and emits a photon. You halve the box's width. What happens to the photon's wavelength?

- [ ] It doubles
- [ ] It halves
- [x] It drops to a quarter
- [ ] It stays the same

::: reveal
A quarter. The energies scale as $1/L^2$, so a box half as wide has levels four times farther apart, and the photon carries four times the energy: a quarter of the wavelength. That's how quantum dots work: the same semiconductor glows red in large dots and blue in small ones, purely because of size.
:::
:::

::: nameit
## Quantized energy

**Electrons are waves.** De Broglie proposed in 1924 that a particle of momentum $p$ has a wavelength $\lambda = h/p$. For an electron with a few electronvolts of energy that's about a nanometer: the size of atoms and of the smallest transistor features.

**A particle in a box.** Trap an electron between walls a distance $L$ apart. Its wave must vanish at the walls, just like a string's displacement at its ends, so only whole numbers of half-wavelengths fit: $\lambda_n = 2L/n$. Each fixes a momentum $p = h/\lambda$ and an energy $p^2/2m$:

$$E_n = \frac{n^2h^2}{8mL^2} \qquad n = 1, 2, 3, \ldots$$

For an electron in a 1 nm box, $E_1 = 0.376$ eV, $E_2 = 1.50$ eV, $E_3 = 3.38$ eV. Energies in between are impossible.

**Three consequences.**

- **Discrete spectra.** Dropping from level $n$ to a lower level $m$ emits a photon of exactly $E_n - E_m$. Each kind of atom has its own fingerprint of colors (neon's red, sodium's yellow).
- **Zero-point energy.** The lowest level, $n = 1$, is not zero: a confined electron can never sit still.
- **Size matters.** Smaller boxes mean higher energies and wider spacing ($\propto 1/L^2$).

**Atoms.** In a hydrogen atom the "box" is the proton's attraction, and the levels come out as $E_n = -13.6\text{ eV}/n^2$. The details differ, but the reason is the same: the electron's wave has to fit.

The wave $\psi$ isn't a physical displacement; its square $|\psi|^2$ gives the probability of finding the electron at each place.
:::

::: example
## An electron is trapped in a box 1 nm wide. What are its two lowest energies, and what photon does it emit dropping between them?

::: solution
1. **Ground state.**
   $$\begin{aligned} E_1 &= \frac{h^2}{8mL^2} \\ &= 0.376\ \text{eV} \end{aligned}$$
2. **Second level.**
   $$\begin{aligned} E_2 &= 4E_1 \\ &= 1.504\ \text{eV} \end{aligned}$$
3. **Photon energy.** The photon carries the difference:
   $$1.504 - 0.376 = 1.128\ \text{eV}$$
4. **Wavelength.**
   $$\begin{aligned} \lambda &= \frac{1239.8}{1.128}\ \text{nm} \\ &= 1099\ \text{nm} \end{aligned}$$
   in the near infrared.

**Answer:** the two lowest energies are 0.376 eV and 1.504 eV, and the drop between them emits a 1.128 eV photon at 1099 nm, in the near infrared.
:::
:::

::: example
## What wavelength of light can just ionize a hydrogen atom from its ground state?

::: solution
1. **Energy needed.** Freeing the electron from the ground state takes 13.6 eV.
2. **Wavelength.**
   $$\begin{aligned} \lambda &= \frac{1239.8}{13.6}\ \text{nm} \\ &= 91.2\ \text{nm} \end{aligned}$$
   in the far ultraviolet.
3. **Visible light.** Visible light, under 3.3 eV, can't ionize ground-state hydrogen at all.

**Answer:** 91.2 nm, in the far ultraviolet.
:::
:::

::: example
## A dye molecule's chain of alternating bonds is 1.4 nm long and holds 10 mobile electrons, two per level. Treating it as a box, what wavelength does it absorb most strongly?

::: solution
1. **Which jump.** The 10 electrons fill levels 1 to 5, so the lowest-energy jump is from 5 to 6.
2. **Energy of the jump.**
   $$\begin{aligned} \Delta E &= (36 - 25)\frac{h^2}{8mL^2} \\ &= 11 \times \frac{0.376\ \text{eV}}{1.4^2} \\ &= 2.11\ \text{eV} \end{aligned}$$
3. **Wavelength.** 2.11 eV is a wavelength of 587 nm.
4. **Color.** The dye absorbs yellow-orange light and so looks blue.
5. **Tuning the color.** Lengthening the chain moves the absorption to longer wavelengths, which is how chemists tune dyes, and the box model gets the trend right with nothing more than a length.

**Answer:** it absorbs most strongly at 587 nm, yellow-orange light, so the dye looks blue.
:::
:::

::: check
given: n = 2..5 int; L = 0.5 | 2 | 3
answer: n^2*0.376/L^2
unit: eV
tolerance: 1%

## An electron is in level {n} of a box {L} nm wide. What is its energy? ($E_1 = 0.376$ eV for a 1 nm box.)

::: right
Right. $E_n = n^2 \times 0.376\text{ eV}/L^2$ = {answer}.
:::

::: misses
- [n*0.376/L^2] Energy goes as $n^2$.
- [n^2*0.376/L] Energy goes as $1/L^2$.
- [any] Not yet. $E_n \propto n^2/L^2$.
:::
:::

::: check
given: L = 1 | 2 | 3; n = 2 | 3
answer: 1240/((n^2 - 1)*0.376/L^2)
unit: nm
tolerance: 1%

## An electron in a {L} nm box drops from level {n} to level 1. What wavelength does it emit?

::: right
Right. The energy difference is $(n^2 - 1) \times 0.376/L^2$ eV, and $\lambda = 1240/\Delta E$ = {answer}.
:::

::: misses
- [1240/(n^2*0.376/L^2)] Use the difference between the levels, not level n's energy.
- [any] Not yet. $\Delta E = E_n - E_1$, then $\lambda = 1240/\Delta E$.
:::
:::

::: check
given: V = 1 | 10 | 100 | 1000
answer: 6.626e-34/sqrt(2*9.109e-31*V*1.602e-19)*1e9
unit: nm
tolerance: 1%

## What is the de Broglie wavelength of an electron accelerated through {V} V?

::: right
Right. $p = \sqrt{2meV}$ and $\lambda = h/p$ = {answer}.
:::

::: misses
- [6.626e-34/(2*9.109e-31*V*1.602e-19)*1e9] Take the square root to get the momentum.
- [any] Not yet. $\lambda = h/\sqrt{2meV}$.
:::
:::

::: check
given: n = 2 | 3 | 4
answer: -13.6/n^2
unit: eV
tolerance: 0.5%

## What is the energy of a hydrogen atom's electron in level {n}?

::: right
Right. $-13.6\text{ eV}/n^2$ = {answer}.
:::

::: misses
- [13.6/n^2] It's negative: the electron is bound.
- [-13.6/n] Divide by $n^2$.
- [any] Not yet. $E_n = -13.6/n^2$ eV.
:::
:::

::: check
kind: choice

## Why can't an electron confined in a box have zero energy?

- [ ] Electrons always move at the speed of light
- [x] A wave that fits in the box must have at least one half-wavelength across it, so its momentum and energy can't be zero
- [ ] The box's walls give it energy
- [ ] It can, at absolute zero

::: right
Right. The lowest wave that fits has a finite wavelength, so a nonzero momentum and energy.
:::

::: misses
- [1] Electrons move far slower than light here.
- [3] The walls don't add energy; the confinement does.
- [4] Even at absolute zero it's in the $n = 1$ level, above zero.
:::
:::

::: check
kind: parts
given: L = 0.5 | 1 | 2; n = 2 | 3

## An electron is trapped in a box {L} nm wide.

::: part
answer: 0.376*n^2/L^2
unit: eV
tolerance: 0.5%

### What is the energy of level {n}?

::: misses
- [0.376*n/L^2] The energy grows as $n^2$.
- [any] $E_n = n^2\frac{h^2}{8mL^2}$, with 0.376 eV for a 1 nm box.
:::
:::

::: part
answer: 1239.84/(0.376*(2*n - 1)/L^2)
unit: nm
tolerance: 0.5%

### What wavelength does it emit dropping from level {n} to level {n} − 1?

::: misses
- [any] $\Delta E = (2n - 1)E_1$.
:::
:::
:::

::: check
kind: derivation
vars: m = 0.00000000000000000000000000000005..0.000000000000000000000000000001, L = 0.0000000002..0.00000001, n = 1..5

## A particle of mass m in a box of width L.

::: step
answer: n^2*(6.626e-34)^2/(8*m*L^2)

### What is the energy of level n?
:::

::: step
answer: (2*n + 1)*(6.626e-34)^2/(8*m*L^2)

### How far above it is level n + 1?
:::

::: right
Right. The spacing grows with n, and shrinks as $\frac{1}{L^2}$: a bigger box has closer levels.
:::
:::

::: explain
## Why does confining an electron to a smaller space raise its energy levels?

::: model
The electron's wave has to fit in the space, vanishing at the walls, so its wavelength can be at most twice the width. A smaller space forces a shorter wavelength, and by de Broglie's relation a shorter wavelength means a larger momentum, so a larger kinetic energy. Because energy goes as momentum squared, the levels rise as one over the width squared.
:::
:::

::: practice

::: check
given: k = 2..10 int
answer: k^2
tolerance: 0.5%

## A box is made {k} times narrower. By what factor do its energy levels rise?

::: misses
- [k] It goes as $1/L^2$.
- [any] $E \propto 1/L^2$.
:::
:::

::: check
given: n = 2..5 int
answer: n^2
tolerance: 0.5%

## How many times the ground-state energy is level {n} of a box?

::: misses
- [n] Energy goes as $n^2$.
- [any] $E_n/E_1 = n^2$.
:::
:::

::: check
given: n1 = 2..8 int; n2 = 1
answer: 13.6*(1 - 1/n1^2)
unit: eV
tolerance: 0.5%

## What photon energy does hydrogen emit going from level {n1} to level 1?

::: misses
- [13.6/n1^2] Use the difference between the two levels.
- [any] $13.6(1 - 1/n_1^2)$ eV.
:::
:::
:::
