Why are Kc and Kp interchangeable in the free energy-equilibrium equation?
The equilibrium constant is defined by activities:



The activity of a species in a liquid solution can be approximated to: $a=c/c^0$ where c is the concentration of the species and $c^o$ is the standard concentration ($1M$). This approximation leads to $K_{eq}=K_c$. The activity of gasses is called fugacity and it can be approximated to: $f=p/p^0$ where p is the pressure of the gas and $p^0$ is the standard pressure ($1$ $bar$). This leads to $K_{eq}=K_p$. Therefore, if a reaction takes place in e.g. water, one should use $K_c$, but if the reaction takes place in the gaseous state, $K_p$ should be used when calculating $dG$.