---
title: Chemical potential and the Gibbs factor
heading: When particles can move as well as energy
eyebrow: B11 · Lesson 16 · Chemical potential and the Gibbs factor
xp: 50
---

::: hook
Temperature decides which way energy flows. When particles can move as well, a second quantity decides which way they go: the **chemical potential** μ, the free-energy cost of adding one more particle. Particles flow from high μ to low until μ is equal everywhere. In a semiconductor the chemical potential of the electrons has a familiar name, the **Fermi level**, and the rule that it's flat in equilibrium is what builds the potential across every p–n junction. A voltmeter, strictly, measures a difference in electrons' chemical potential divided by e.
:::

::: play
- A single site, like a trap in an oxide or a donor atom, can hold zero or one electron, with energy E when occupied and g ways to be occupied. The curve is its occupancy against the chemical potential of the electrons around it.
- When μ is well below E the site is empty; well above, it's full. The switch happens over a few kT, and it's centered not at E but at E − kT ln g: the extra ways to be occupied favor filling.
- With g = 1 this is exactly the Fermi–Dirac function (lesson 18).
:::
:::

```sim plot
view: graph
x: u = -200..200 meV
y: f = 0..1.05
slider: T = 10..600 = 300 K log
slider: g = 1..4 step 1 = 2
plot: 1/(1 + exp(-u/(0.086173*T))/g) | label: occupancy (u = μ − E)
marker: u = -0.086173*T*ln(g) | label: half full
readout: kT, meV = 0.086173*T
readout: shift of the half-full point, meV = -0.086173*T*ln(g)
```

::: predict
## Phosphorus donors in silicon sit 45 meV below the conduction band. If the Fermi level is 200 meV below the band at 300 K, what fraction of donors still hold their electron?

- [ ] About half
- [ ] About 10%
- [x] About 0.5%
- [ ] All of them

::: reveal
The donor level is 155 meV above μ, six kT. With spin degeneracy 2 the occupancy is $\frac{1}{1 + \frac12e^{6.0}}$ = 0.005. So 99.5% of donors are ionized: each has given its electron to the conduction band. That's why doping a semiconductor with $10^{16}$ donors per cm³ gives almost exactly $10^{16}$ free electrons at room temperature.
:::
:::

::: nameit
## Chemical potential

$$\mu = \left(\frac{\partial F}{\partial N}\right)_{T, V}$$

Two systems that can exchange particles reach equilibrium when their chemical potentials are equal; particles flow from higher μ to lower. The thermodynamic identity gains a term: $dU = T\,dS - p\,dV + \mu\,dN$.

## Internal and external parts

In an external potential energy U(x) (gravity, or qφ for a charge), $\mu = \mu_{int}(n) + U(x)$. For an ideal gas $\mu_{int} = kT\ln\frac{n}{n_Q}$, with the **quantum concentration**

$$n_Q = \left(\frac{mkT}{2\pi\hbar^2}\right)^{3/2}$$

($1.25 \times 10^{19}$ cm⁻³ for free electrons at 300 K; electrons have two spin states, so their μ uses $2n_Q$). Equal μ everywhere then means $n(x) \propto e^{-U(x)/kT}$: the barometric formula for the atmosphere, and for charge carriers $n \propto e^{q\varphi/kT}$, the basis of every junction.

## The Gibbs factor

A system that can exchange both energy and particles with a reservoir at T and μ is in a state with N particles and energy E with probability

$$P = \frac{e^{(N\mu - E)/kT}}{\mathcal Z}, \qquad \mathcal Z = \sum_{N, s}e^{(N\mu - E_s)/kT}$$

For a site that's empty or holds one particle (energy E, g ways), $\mathcal Z = 1 + ge^{(\mu - E)/kT}$ and the occupancy is

$$f = \frac{1}{1 + \frac1ge^{(E - \mu)/kT}}$$

## Electrochemical potential

For electrons in a circuit, μ includes the electrostatic energy −eφ. It's the Fermi level, and it's flat across any set of connected conductors in equilibrium, even though their electrostatic potentials differ (contact potentials). A voltmeter measures the difference in Fermi levels between its leads, divided by e.
:::

::: example
## How quickly does the atmosphere thin out? Take nitrogen at 290 K.

::: solution
1. **Density against height.** Equal μ with U = mgh gives
   $$n(h) = n(0)e^{-mgh/kT}$$
2. **Scale height.**
   $$\begin{aligned} H &= \frac{kT}{mg} \\ &= \frac{1.38 \times 10^{-23} \times 290}{28 \times 1.66 \times 10^{-27} \times 9.81} \\ &= 8.8\ \text{km} \end{aligned}$$
3. **The real atmosphere.** It cools with height, which changes the details but not the scale.

