Calculation of Gibbs free energy of a chemical reaction
It seems to me, it goes like this:
$$\mu_A=\mu_A^0+RT\ln{[A]}$$
$$\mu'_{A}=\mu_{A}^0+RT\ln{[A']}$$
So, $$\Delta G=\mu'_C+\mu'_D-\mu'_A-\mu'_B=\mu_{C}^0+RT\ln{[C']}+\mu_{D}^0+RT\ln{[D']}-\mu_{A}^0-RT\ln{[A']}-\mu_{B}^0-RT\ln{[B']}
=\Delta G^0+RT\ln{Q}$$where $$Q=\frac{[C'][D']}{[A'][B']}$$
But, $$\Delta G^0=-RT\ln{K}$$where
$$K=\frac{[C][D]}{[A][B]}$$