# Question about description of Gibbs free energy

When introduced to the gibbs free energy, it was derived as follows:

First law: $$dU=dq+dw$$

Second law: $$dS>dq/T$$ for a spontaneous change. Note $$dq$$ and $$dw$$ are inexact differentials.

Subsituting $$dq=dU-dw$$, into the second law gives us:

$$TdS>dU-dw$$

using $$dw=-P_{ext}dV$$

$$Tds>dU+P_{ext}dV$$

or,

$$dU+P_{ext}dV - TdS<0$$

Now, keeping pressure and temperature constant, we can say that: $$dU+P_{ext}dV - TdS<0$$
= $$d(U+P_{ext}V - TS)<0$$

= $$dG<0$$, where $$G$$ is the gibbs free energy.

Here is my problem.

A few lectures later when we were being introduced to the idea of chemical potential, the gibbs free energy was re written as a function of pressure and temperature in the following way. $$dG=Vdp-SdT$$, this expression was derived using the result above. My question is that if pressure and temperature were constant in the above expression, isnt $$dp$$ and $$dT$$ always 0? If so, how is this a valid expression of $$G$$?

G is not defined by the equations you wrote. For a pure substance or a mixture of constant chemical composition, it is defined by $$G=U+PV-TS$$And this equation applies only to thermodynamic equilibrium states. So, $$dG=dU+PdV+VdP-TdS-SdT$$But since $$dU=TdS-PdV$$ we are left with $$dG=-SdT+VdP$$

• I am a bit confused by what you mean it is not defined by the equations I wrote. You are using the same expression of G as I have given. Are you saying it is not defined as the quantity which is less than 0 for a reaction to occur spontaneously at constant T and P? Also I understand how the expression for G in terms of T and P is arrived at, its more of understanding it in the context where first we claimed that if T and P are fixed for a spontaneous reaction then G is defined as being the quantity which needs to be minimised for it to occur. Commented Nov 3, 2019 at 15:27
• If you are talking about chemical reactions, then the mixture is not of constant chemical composition, and you need to include the chemical potential terms: $$dG=-SdT+VdP+\sum{\mu_idN_i}$$and $$G=\sum{\mu_iN_i}$$ Commented Nov 3, 2019 at 15:39
• @ChetMiller Let $O$ be an irreversible process from the thermodynamic state $1$ to state $2$. Is $U_2-U_1=\int_{1|\text{process O}}^2 (TdS-pdV)$ valid for an irreversible process? Commented Nov 3, 2019 at 20:53
• If you are talking about integrating the equation dU=TdS-PdV, please understand that this equation applies to cases where no chemical reaction is involved; otherwise, there would be chemical potential terms that would have to be included in the equation. So, if process O does not involve chemical reaction, then, to get $U_2-U_2$ for irreversible process O, you would have to integrate over an alternative reversible path between the same two end states. The equation dU=TdS-PdV applies to the differential change between two closely neighboring thermodynamic equilibrium states. Commented Nov 3, 2019 at 22:36

I'm going to call a thermodynamic transformation that's both isothermal and isobaric a $$TP$$ transformation for convenience.

Let's say we have an irreversible $$TP$$ transformation $$A$$ (with $$T=T_0$$ & $$p=p_0$$) that starts from state $$1$$ and ends at state $$2$$.

$$\text{State 1 : }p_1=p_0 \;|\;T_1=T_0 \;|\;V_1\;|\;S_1\; |\; G_1=U_1+p_1V_1-T_1S_1$$ $$\text{State 2 : }p_2=p_0 \;|\;T_2=T_0 \;|\;V_2\;|\;S_2\;|\;G_2=U_2+p_2V_2-T_2S_2$$

$$\text{For an irreversible isothermal process (Second Law) : }Q_A \leq T_0 (S_2-S_1) \tag{1}$$ $$\text{For an irreversible isobaric process : }W_A=p_0(V_2-V_1)\tag{2}$$ $$\text{First Law of Thermodynamics : }\Delta U = U_2 - U_1 = Q_A - W_A \tag{3}$$ $$\Delta G=G_2-G_1=\Delta U + p_0(V_2-V_1)-T_0(S_2-S_1)=Q_A-W_A+W_A-T_0(S_2-S_1)$$ $$\Rightarrow \Delta G \leq 0$$

$$\Delta U=\int_{1|\text{process O}}^2(TdS-pdV) \text{ holds iff the process O from state 1 to state 2 is reversible} \tag{4}$$

$$\underline{\text{The Subtle Detail}}$$

Given transformation $$A$$ exists, it is not guaranteed that there must also exist a reversible $$TP$$ process (with the same $$T_0$$ and $$p_0$$) that connects the same initial and final states. However, if there exists a reversible $$TP$$ transformation $$B$$ (with the same $$T=T_0$$ & $$p=p_0$$) that goes from state $$1$$ to state $$2$$, then $$\Delta U \stackrel{\text{Eq. (4)}}= \int_{ 1|\text{process B}}^2(T_0 dS - p_0 dV)= T_0(S_2-S_1) - p_0(V_2-V_1) \tag{5}$$ $$\stackrel{\text{Follows from Eq. (2),(3) and (5)}}\Rightarrow Q_{\text{over any PT transformation (can be either reversible or irreversible)}}=T_0 (S_2-S_1)$$ $$\Rightarrow \Delta G=0$$