Calculation of Gibbs free energy of a chemical reaction So, I'm trying to derive the equation: $$\Delta G = \Delta G^o + RT \ln Q\tag{1}$$
And trying to follow the steps detailed on this website here. I am having trouble deriving equation 7, which tries to sum chemical potentials. Previously, it derives the change in chemical potential, $\Delta \mu _i$ when the reaction is poised away from equilibrium, and for the reaction $A + B \rightarrow C + D$, four equations, each for $A, B, C$ and $D$ respectively.
$$\Delta \mu _A = \mu_A' -\mu_A = RT \ln([A']/[A])\tag{2}$$
Where $[A']$ is the activity away from equilibrium. Afterwards, it proceeds by:
$$\Sigma\Delta\mu_i = RT \ln\left(\frac{[C'][D'][A][B]}{[C][D][A'][B']}\right)\tag{3}$$
My confusion is regarding the arrangement of the activities in the $\ln()$ function. I assumed that:
$$\Sigma\Delta\mu_i = \Delta\mu_A + \Delta\mu_B + \Delta\mu_C + \Delta\mu_D = RT \ln\left(\frac{[A'][B'][C'][D']}{[A][B][C][D]}\right)\tag{4}$$
It says that we assume the concentration of the products increases by convention, but I don't get it. Even if the concentration of the reactants decrease and the products increase, the change in sign will be due to the $\ln()$ function. If you flip the activities of the reactants around, it doesn't give the net change in Gibb's free energy anymore.
If anyone can help explain this, I will be very grateful.
P.S. Sorry if the question seemed low effort, but the context is mostly given in the website, and I can't find an explanation anywhere :(
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]}$$