The equilibrium constant of a chemical reaction is the reaction quotient of the reaction at dynamic equilibrium.
The derivation of the equilibrium constant involves the following steps:

 Derive the expression for the Gibbs energy of a multicomponent reaction.
 Derive the chemical potential of a multicomponent system.
 Combine the two expressions.
Step 1
From eq14 of the article on the Nernst equation, the reaction Gibbs energy for a reaction is
and at standard state
Step 2
From eq24 of the article on the Nernst equation, the chemical potential of a multicomponent system is
Step 3
Combining eq1 and eq3
Substitute eq2 in eq4
Since lnx^{a }+lnx^{b} +… = ln(x^{a}x^{b} …), eq5 becomes
Let , where Q is the reaction quotient.
At equilibrium, a reversible reaction is spontaneous in neither direction. Hence the change in Gibbs energy with respect to the change in the extent of the reaction, i.e. the reaction Gibbs energy , is zero. Eq7 becomes
where K is the reaction quotient at equilibrium, i.e.
Since the value K of does not change for a particular reaction at constant temperature, we call it the equilibrium constant.