In 1887, Walther Nernst, a German chemist, developed the Nernst equation, which describes the relationship between an electrochemical reaction’s potential and its standard electrode potential under standard and nonstandard conditions.
The derivation of the Nernst equation involves the following steps:

 Derive the formula for the reversible open circuit potential , E^{o}, of an electrochemical cell at constant temperature and pressure under standard conditions.
 Derive the expression for E^{o} in terms of chemical potentials of the reaction species at constant temperature and pressure.
 Derive a ‘correction factor’ for E^{o }in step2. This final expression, the Nernst equation, describes how the resultant E^{o }varies with activities of chemical species.
Step 1
From the definition of enthalpy, H = U + pV, we have
Substitute the definition of the internal energy of a system undergoing reversible change, dU = dq_{rev }+ dw_{rev} in eq1
Substitute the definition of the change in Gibbs energy of a system, dG = dH – d(TS) in eq2
At constant temperature and pressure, dT = dp = 0
Substitute the definition of the change in entropy of a system, dS = dq_{rev}/T in eq3
Substitute the definition of total reversible work, w_{rev} = w_{ex }+ w_{add}, where w_{ex} is reversible expansion work and w_{add} is reversible additional work other than reversible expansion work, in eq4
Substitute the definition of the change in reversible expansion work, dw_{ex }= –pdV in eq5
Substitute the definition of the reversible electrical work between two points in an electric circuit, dw_{add }= –nFEdξ in eq6
where n is the number of moles of electrons, F is the Faraday constant, E is the open circuit potential of the electrochemical cell and Δ_{r}G = dG/dξ is the Gibbs energy of the electrochemical cell reaction.
When the open circuit potential of an electrochemical cell is measured at standard conditions (1 bar, 298K, 1M), we write eq7 as:
Step 2
The chemical potential of the jth species, in a multicomponent system is
where n‘ is all n other than nj.
The total differential of the Gibbs energy of the system at constant temperature and pressure is
Substituting eq9 in eq10
Eq11 can be expressed in another way by considering the reversible reaction
with the change in Gibbs energy at constant temperature and pressure of the system given by eq11. Next, let’s define
where vj is the stoichiometric number of the jth species in the reversible reaction and dξ is the amount of substance that is being changed in the reaction.
ξ is called the extent of a reaction and has units of amount in moles. Note that the stoichiometric numbers for reactants are negative by convention and those for products are positive. Substituting eq12 in eq11
Substitute the definition of the Gibbs energy of an electrochemical cell reaction, , into eq13
Substitute eq7 from Step1 in eq14
When the open circuit potential of an electrochemical cell is measured at standard conditions (1 bar, 298K, 1M), we write eq15 as:
Step 3
Firstly, let’s consider a system with a single pure substance. Substitute the definition of the change in Gibbs energy of a system, dG = dH – d(TS), in the change of enthalpy of the system dH = dU + d(pV)
The reversible change in internal energy of a pure substance (a system with a single pure substance only does expansion work) can be expressed as
Substitute the definitions of entropy, dS = dq_{rev}/T, and expansion work, –pdV, in eq18
Substitute eq19 in eq17
At constant temperature, dT = 0 and eq20 becomes dG = Vdp. Integrating this new expression on both sides from to ,
Let p_{i} = 1 bar = p^{o }(i.e. standard conditions) and p_{f} = p
Secondly, we extend the above working to a multicomponent system of ideal gases. Since G is an extensive property, we add the Gibbs energies of all components to give the total Gibbs energy of the system:
Let’s assume the reference pressures of the component gases are the same since they are all ideal gases, i.e. p_{a}^{o }= p_{b}^{o }= p^{o }
For simplicity, let G_{Total }and G^{o}_{Total} be G and G^{o }respectively.
Taking the partial derivative of the above with respect to n_{j}, at constant temperature, pressure and the amount of the other components, n‘, we have
For the last partial derivative of the above equation, only the jth term survives.
Substitute eq9 from Step 2 in eq21
Similarly, for a solute in a dilute solution satisfying Henry’s law, we can write
where c_{j }and c^{o }are the jth solute’s concentration and molar concentration respectively.
We can finetune eq22 and eq23 by replacing p_{j}/p^{o }and c_{j}/c^{o }with γ_{j}(p_{j}/p^{o}) and γ_{j}(c_{j}/c^{o}) where γ_{j} is a factor called the activity coefficient that can account for both ideal and nonideal fluids (γ = 1 and γ < 1 for ideal and nonideal fluids respectively). Next, we combine the modified equations into a single equation by letting a_{j }= γ_{j}(p_{j}/p^{o}) and a_{j }= γ_{j}(c_{j}/c^{o}), where a_{j} is the activity of species j.
Substituting eq24 in eq15 from Step 2,
Substituting eq16 from Step 2 in eq25
where Q is the reaction quotient with Q = .
Hence, is the ‘correction factor’ for E^{o}, as the activities of reaction species vary. Eq26 is the Nernst equation.
For an electrochemical equation of the form , the Nernst equation can be written as:
Note that since E^{o }is by definition a reduction potential, the reference equation is always and hence eq27.