---
title: Gibbs free energy, reactions and the law of mass action
heading: Equilibrium at fixed pressure, from batteries to electrons and holes
eyebrow: B11 · Lesson 30 · Gibbs free energy, reactions and the law of mass action
xp: 50
---

::: hook
Most real processes happen at fixed temperature and pressure: a battery discharging on a bench, a reaction in a fuel cell, electrons and holes being created and destroyed in a chip. The quantity they minimize is the **Gibbs free energy** G = U − TS + pV. Its change in a reaction sets a battery's voltage exactly: −ΔG divided by the charge transferred. And the condition for equilibrium between reacting species gives the **law of mass action**, which in a semiconductor is the rule $np = n_i^2$: electrons and holes are the reactants, and the gap is the reaction energy.
:::

::: play
- A hydrogen fuel cell: H₂ + ½O₂ → H₂O (liquid). The solid curve is its reversible voltage, $-\Delta G/2F$, against temperature; the dashed line is $-\Delta H/2F$, the voltage if all the reaction's enthalpy became electrical work.
- The gap between them is the heat TΔS that even an ideal cell must reject, because the reaction lowers the entropy of the gases.
- At 25 °C the cell gives 1.229 V, 83% of the reaction's enthalpy; the voltage falls by 0.85 mV for each kelvin of warming.
:::
:::

```sim plot
view: graph
x: T = 273..373 K
y: E = 1.1..1.5 V
slider: S = 250..370 step 1 = 298 K
plot: (285830 - T*163.34)/(2*96485.33) | label: reversible voltage, −ΔG/2F
plot: 285830/(2*96485.33) | dashed | label: −ΔH/2F
marker: T = S | label: operating point
readout: voltage here, V = (285830 - S*163.34)/(2*96485.33)
readout: best possible efficiency, ΔG/ΔH = (285830 - S*163.34)/285830
```

::: predict
## Silicon at 300 K has $n_i = 10^{10}$ cm⁻³. It's doped with 10¹⁶ donors per cm³, so n ≈ 10¹⁶. How many holes are there?

- [ ] 10¹⁰ cm⁻³, the same as intrinsic
- [x] 10⁴ cm⁻³
- [ ] Zero
- [ ] 10¹⁶ cm⁻³

::: reveal
Electrons and holes are created and annihilated in pairs: e⁻ + h⁺ ⇌ (nothing, plus energy $E_g$). The law of mass action makes the product depend only on temperature, $np = n_i^2 = 10^{20}$ cm⁻⁶, so p = 10⁴ cm⁻³. Adding electrons doesn't just add carriers; it suppresses the holes a millionfold. That's why minority carriers are so few, and why their behavior controls diodes and bipolar transistors.
:::
:::

::: nameit
## Gibbs free energy

$$G = U - TS + pV, \qquad dG = -S\,dT + V\,dp + \sum_j\mu_j\,dN_j$$

At fixed T and p, a system in contact with its surroundings evolves to minimum G, and $G = \sum_j\mu_jN_j$.

## Reactions and mass action

For a reaction $\sum_j\nu_jA_j = 0$ (ν negative for reactants), equilibrium requires $\sum_j\nu_j\mu_j = 0$. For dilute species, $\mu_j = kT\ln(n_j/n_{Qj}) + E_j$, and this becomes the **law of mass action**:

$$\prod_jn_j^{\nu_j} = K(T) = \prod_jn_{Qj}^{\nu_j}\,e^{-\sum\nu_jE_j/kT}$$

Equivalently, with standard free energies, $K = e^{-\Delta G^\circ/RT}$ per mole.

## Electrons and holes

Generation and recombination, e⁻ + h⁺ ⇌ 0 with energy $E_g$, give

$$np = n_i^2 = N_cN_ve^{-E_g/kT}$$

independent of doping. Lesson 37 builds semiconductor statistics on it.

## Electrochemistry

When a reaction moves n electrons per formula unit through an external circuit, the electrical work is the free energy released:

$$E = -\frac{\Delta G}{nF}, \qquad \frac{dE}{dT} = \frac{\Delta S}{nF}$$

