# How to derive the relation between gibbs energy and equilibrium constant?

I want to understand the derivation between gibbs energy and equillibrium constant $$\Delta G=\Delta G^o+RT\ln Q?$$ I have seen a similar post on CSE Derivation of relationship between equilibrium constant and Gibbs free energy change which seems to be incomplete and still confusing so I am again asking this question.

The derivation that was written in the post was as follows:

Using the fundamental equations for the state function (and its natural variables):_ $$dG=-SdT+VdP$$ $$V=(\dfrac {\partial G}{\partial P})_T$$ $$\bar G(T,P_2)=\bar G(T,P_1)+\int_{P_1}^{P_2}\bar V dp$$ Here $$\bar x$$ represents molar $$x$$, i.e. $$x$$ per mole $$\bar V=\frac {RT}{P}$$ $$\bar G(T,P_2)=\bar G(T,P_1)+RT \ln\frac {P_2}{P_1}$$ Defining standard state as $$P=1\text{bar}$$ and $$\bar G=\mu$$ $$\mu(T,P)=\mu^o (T)+RT\ln \frac{P}{P_o}$$ consider the general gaseous reaction $$aA+bB\rightarrow cC+dD$$ $$\Delta G=(c\mu_C+d\mu_D-a\mu_A-b\mu_B)$$ for "unit progress" in reaction. Using $$\mu_i=\mu^o_i+RT\ln \frac{P_i}{1bar}$$ $$\Delta G=(c\mu^o_C+d\mu^o_D-a\mu^o_A-b\mu^o_B)+RT\ln \frac{P_C^cP_D^d}{P_A^aP_B^b}$$ $$\Delta G=\Delta G^o+RT\ln Q$$

1. I know the relation between Gibbs free energy,Enthalpy,Entropy and Temperature as $$G = H - TS$$ how is the relation $$dG=-SdT+VdP$$ derived from the above formula?
2. Why do we take a path where Entropy and volume are constant in the equation $$dG=-SdT+VdP$$ as in a chemical reaction both volume and entropy can change?
• When you are talking about the change in a state function like G, it is important to precisely define the initial and final thermodynamic equilibrium states of the system you are considering. In your equation describing $\Delta G$, what is your understanding of the initial and final thermodynamic equilibrium states that are being considered? Commented Nov 28, 2018 at 15:43
• @ChesterMiller It must involve some change in pressure and volume under constant temperature. Commented Nov 28, 2018 at 16:16

## 3 Answers

Firstly, if you know the relation $$G= H-TS$$, you can reach at the differential form of it just by taking differential at both sides, i.e.$$dG= dH-SdT-TdS$$ Now, recall the definition of enthalpy as $$H= U +PV$$, So, we can write, $$dH= dU + PdV + VdP$$, and also recall the heat supplied to the system as $$dQ= TdS$$ and by the first law of Thermodynamics, $$dQ= dU+ PdV$$ .Thus combining we have $$dG= dU+PdV+VdP-SdT-dQ = VdP -SdT$$ Thus you derive the required relationship.

Now coming to your next question, it's not about taking path where Entropy and volume remains constant. A state in a thermodynamic system can be defined in terms of three parametrs which are interrelated i.e Pressure, Temperature and Volume. In fact, you can only independently vary any two out of these three parameters and third one will automatically get adjusted. Here the independent variables are Temperature and Pressure. By changing the Pressure and Temperature independently, the change in the Gibbs' Free Energy is calculated. The coefficients are volume and Entropy only but that doesn't mean they are kept constant. So, the interpretation of the equation $$dG= VdP- SdT$$ needs to be done correctly.

The initial state is one of pure reactants in separate containers and in stoichiometric proportions at temperature T and arbitrary pressures. The final state is one of pure products in separate containers and in corresponding stoichiometric proportions at temperature T and arbitrary pressures. That is what the derivation is analyzing. The superscript "0" states in this equation are the same, except that here the pure species are at 1 bar.

For a pure species, the general equation for dG is $$dG = -SdT+VdP$$. This equation does not assume that S and V are constant. To get the free energy of each species at an arbitrary pressure and temperature T, we integrate VdP from one bar to the arbitrary pressure (using the ideal gas law); at a pressure of 1 bar and temperature T, the free energy of the pure species is equal to $$\mu^0(T)$$, the free energy of formation of the species (from its elements) at T and 1 bar.

That basically summarizes the initial and final states, and how $$\Delta G$$ is calculated for the change between these states.

The Boltzmann equation is actually derived from an entropy and energy argument. I think Banjaminson does a decent job, but I'll provide a brief overview as it's relevant.

Assume that we have some system with different energy levels, e.g. in the case of a gas particles may have different speeds (kinetic energy). In expectation, entropy always increases as a high-energy particle is much more likely to lose energy to a low-energy one than vice versa. Entropy is defined as $$S = -\sum p_i\ln p_i,$$ summing over every energy level. Suppose the average energy is fixed to $$G = \sum p_i G_i.$$ From Lagrange multipliers1, the entropy is maximized when $$1+\ln p_i + \lambda G_i = 0,$$ which gives $$p_i\sim e^{-\lambda G_i},$$ in particular $$\sum p_i = 1\implies p_i = \frac{1}{\sum e^{-\lambda G_i}}e^{-\lambda G_i}.$$ Let $$Z$$ be that bottom summation, called the "partition function"---how many ways the particles can be assigned states given the proportions in each state. We can use the entropy to simplify it: $$S = -\sum p_i\ln p_i = -\sum p_i(-\lambda G_i-\ln Z) = \ln Z + \lambda G.$$ Because people figured out temperature before the Boltzmann equation, we say that $$\lambda = \frac{1}{N_a k_bT}$$ where $$T$$ is temperature and $$k_b$$ is the "Boltzmann constant", how to get from Kelvin to a physically meaningful value of temperature. Note that $$R = N_a k_b$$ is just the constant times one mole, because chemists multiply all their energies by Avagadro's number. Rearranging yields $$G = RT(S - \ln Z).$$

Unfortunately this is incomplete, because I'm busy and unlikely to come back, but if someone with lots of karma wants to comment/edit this post and finish it, that'd be great.

Footnotes

1. The gradients $$\nabla S$$ and $$\nabla G$$ must be parallel, or equivalently, $$\nabla S$$ must be tangent to the surface of $$G(p_1, p_2, \dots, p_n)$$. Otherwise we can move along this surface, keeping the same energy but increasing entropy.