
Expectation values, variance, and standard deviation
Mean and spread of an ensemble, read straight from ψ.
Almost every number you will draw from ψ comes out of one integral: put the operator between ψ* and ψ, let it act on ψ, integrate. This lesson makes that integral routine, proves its answer real, adds the second integral that measures spread, and keeps both honest as statistics of many identically prepared copies.
Build the model
Let the operator act, then integrate: the mean and the spread of an ensemble.
1The big idea
A wavefunction does not give an observable one value; it gives a distribution, and the two numbers that summarise any distribution, its mean and its spread, can be read from ψ without first finding the distribution. For position the mean is ∫x|ψ|² dx, because x̂ only multiplies. For an operator that differentiates, |ψ|² has already thrown away the phase the answer depends on, so the rule must be ⟨A⟩ = ∫ψ*(Âψ) dx for normalised ψ:  acts on ψ, and only then is the product with ψ* integrated. Hermiticity makes that number real, and expanding ψ = Σcₙψₙ on Â's orthonormal eigenfunctions turns it into Σaₙ|cₙ|², an average of eigenvalues with non-negative weights that sum to one. The spread is the root of the mean squared deviation, σA² = ⟨A²⟩ − ⟨A⟩², where ⟨A²⟩ needs  applied twice; for Hermitian  it equals ∫|( − ⟨A⟩)ψ|² dx, so it is never negative and vanishes exactly on eigenfunctions. Both numbers describe an ensemble of systems prepared in the same ψ: ⟨A⟩ can sit between eigenvalues, and σA belongs to ψ, not to an instrument. The machinery stops at the edge of the operator's domain. A ψ with a jump has infinite ⟨p²⟩, and ψ = (b/π)¹⁄²(x² + b²)⁻¹⁄² is normalised, yet ∫x²|ψ|² dx diverges and σₓ does not exist.
2In one sentence
The expectation value ⟨A⟩ = ∫ψ*(Âψ) dx is the mean of an observable over many systems prepared in the same normalised ψ, and the standard deviation σA = √(⟨A²⟩ − ⟨A⟩²) is the spread of that ensemble about its mean.
Example. For ψ = √0.8 ψ₁ + √0.2 ψ₂ on energy eigenfunctions with E₁ = 1.0 eV and E₂ = 4.0 eV, ⟨H⟩ = 0.8(1.0 eV) + 0.2(4.0 eV) = 1.6 eV, which is neither eigenvalue, and σH = √(4.0 eV² − 2.56 eV²) = 1.2 eV.
3Put the operator between ψ* and ψ, and let it act on ψ
For position the recipe looks optional: ⟨x⟩ = ∫x|ψ|² dx, and since x̂ only multiplies, it makes no difference where the x stands. For momentum it decides the answer. Take ψ = f(x)e(ik₀x) with f real and normalised. Acting first gives p̂ψ = ħk₀ψ − iħf′e(ik₀x), so ∫ψ*(p̂ψ) dx = ħk₀ − iħ∫ff′ dx = ħk₀, since ∫ff′ dx = ½[f²] = 0. Two tempting shortcuts both fail. Letting p̂ act on the density gives −iħ∫(d|ψ|²/dx) dx = −iħ[|ψ|²] = 0 for every normalisable state, and letting it act on ψ* gives −ħk₀. For k₀ = 5.0 nm⁻¹ the right answer is ⟨p⟩ = 5.27 × 10⁻²⁵ kg m s⁻¹; the shortcuts return zero and its negative. The phase e(ik₀x) that carries the momentum is exactly what |ψ|² destroys, so  must reach ψ before ψ* multiplies it.
4Hermiticity makes the mean real, and symmetry makes it cheap
Conjugate the definition: ⟨A⟩* = ∫(Âψ)*ψ dx, and if  is Hermitian on a domain containing ψ (UQMI-03.05), that equals ∫ψ*(Âψ) dx = ⟨A⟩. So every expectation value of x̂, p̂ or Ĥ is real, and an imaginary part in your answer is a diagnosis: an algebra slip, or a ψ that breaks the boundary conditions, such as a trial function that does not vanish at a hard wall. Two free results follow. A real ψ has ⟨p⟩ = −iħ∫ψψ′ dx = −(iħ/2)[ψ²], which is imaginary unless it is zero, so it is zero; a constant phase in front changes nothing. And if |ψ|² is symmetric about x₀, then ⟨x⟩ = x₀ with no integral at all. Use both before integrating: in a box 0 ≤ x ≤ a, a real ψ symmetric about a/2 already has ⟨x⟩ = a/2 and ⟨p⟩ = 0, and only ⟨x²⟩ and ⟨p²⟩ remain to be computed.
5On an eigenbasis the integral becomes a weighted sum
Expand ψ = Σcₙψₙ on Â's orthonormal eigenfunctions, with cₙ = ∫ψₙ*ψ dx from UQMI-03.07. Then Âψ = Σcₙaₙψₙ, and ∫ψ*(Âψ) dx = ΣₘΣₙ cₘ*cₙaₙ∫ψₘ*ψₙ dx. Orthonormality removes every term with m ≠ n, leaving ⟨A⟩ = Σaₙ|cₙ|², with weights that are non-negative and, by normalisation, sum to one. Unit 4 reads |cₙ|² as the probability of the result aₙ (UQMI-04.03); here the algebra alone shows that ⟨A⟩ is an average of eigenvalues, lies between the smallest and the largest, and ignores the phases of the cₙ. An operator that is not diagonal on this basis keeps the cross terms, and they carry the phases. For ψ = (ψ₁ + e(iφ)ψ₂)/√2 in a box of width a, ⟨H⟩ = (E₁ + 4E₁)/2 = 2.5E₁ for every φ, yet ⟨x⟩ = a/2 − (16a/9π²) cos φ, which for a = 1.0 nm swings between 0.32 nm and 0.68 nm.
6The spread needs the operator twice
The variance is the mean squared deviation, σA² = ⟨(A − ⟨A⟩)²⟩. Expanding, with ⟨A⟩ a constant, gives ⟨A²⟩ − 2⟨A⟩⟨A⟩ + ⟨A⟩² = ⟨A²⟩ − ⟨A⟩², where ⟨A²⟩ = ∫ψ*Â(Âψ) dx: act twice, then integrate. On an eigenbasis ⟨A²⟩ = Σaₙ²|cₙ|². For Hermitian Â, move one  across the integral: ⟨A²⟩ = ∫|Âψ|² dx, and σA² = ∫|( − ⟨A⟩)ψ|² dx. That is an integral of a modulus squared, so σA² ≥ 0, with equality only when ( − ⟨A⟩)ψ vanishes everywhere, which is the eigenvalue equation. Zero spread and eigenfunction are one statement. The box ground state ψ₁ shows both halves: Ĥψ₁ = E₁ψ₁, so σH = 0, but p̂ψ₁ is a cosine, no multiple of ψ₁, so ⟨p⟩ = 0 while ⟨p²⟩ = (πħ/a)², and σₚ = πħ/a = 6.63 × 10⁻²⁵ kg m s⁻¹ for a = 0.50 nm.
7A mean over copies, and a spread that belongs to ψ
Neither number describes one system. Both are statistics of an ensemble: many systems prepared in the same ψ, each measured once. The average over N copies scatters about ⟨A⟩ by σA/√N, while the scatter of the individual results is σA itself, however large N grows; these are the statistics of UPI-01.03. What is new is where σA comes from. Nothing in ∫ψ*Â(Âψ) dx refers to an apparatus, so a perfect instrument would still show the spread. Take ψ = (ψ₁ + ψ₂)/√2 with E₁ = 1.50 eV: ⟨H⟩ = 2.5E₁ = 3.75 eV sits halfway between the two eigenvalues in the expansion, 1.50 eV and 6.00 eV, and σH = 1.5E₁ = 2.25 eV reaches from the mean exactly to each of them. Averaging 100 copies pins ⟨H⟩ to about ±0.23 eV; the spread stays 2.25 eV. Why single results are eigenvalues, and why σ is not an instrument error, is Unit 4's business (UQMI-04.03, UQMI-04.09).
8Four checks on every mean and spread
Normalisation first: Σ|cₙ|² = 1 or ∫|ψ|² dx = 1, or divide by the norm if not. Dimensions next: ⟨A⟩ and σA carry the units of Â, because ψ*ψ dx is a pure number. Then limits and bounds: σA = 0 on an eigenfunction; ⟨A⟩ lies between the smallest and the largest eigenvalue present; and σA can never exceed half the gap between those two, a bound reached by equal weights at the two ends. Last, the classical correspondence. A classical particle bouncing at constant speed in a box of width a is equally likely to be anywhere, so its mean is a/2 and its spread a/√12 = 0.289a. The box eigenfunctions give ⟨x⟩ = a/2 and σₓ = a√(1/12 − 1/(2n²π²)): 0.181a for n = 1 and 0.2878a for n = 10, closing on the classical value as n grows. A result that fails any of the four is wrong, however careful the integration looked.
Key equations
What each relation says, and the units it is written in.
Expectation value of an operator
⟨A⟩ = ∫ ψ* (Âψ) dx, over the whole region, for normalised ψ
 acts on ψ before the product is formed. If ∫|ψ|² dx = N ≠ 1, divide the integral by N, which is the same as normalising first.