with F = 96,485 C/mol (Faraday's constant). The heat a reversible cell exchanges is TΔS; the best efficiency of a fuel cell is ΔG/ΔH, which unlike a heat engine's isn't limited by Carnot.
:::

::: example
## What voltage does a hydrogen–oxygen fuel cell give at 25 °C and 80 °C? ΔH = −285.8 kJ/mol, ΔS = −163.3 J/(mol·K).

::: solution
1. **ΔG at 25 °C.**
   $$\begin{aligned} \Delta G &= \Delta H - T\Delta S \\ &= -285\,830 + 298.15 \times 163.3 \\ &= -237.1\ \text{kJ/mol} \end{aligned}$$
2. **Voltage at 25 °C.**
   $$\begin{aligned} E &= \frac{237\,100}{2 \times 96\,485} \\ &= 1.229\ \text{V} \end{aligned}$$
3. **At 80 °C.** At 353 K, ΔG = −228.1 kJ/mol and E = 1.182 V.
4. **Real cells.** Real cells deliver 0.6 to 0.8 V under load, losing the rest to the electrodes' overpotentials and resistance.

**Answer:** 1.229 V at 25 °C and 1.182 V at 80 °C.
:::
:::

::: example
## A reaction has ΔG° = +20 kJ/mol at 25 °C. What's its equilibrium constant?

::: solution
1. **Equilibrium constant.** The reaction barely proceeds:
   $$\begin{aligned} K &= e^{-20\,000/(8.314 \times 298.15)} \\ &= e^{-8.07} \\ &= 3.1 \times 10^{-4} \end{aligned}$$
2. **A rule of thumb.** Each 5.7 kJ/mol of ΔG° changes K tenfold at room temperature, the chemist's version of 60 mV per decade.

**Answer:** K = 3.1 × 10⁻⁴.
:::
:::

::: example
## An electrolyzer splits water at 25 °C. What's the least voltage that can do it, and at what voltage does the cell neither absorb nor give off heat? At 1.8 V, how efficient is it, and how much heat does it make per amp?

::: solution
1. **Reversible voltage.** Two electrons move per molecule of water, so
   $$\begin{aligned} E_{rev} &= \frac{\Delta G}{2F} \\ &= \frac{237.1\ \text{kJ/mol}}{2 \times 96\,485} \\ &= 1.229\ \text{V} \end{aligned}$$
2. **Thermoneutral voltage.**
   $$\frac{\Delta H}{2F} = 1.481\ \text{V}$$
   Between 1.229 V and this voltage the cell absorbs heat, supplying the $T\Delta S$ term from its surroundings.
3. **Efficiency at 1.8 V.** Against the heat of combustion,
   $$\frac{1.481}{1.8} = 82\%$$
4. **Heat at 1.8 V.** The excess appears as heat, 0.32 W for every amp through the cell:
   $$1.8 - 1.481 = 0.32\ \text{V}$$

**Answer:** the least voltage is 1.229 V and the thermoneutral voltage is 1.481 V; at 1.8 V the cell is 82% efficient and makes 0.32 W of heat per amp.
:::
:::

::: check
given: G = 237.1 | 410 | 790; n = 2 | 3 | 4
answer: G*1000/(n*96485.33)
unit: V
tolerance: 0.5%

## A cell reaction releases {G} kJ of Gibbs free energy per mole while moving {n} electrons per formula unit. What's its reversible voltage?

::: right
Right. $E = -\Delta G/nF$ = {answer} V.
:::

::: misses
- [G*1000/96485.33] Divide by the number of electrons transferred too.
- [any] Not yet. F = 96,485 C/mol.
:::
:::

::: check
given: S = -163.3 | -50 | 30; n = 1 | 2
answer: S/(n*96485.33)*1000
unit: mV/K
tolerance: 0.5%

## A cell reaction has ΔS = {S} J/(mol·K) with {n} electrons transferred. How does its voltage change with temperature?

::: right
Right. $\frac{dE}{dT} = \frac{\Delta S}{nF}$ = {answer} mV/K.
:::

::: misses
- [-S/(n*96485.33)*1000] dE/dT = +ΔS/nF: a reaction that lowers entropy loses voltage as it warms.
- [any] Not yet. Differentiate $E = -(\Delta H - T\Delta S)/nF$.
:::
:::

::: check
given: N = 1e15 | 1e16 | 1e18; i = 1e10 | 2e6 | 2e13
answer: i^2/N
unit: cm^-3
tolerance: 0.5%

## A semiconductor with $n_i$ = {i} cm⁻³ has n = {N} cm⁻³ electrons. How many holes?

::: right
Right. $p = n_i^2/n$ = {answer} cm⁻³.
:::

::: misses
- [i] Doping changes p: the product np stays fixed.
- [any] Not yet. $np = n_i^2$.
:::
:::

::: check
given: G = -10 | 5 | 20; T = 298.15 | 373.15
answer: exp(-G*1000/(8.314462618*T))
tolerance: 1%

## A reaction has ΔG° = {G} kJ/mol at {T} K. What's its equilibrium constant?

::: right
Right. $K = e^{-\Delta G^\circ/RT}$ = {answer}.
:::

::: misses
- [exp(G*1000/(8.314462618*T))] The sign: negative ΔG° means K > 1.
- [any] Not yet. R = 8.314 J/(mol·K).
:::
:::

::: check
given: H = 285.8 | 241.8 | 890; G = 237.1 | 228.6 | 818
answer: G/H
tolerance: 0.5%

## A fuel cell's reaction has ΔH = −{H} kJ/mol and ΔG = −{G} kJ/mol. What's its best possible efficiency, relative to the heat of combustion?

::: right
Right. ΔG/ΔH = {answer}.
:::

::: misses
- [1 - G/H] That's the fraction that must leave as heat.
- [any] Not yet. Electrical work ÷ enthalpy released.
:::
:::

::: check
given: E = 0.66 | 1.12 | 1.42; T = 250 | 300 | 400; c = 1.04 | 2.8
answer: sqrt(c*1e19*c*1e19*(T/300)^3*exp(-E/(0.000086173*T)))
unit: cm^-3
tolerance: 1%

## A semiconductor has $N_c$ = $N_v$ = {c} × 10¹⁹ cm⁻³ at 300 K (both scaling as $T^{3/2}$) and a gap of {E} eV. What's $n_i$ at {T} K?

::: right
Right. $n_i = \sqrt{N_cN_v}e^{-E_g/2kT}$ = {answer} cm⁻³.
:::

::: misses
- [sqrt(c*1e19*c*1e19*(T/300)^3)*exp(-E/(0.000086173*T))] Under the square root the exponent halves: $e^{-E_g/2kT}$.
- [any] Not yet. $n_i^2 = N_cN_ve^{-E_g/kT}$.
:::
:::

::: check
kind: parts
given: H = 50 | 180; S = 100 | 160

## A reaction has ΔH = +{H} kJ/mol and ΔS = +{S} J/(mol·K), both roughly constant.

::: part
answer: H*1000/S
unit: K
tolerance: 0.5%

### Above what temperature does it run forward on its own?

::: misses
- [H/S] Convert kJ to J.
- [any] ΔG = ΔH − TΔS changes sign at $\frac{\Delta H}{\Delta S}$.
:::
:::

::: part
answer: exp(-(H*1000 - 300*S)/(8.314462618*300))
tolerance: 0.5%

### What's its equilibrium constant at 300 K?

::: misses
- [any] $K = e^{-\Delta G/RT}$.
:::
:::
:::

::: check
kind: derivation
vars: G = -500..500, n = 1..4, T = 250..400

## A cell reaction with Gibbs energy change G (kJ/mol) moves n electrons, at T.

::: step
answer: -G*1000/(n*96485.33212)

### What's its open-circuit voltage?
:::

::: step
answer: exp(-G*1000/(8.314462618*T))

### What's its equilibrium constant?
:::

::: right
Right. Each 59 mV of a one-electron cell's voltage at 25 °C is a factor of ten in its equilibrium constant.
:::
:::

::: explain
## Why does adding donors to a semiconductor reduce the number of holes, when donors have nothing to do with holes?

::: model
Electrons and holes are constantly created in pairs by thermal energy and destroyed when they meet. The creation rate depends only on temperature, while the destruction rate is proportional to how often an electron meets a hole, n times p. In equilibrium the two balance, so np equals a constant set by temperature and gap, $n_i^2$. Donors flood the material with electrons, and with many more electrons around, each hole is found and annihilated much sooner, so the hole population drops until np is back to $n_i^2$. Thermodynamically it's the law of mass action for the reaction e⁻ + h⁺ ⇌ 0, the same rule that governs any chemical equilibrium.
:::
:::

::: practice

::: check
given: G = 150 | 600; n = 1 | 3
answer: G*1000/(n*96485.33)
unit: V
tolerance: 0.5%

## Cell voltage for −ΔG = {G} kJ/mol, {n} electrons?

::: misses
- [any] $-\Delta G/nF$.
:::
:::

::: check
given: N = 3e14 | 5e17; i = 1e10 | 1.8e6
answer: i^2/N
unit: cm^-3
tolerance: 0.5%

## Holes for n = {N}, $n_i$ = {i}?

::: misses
- [any] $n_i^2/n$.
:::
:::

::: check
given: G = -25 | 15; T = 290 | 500
answer: exp(-G*1000/(8.314462618*T))
tolerance: 1%

## K for ΔG° = {G} kJ/mol at {T} K?

::: misses
- [any] $e^{-\Delta G^\circ/RT}$.
:::
:::
:::
