2. Understanding Corrosion  
2.5.1 Relationship between 'Free Energy' and 'Equilibrium Constant' 

The contribution made by one mole of any constituent, A, to the total free energy, G, of the mixture is G_{A}, which may be represented by
G_{A} = G_{A}^{o} RT ln(a_{A}) 
where a_{A} = activity of the substance, T = absolute temperature, and R = gas constant. 
From the GibbsHelmholtz equation:
G = H  TS
Substituting H from the First Law of Thermodynamics
G = U + PV  TS
Differentiating:
dG = dV + PdV + VdP  TdS  SdT
But,
dV = q_{rev}  PdV and q_{rev} = TdS
So,
dG = TdS  PdV + PdV + VdP  TdS  SdT
i.e., dG = VdP  SdT
At constant pressure, this equation becomes:
and at constant temperature:
dG = VdP
However, for ideal gas equation for 1 mole of reaction is
pV = RT 
V = RT/p 
Integration between the limits gives
If G'_{A} is taken to refer for standard conditions, it becomes G_{A}^{o}.
(1)
If activities are concerned instead of pressure, then
Applying DG for the reaction: aA + bB cC + dD gives
Expressing G_{C}, G_{D}, G_{A} and G_{B} as shown in (1) above, we get
So, for 1 mole forward reaction,
(2)
and at equilibrium, DG = 0
Equation (2) may be written as
The equations linking DG and K are referred to as VanHoff's Isotherms.