ψ in m⁻¹⁄² in one dimension, so ψ*ψ dx is a pure number and ⟨A⟩ carries the units of Â.
The same mean on an eigenbasis
⟨A⟩ = Σ aₙ |cₙ|², for ψ = Σ cₙψₙ with Âψₙ = aₙψₙ
A weighted average of eigenvalues: it lies between the smallest and the largest aₙ, and the phases of the cₙ drop out of it entirely.
aₙ in the units of Â; cₙ = ∫ψₙ*ψ dx is a pure number. The ψₙ must be orthonormal, and then Σ|cₙ|² = 1.
Variance and standard deviation
σA² = ⟨A²⟩ − ⟨A⟩², with ⟨A²⟩ = ∫ ψ* Â(Âψ) dx
Expanding the mean squared deviation ⟨(A − ⟨A⟩)²⟩ gives this form. Squaring ⟨A⟩ in place of averaging A² would make every spread zero.
σA has the units of  and σA² their square.  acts twice before the integral is taken.
Variance as a squared norm
σA² = ∫ |(Â − ⟨A⟩)ψ|² dx, for Hermitian Â
Never negative, and zero exactly when Âψ = ⟨A⟩ψ: a state has zero spread in A if and only if it is an eigenfunction of Â.
Needs ψ in a domain on which  is Hermitian (UQMI-03.05); σA² in the square of the units of Â.
Mean square momentum
⟨p²⟩ = ħ² ∫ |dψ/dx|² dx
One p̂ moved across by integration by parts. Positive by construction, and safe at kinks where p̂²ψ hides a delta function; ⟨T⟩ = ⟨p²⟩/2m.
ħ = 1.055 × 10⁻³⁴ J s; ∫|dψ/dx|² dx in m⁻², so ⟨p²⟩ is in kg² m² s⁻². ψ must vanish at the ends.
Real wavefunctions carry no mean momentum
⟨p⟩ = −iħ ∫ ψ (dψ/dx) dx = −(iħ/2)[ψ²] = 0, for real ψ
⟨p⟩ must be real, and this is imaginary unless it vanishes. A mean momentum needs a phase that varies with x: f(x)e(ik₀x) with f real gives ⟨p⟩ = ħk₀.
ψ real, in m⁻¹⁄²; ⟨p⟩ in kg m s⁻¹. [ψ²] is ψ² at the far end minus the near end, zero when ψ vanishes at both.
Interactive lab
Change one variable. Predict first, then read the result.
Controls
Try this. At θ = 45°, turn φ from 0° to 180°: ⟨x⟩ slides from 0.32a to 0.68a and σₓ widens then narrows, yet the bars, ⟨H⟩ = 2.50E₁ and σH = 1.50E₁ never move. Then take θ to 0° or 90°: ψ becomes a single eigenfunction and σH falls to zero.
Live results
- MEAN POSITION ⟨x⟩
- 0.320 a
- SPREAD σₓ
- 0.139 a
- MEAN MOMENTUM ⟨p⟩
- 0.00 ħ/a
- ENERGY SPREAD σH
- 1.50 E₁
Catch the common trap
The mistake this lesson is built to prevent.
The commonest slip is to square the mean where the formula wants the mean of the square: to write ⟨p²⟩ = ⟨p⟩² or ⟨H²⟩ = ⟨H⟩², which makes every variance zero. It is tempting in the box ground state, where ⟨p⟩ = 0 and the particle seems to be at rest with no kinetic energy. The integral says otherwise: ⟨p²⟩ = ħ²∫|ψ₁′|² dx = (πħ/a)², so ⟨T⟩ = ⟨p²⟩/2m = E₁, which is 1.50 eV for an electron in a 0.50 nm box. Averaging and squaring do not commute. The gap between them, ⟨A²⟩ − ⟨A⟩², is the variance itself, and it closes only on an eigenfunction of Â. ⟨p⟩ = 0 says the momentum distribution is balanced about zero, not that it is concentrated there.
Test it: what changes?
- ⟨x⟩ swings between 0.32a and 0.68a
- σₓ varies with φ
- Weights |c₁|² = |c₂|² = ½ unchanged
- ⟨H⟩ = 2.50E₁ and σH = 1.50E₁ fixed
- Weight moves from ψ₁ to ψ₂
- ⟨H⟩ rises from E₁ to 4E₁
- σH zero at both ends, largest at 45°
Practice & worked examples
Three tiers. Try each before opening the solution.
EasyExample 1
A particle in a box is prepared in ψ = (ψ₁ + 2ψ₂ − iψ₃)/√6, where the ψₙ are orthonormal energy eigenfunctions with Eₙ = n²E₁ and E₁ = 1.50 eV. Confirm that ψ is normalised, find ⟨H⟩ and σH, and say whether ⟨H⟩ is an eigenvalue.
View solution →
- Weights: |c₁|² = 1/6, |c₂|² = 4/6 and |c₃|² = |−i|²/6 = 1/6. They sum to 1, so ψ is normalised. The factor −i has modulus 1 and changes nothing below.
- Mean: ⟨H⟩ = ΣEₙ|cₙ|² = E₁(1 × 1 + 4 × 4 + 9 × 1)/6 = 26E₁/6 = 4.333E₁ = 6.50 eV.
- Mean square: ⟨H²⟩ = ΣEₙ²|cₙ|² = E₁²(1 × 1 + 16 × 4 + 81 × 1)/6 = 146E₁²/6 = 24.33E₁² = 54.75 eV².
- Spread: σH² = ⟨H²⟩ − ⟨H⟩² = (24.33 − 18.78)E₁² = 5.556E₁², so σH = 2.357E₁ = 3.54 eV. Using ⟨H⟩² = 42.25 eV² in place of ⟨H²⟩ would have given σH = 0.
- Checks: the eigenvalues present are 1.50, 6.00 and 13.5 eV. ⟨H⟩ = 6.50 eV lies between the smallest and the largest but equals none of them, and σH = 3.54 eV is below the bound (13.5 − 1.50)/2 = 6.00 eV.
Answer. ⟨H⟩ = 6.50 eV and σH = 3.54 eV. The mean is not an eigenvalue, and the phase −i on c₃ affects neither number.
MediumExample 2
An electron held against a hard wall at x = 0 has the real wavefunction ψ = A x e(−x/b) for x ≥ 0 and ψ = 0 for x ≤ 0, with b = 0.20 nm. Find A, ⟨x⟩ and σₓ, then ⟨p⟩, ⟨p²⟩ and σₚ, and the mean kinetic energy ⟨T⟩.
View solution →
- Every integral here is ∫₀^∞ xⁿ e(−2x/b) dx = n!(b/2)(n+1). Normalisation: A² × 2!(b/2)³ = A²b³/4 = 1, so A = 2b⁻³⁄² = 22.4 nm⁻³⁄².
- ⟨x⟩ = A² × 3!(b/2)⁴ = 3b/2 = 0.30 nm, and ⟨x²⟩ = A² × 4!(b/2)⁵ = 3b² = 0.12 nm². So σₓ = √(3b² − 9b²/4) = (√3/2)b = 0.17 nm.
- ψ is real and vanishes at x = 0 and as x → ∞, so ⟨p⟩ = −(iħ/2)[ψ²] = 0, with no integral to do.
- ⟨p²⟩ from the first derivative: ψ′ = A e(−x/b)(1 − x/b), and ħ²∫|ψ′|² dx = ħ²A²(b/2 − b/2 + b/4) = ħ²/b². The second-derivative form −ħ²∫ψψ″ dx = ħ²A²(b/2 − b/4) = ħ²/b² agrees, because the boundary term ψψ′ vanishes at both ends.
- σₚ = √(ħ²/b² − 0) = ħ/b = 5.3 × 10⁻²⁵ kg m s⁻¹, and ⟨T⟩ = ⟨p²⟩/2m = (ħ²/2m)/b² = (0.0381 eV nm²)/(0.040 nm²) = 0.95 eV. Squaring ⟨p⟩ would have said the electron has no kinetic energy.
- Checks: the units come out as nm, kg m s⁻¹ and eV; σₓσₚ = (√3/2)ħ = 0.87ħ, above the ħ/2 floor proved in UQMI-04.07; and as b → 0, σₓ → 0 while σₚ and ⟨T⟩ grow without bound.
Answer. A = 22.4 nm⁻³⁄²; ⟨x⟩ = 0.30 nm and σₓ = 0.17 nm; ⟨p⟩ = 0 but ⟨p²⟩ = ħ²/b², so σₚ = 5.3 × 10⁻²⁵ kg m s⁻¹ and ⟨T⟩ = 0.95 eV.
HardExample 3
In a box 0 ≤ x ≤ a with a = 0.50 nm, take as supplied data the eigenfunctions ψₙ = √(2/a) sin(nπx/a), with Eₙ = n²E₁ and E₁ = 1.50 eV. For ψ = (ψ₁ + e(iφ)ψ₃)/√2, show that ⟨x⟩ and ⟨p⟩ do not depend on φ, find σₓ at φ = 0 and at φ = π, and find ⟨H⟩ and σH.
View solution →
- Orthonormality gives ∫|ψ|² dx = ½ + ½ = 1. The density is |ψ|² = ½(ψ₁² + ψ₃²) + ψ₁ψ₃ cos φ, and only the cross term knows the phase.
- ψ₁ and ψ₃ are both even about x = a/2, so |ψ|² is even about a/2 for every φ and ⟨x⟩ = a/2 = 0.25 nm. For ⟨p⟩, the diagonal terms vanish because each ψₙ is real, and the cross terms need ∫ψ₁ψ₃′ dx, even times odd about a/2, which is zero.
- ⟨x²⟩ needs one new integral. With u = x/a and sin(πu) sin(3πu) = ½[cos(2πu) − cos(4πu)], ∫x²ψ₁ψ₃ dx = a²∫₀¹ u²[cos(2πu) − cos(4πu)] du = a²[1/(2π²) − 1/(8π²)] = 3a²/(8π²) = 0.0380a².
- With ∫x²ψₙ² dx = a²[1/3 − 1/(2n²π²)], ⟨x²⟩ = a²[1/3 − 5/(18π²)] + (3a²/(8π²)) cos φ, so σₓ² = ⟨x²⟩ − a²/4 = a²(0.0552 + 0.0380 cos φ).
- At φ = 0, σₓ = a√0.0932 = 0.305a = 0.15 nm: ψ₁ + ψ₃ vanishes at the centre, so the density is pushed outward, wider even than the uniform a/√12 = 0.289a. At φ = π, ψ₁ − ψ₃ is twice ψ₁ at the centre, and σₓ = a√0.0172 = 0.131a = 0.066 nm.
- Energy: ⟨H⟩ = ½(E₁ + 9E₁) = 5E₁ = 7.50 eV and ⟨H²⟩ = ½(1 + 81)E₁² = 41E₁², so σH = √(41 − 25) E₁ = 4E₁ = 6.00 eV for every φ, exactly the bound (9E₁ − E₁)/2.
Answer. ⟨x⟩ = 0.25 nm and ⟨p⟩ = 0 for every φ; σₓ = 0.15 nm at φ = 0 and 0.066 nm at φ = π; ⟨H⟩ = 7.50 eV and σH = 6.00 eV whatever φ is. The phase is visible only to the spread in x.
Quick check
Choose an answer, then check it. Explain to yourself why the others fail.
Key takeaway
Let  act on ψ first, and keep ⟨A²⟩ apart from ⟨A⟩².
For normalised ψ, ⟨A⟩ = ∫ψ*(Âψ) dx = Σaₙ|cₙ|², and σA² = ⟨A²⟩ − ⟨A⟩² with  applied twice. Both describe many identically prepared copies, not one system. σA = 0 exactly when ψ is an eigenfunction of Â, and ψ must lie in Â's domain or ⟨A²⟩ can diverge.