**Answer:** the density falls by a factor of e for every 8.8 km of height.
:::
:::

::: example
## What's the chemical potential of an electron gas at $10^{16}$ cm⁻³ and 300 K, relative to the bottom of its band (free-electron mass)?

::: solution
1. **Chemical potential of a dilute gas.**
   $$\begin{aligned} \mu &= kT\ln\frac{n}{2n_Q} \\ &= 0.02585\ln\frac{10^{16}}{2.51 \times 10^{19}} \\ &= -0.202\ \text{eV} \end{aligned}$$
2. **What the sign says.** A negative μ, well below the band edge, means the gas is dilute and classical.
3. **In silicon.** That's the Fermi level of lightly doped silicon (with the effective mass, the number changes slightly; lesson 37).

**Answer:** μ = −0.202 eV, below the bottom of the band.
:::
:::

::: example
## What's the chemical potential of nitrogen at 1 bar and 300 K, measured from the energy of a molecule at rest? How much does it rise at 100 bar?

::: solution
1. **Quantum concentration.** For a 28 u molecule at 300 K,
   $$\begin{aligned} n_Q &= \left(\frac{mkT}{2\pi\hbar^2}\right)^{3/2} \\ &= 1.45 \times 10^{32}\ \text{m}^{-3} \end{aligned}$$
2. **Concentration at 1 bar.**
   $$\begin{aligned} n &= \frac{p}{kT} \\ &= 2.41 \times 10^{25}\ \text{m}^{-3} \end{aligned}$$
3. **Chemical potential at 1 bar.**
   $$\begin{aligned} \mu &= kT\ln\frac{n}{n_Q} \\ &= 0.02585 \times \ln(1.67 \times 10^{-7}) \\ &= -0.403\ \text{eV} \end{aligned}$$
4. **At 100 bar.** The concentration is 100 times larger, so μ rises by
   $$kT\ln100 = 0.119\ \text{eV}$$
   to −0.284 eV.
5. **Still classical.** The gas is still far below its quantum concentration, which is why it stays classical; the chemical potential only becomes positive when n approaches $n_Q$.

**Answer:** μ = −0.403 eV at 1 bar, rising by 0.119 eV to −0.284 eV at 100 bar.
:::
:::

::: check
given: g = 2 | 3 | 4; d = -50 | 10 | 30; T = 150 | 300
answer: 1/(1 + exp(-d/(0.086173*T))/g)
tolerance: 0.5%

## A site with {g} ways to hold one electron sits at energy E. The chemical potential is μ = E + ({d}) meV at {T} K. What's its occupancy?

::: right
Right. $\frac{1}{1 + \frac1ge^{(E - \mu)/kT}}$ = {answer}.
:::

::: misses
- [1/(1 + exp(-d/(0.086173*T)))] Include the degeneracy: g ways to be occupied favor filling.
- [any] Not yet. The Gibbs sum is $1 + ge^{(\mu - E)/kT}$.
:::
:::

::: check
given: E = 45 | 54 | 70; m = 80 | 120; T = 200 | 300
answer: 1 - 1/(1 + 0.5*exp((m - E)/(0.086173*T)))
tolerance: 0.5%

## A donor level lies {E} meV below the conduction band, and the Fermi level {m} meV below it, at {T} K. What fraction of donors are ionized (spin degeneracy 2)?

::: right
Right. One minus the occupancy $\frac{1}{1 + \frac12e^{(E_d - \mu)/kT}}$: {answer}.
:::

::: misses
- [1 - 1/(1 + exp((m - E)/(0.086173*T)))] The neutral donor's electron has two spin states: the factor ½.
- [any] Not yet. $E_d - \mu$ = ({m} − {E}) meV.
:::
:::

::: check
given: n = 1e14 | 1e16 | 1e18; T = 77 | 300
answer: 0.000086173*T*ln(n/(2*1.2547e19*(T/300)^1.5))
unit: eV
tolerance: 0.5%

## A free-electron gas has density {n} cm⁻³ at {T} K. What's its chemical potential relative to the band bottom (classical limit)?

::: right
Right. $kT\ln\frac{n}{2n_Q}$ = {answer} eV.
:::

::: misses
- [0.000086173*T*ln(n/(1.2547e19*(T/300)^1.5))] Electrons have two spin states, so compare with $2n_Q$.
- [any] Not yet. $n_Q = 1.25 \times 10^{19}(T/300)^{3/2}$ cm⁻³.
:::
:::

::: check
given: V = 0.1 | 0.3 | 0.7; T = 77 | 300
answer: exp(-V/(0.000086173*T))
tolerance: 1%

## Electrons in equilibrium spread across a region where the electrostatic potential energy rises by {V} eV. How does the density at the high-energy end compare with the low end, at {T} K?

::: right
Right. $e^{-\Delta U/kT}$ = {answer}.
:::

::: misses
- [exp(V/(0.000086173*T))] Fewer electrons sit where their energy is higher.
- [any] Not yet. Equal electrochemical potential.
:::
:::

::: check
given: m = 2 | 28 | 44; T = 220 | 300
answer: 1.380649e-23*T/(m*1.66053906660e-27*9.81)/1000
unit: km
tolerance: 0.5%

## What's the atmospheric scale height for molecules of mass {m} u at {T} K?

::: right
Right. $\frac{kT}{mg}$ = {answer} km.
:::

::: misses
- [any] Not yet. Equal μ with U = mgh.
:::
:::

::: check
given: a = 1e15 | 1e17; b = 1e18 | 1e20; T = 300 | 400
answer: 0.000086173*T*ln(b/a)
unit: V
tolerance: 0.5%

## Two regions hold electrons at {a} and {b} cm⁻³ at {T} K. What electrostatic potential difference holds them in equilibrium?

::: right
Right. $\frac{kT}{e}\ln\frac{n_2}{n_1}$ = {answer} V.
:::

::: misses
- [0.000086173*T*log(b/a)] Use the natural log.
- [any] Not yet. The internal chemical potentials differ by $kT\ln(n_2/n_1)$; the electrostatic energy must make up the difference.
:::
:::

::: check
kind: parts
given: p = 1 | 10 | 100; T = 250 | 300 | 400

## Nitrogen (28 u) at {p} bar and {T} K.

::: part
answer: p*1e5/(1.380649e-23*T)/1e25
tolerance: 0.5%

### What's its concentration, in units of 10²⁵ per m³?

::: misses
- [any] $n = \frac{p}{kT}$.
:::
:::

::: part
answer: 0.000086173*T*ln(p*1e5/(1.380649e-23*T)/((28*1.66054e-27*1.380649e-23*T/(2*pi*(1.054572e-34)^2))^1.5))
unit: eV
tolerance: 0.5%

### What's its chemical potential?

::: misses
- [any] $\mu = kT\ln\frac{n}{n_Q}$.
:::
:::
:::

::: check
kind: derivation
vars: d = -100..100, T = 50..400

## A donor can be empty or hold one electron of either spin. Write d = $E_d - \mu$ in meV, at T (K).

::: step
answer: 1 + 2*exp(-d/(0.086173*T))

### What's its Gibbs sum?
:::

::: step
answer: 1/(1 + 0.5*exp(d/(0.086173*T)))

### What's the chance it holds an electron?
:::

::: step
answer: 1/(1 + 2*exp(-d/(0.086173*T)))

### What's the chance it's ionized?
:::

::: right
Right. The factor of 2 for spin moves the half-occupied point $kT\ln2$ away from $E_d$.
:::
:::

::: explain
## Why is the Fermi level flat across a p–n junction in equilibrium, even though the electrostatic potential isn't?

::: model
The Fermi level is the electrons' electrochemical potential: their internal chemical potential, which depends on how densely they're packed, plus their electrostatic energy. If it were higher on one side, electrons could lower the total free energy by moving to the other side, and they'd keep moving until it was equal, which is the definition of equilibrium. When a junction forms, electrons do flow from the n side to the p side, but they leave charged ions behind, and the resulting field builds an electrostatic potential that exactly offsets the difference in density. In the end the electrostatic potential steps across the junction while the Fermi level stays flat, and no net current flows.
:::
:::

::: practice

::: check
given: g = 2 | 4; d = -80 | 60; T = 150 | 400
answer: 1/(1 + exp(-d/(0.086173*T))/g)
tolerance: 0.5%

## Occupancy with g = {g}, μ − E = {d} meV, {T} K?

::: misses
- [any] $\frac{1}{1 + \frac1ge^{(E - \mu)/kT}}$.
:::
:::

::: check
given: E = 40 | 70; m = 120 | 300; T = 250 | 350
answer: 1 - 1/(1 + 0.5*exp((m - E)/(0.086173*T)))
tolerance: 0.5%

## Ionized fraction: donor {E} meV, Fermi level {m} meV below the band, {T} K?

::: misses
- [any] $1 - \frac{1}{1 + \frac12e^{(E_d - \mu)/kT}}$.
:::
:::

::: check
given: a = 1e14 | 1e16; b = 1e17 | 1e19; T = 250 | 350
answer: 0.000086173*T*ln(b/a)
unit: V
tolerance: 0.5%

## Potential holding {a} and {b} cm⁻³ in equilibrium at {T} K?

::: misses
- [any] $\frac{kT}{e}\ln\frac{n_2}{n_1}$.
:::
:::
:::
