Gibbs Free Energy

Chemical Potential

As seen in Equation 2.2.6, this expression has three independent variables: (S,V,ni)(S, V, n_i). Consider the scenario where SS and VV are held constant, where dS=0\dd S=0 and dV=0\dd V=0. This means that in this system, the only change in the internal energy comes from the change in the chemical work,

dUS,V=iμidni\dd U\big|_{S, V}=\sum_i \mu_i \dd n_i

The subscripted SS and VV after \big| mean that those variables are held constant. Equation 2.3.1 can also be rearranged to provide a more explicit definition of chemical potential μi\mu_i.

Legendre Transformation from U(S,V,ni)U(S, V, n_i) to G(T,P,ni)G(T, P, n_i)

In practice, it is often difficult to keep SS and VV constant during chemical processes since it’s almost impossible to obtain complete heat insulation, and materials wants to expand or shrink in volume during heat exchange. It is oftentimes more convenient to control a different set of variables, such as TT and PP. The temperature can be fixed by coupling the system to an external heat reservoir, and the pressured can be fixed by adjusting the volume of the container or adding/removing materials from the system. By changing the underlying control variable, we are effectively transforming into a new thermodynamic potential that is different from the initial thermodynamic potential (i.e., the internal energy in this case). To obtain the expression for this new thermodynamic potential, we follow a 3-step process to transform from the internal energy UU that depends on (S,V,ni)(S, V, n_i) to a new thermodynamic potential that depends on (T,P,ni)(T, P, n_i).

Step 1

Let’s start by writing out the differential form of our initial thermodynamic potential as a function of all its independent variables:

dU=(US)V,nidS+(UV)S,nidV+i(Uni)S,V,njidni\dd U = \left(\frac{\partial U}{\partial S}\right)_{V, n_i} \dd S + \left(\frac{\partial U}{\partial V}\right)_{S, n_i} \dd V + \sum_i \left(\frac{\partial U}{\partial n_i} \right)_{S, V, n_{j\neq i}} \dd n_i

By comparing Equation 2.3.3 to Equation 2.2.6 , we can conclude

(US)V,ni=T(UV)S,ni=P(Uni)S,V,nji=μi\begin{aligned} \left(\frac{\partial U}{\partial S}\right)_{V, n_i} &= T \\ \left(\frac{\partial U}{\partial V}\right)_{S, n_i} &= -P \\ \left(\frac{\partial U}{\partial n_i} \right)_{S, V, n_{j\neq i}} &= \mu_i \end{aligned}

Here, the variables that immediately follow the d\dd operators are our independent/control variables, which are SS, VV, and nin_i, whereas TT, PP, μi\mu_i and UU are dependent variables.

Step 2

For clarity, let’s change one control variable at a time. One can either choose to change from SS to TT first, or change from VV to PP first. Here, we choose to change from VV to PP first.

After such a change, the new potential should depend on (S,P,ni)(S, P, n_i), with its differential form looking something like the following expression

d[?]=TdS±[??]dP+iμidni\dd \text{[?]}=T\dd S \pm \text{[??]}\dd P + \sum_i \mu_i \dd n_i

where [?] is this new thermodynamic potential, [??] is the unknown variable in front of dP\dd P, and ± sign just means that for now, we don’t know if the sign before [??]dP\text{[??]}\dd P term should be a ++ sign or a - sign.

For now, since we are only change one independent variable from VV to PP, while fixing the other two independent variables where dS=0\dd S=0 and dni=0\dd n_i=0, Equation 2.3.3 can be simplified as

dUS,ni=(UV)S,nidV=PdV\dd U\big|_{S, n_i} = \left(\frac{\partial U}{\partial V}\right)_{S, n_i} \dd V = -P \dd V

which means that if we were to plot U(V)U(V) at constant SS and nin_i, the UU vs. VV curve should be monotonically decreasing since PP should be a positive number, and from Equation 2.3.4, the first-order partial derivative of UU with respect to VV at constant SS and nin_i is thus negative. We can even learn about the second-order partial derivative of UU with respect to VV at constant SS and nin_i as follows

(2UV2)S,ni=[V(UV)S,ni]S,ni=[V(P)]S,ni=(PV)S,ni\left(\frac{\partial^2 U}{\partial V^2}\right)_{S, n_i}=\left[\frac{\partial}{\partial V}\left(\frac{\partial U}{\partial V}\right)_{S, n_i}\right]_{S, n_i}=\left[\frac{\partial}{\partial V}\left(-P\right)\right]_{S, n_i}=-\left(\frac{\partial P}{\partial V}\right)_{S, n_i}

We can use physical intuition to figure out the sign of this second-order partial derivative. At constant SS and nin_i, we have an adiabatic system that also doesn’t allow exchange of matter (e.g., a thermally insulated piston). For an infinitesimal increase in volume, we would expect the infinitesimal change in pressure of this system to be a decrease. This means that (P/V)S,ni<0(\partial P/\partial V)_{S, n_i}<0, and thus

(2UV2)S,ni=(PV)S,ni>0\left(\frac{\partial^2 U}{\partial V^2}\right)_{S, n_i}=-\left(\frac{\partial P}{\partial V}\right)_{S, n_i}>0

Now, to transform from U(V)S,niU(V)\big|_{S, n_i} to [?](P)S,ni\text{[?]}(P)\big|_{S, n_i}, we need to utilize a mathematical transformation called the Legendre transformation.

To make this more concrete, let’s use the example from U(S,V,ni)U(S, V, n_i) to [?](S,P,ni)\text{[?]}(S, P, n_i). According to Equation 2.3.9,

[?](S,P,ni)=U(S,V,ni)(UV)S,niV\text{[?]}(S, P, n_i) = U(S, V, n_i) - \left(\frac{\partial U}{\partial V}\right)_{S, n_i}\cdot V

From Equation 2.3.4, we know (U/V)S,ni=P(\partial U/\partial V)_{S, n_i}=-P, thus we have

[?](S,P,ni)=U(S,V,ni)(P)V=U(S,V,ni)+PV\text{[?]}(S, P, n_i) = U(S, V, n_i) - (-P)\cdot V = U(S, V, n_i) + PV

By convention, we name this new thermodynamic potential as the enthalpy HH.

H=U+PVH = U + PV

We can verify that HH only depends on SS, PP and nin_i by writing out its total differential expression

dH=d(U+PV)=dU+d(PV)=dU+PdV+VdP=(TdSPdV+iμidni)+PdV+VdPdH=TdS+VdP+iμidni\begin{align} \dd H &= \dd (U+PV)\\ &=\dd U + \dd (PV)\\ &=\dd U + P\dd V + V\dd P\\ &=\left(T\dd S-\cancel{P\dd V}+\sum_i \mu_i \dd n_i\right)+ \cancel{P\dd V} + V\dd P\\ \dd H&=T\dd S + V\dd P + \sum_i \mu_i \dd n_i \end{align}

We can see that the independent variables of HH are indeed SS, PP and nin_i, with no VV dependence. Here, we also note that there is a new definition of chemical potential when SS, PP, and njin_{j\neq i} are held constant.

μi=(Hni)S,P,nji\mu_i = \left(\frac{\partial H}{\partial n_i}\right)_{S, P, n_{j\neq i}}

Geometric Interpretation

There is also a geometric interpretation of the Legendre transformation formula

H=U(UV)S,niVH=U - \left(\frac{\partial U}{\partial V}\right)_{S, n_i}\cdot V

The left panel in the interactive figure below plots U(V)U(V) with (U/V)S,ni<0(\partial U/\partial V)_{S, n_i}<0 and (2U/V2)S,ni>0(\partial^2 U/\partial V^2)_{S, n_i}>0, as derived before. At constant SS and nin_i, if one were to pick any point along this UU vs. VV curve, which we can denote as (V0,U0)(V_0, U_0), the partial derivative of UU with respect to VV, evaluated at V0V_0, is the instantaneous tangent slope of U(V)U(V) at this specific point. If we extend a tangent line all the way to V=0V=0, we will find that the product between the partial derivative and VV, evaluated at this specfic point, becomes (UV)S,niV0V0=ΔU0ΔV0(V00)=ΔU0\left(\frac{\partial U}{\partial V}\right)_{S, n_i}\big|_{V_0}\cdot V_0 = \frac{\Delta U_0}{\Delta V_0}\cdot (V_0-0)=\Delta U_0. Then, H0=U0ΔU0H_0 = U_0 - \Delta U_0, where H0H_0 is the intercept between the tangent line and the V=0V=0 vertical axis, denoted by the green dot in the left panel of the interactive plot. If one were to trace out the path traversed by HH as a function of PP, we obtained the line plotted in the right panel.

Source:Legendre Transformation

Step 3

Now, all that’s left is to transform the remaining independent variable from SS to TT since not only is SS hard to control, but also difficult to measure/quantify in the first place. Again by convention, we name this new thermodynamic potential as the Gibbs free energy, denoted by GG. Following the general recipe of the Legendre transformation, we subtract from HH with the product between the initial indepdendent variable (SS) and the partial derivative of HH with respect to TT, while holding all other independent variable constant.

G=H(HS)P,niSG=H-\left(\frac{\partial H}{\partial S}\right)_{P, n_i}\cdot S

From Equation 2.3.13, we know that (HS)P,ni=T\left(\frac{\partial H}{\partial S}\right)_{P, n_i}=T. Thus, we conclude

G=HTS=U+PVTS\begin{aligned} G &= H-TS \\ &= U + PV - TS \end{aligned}

Again, we can verify that GG only depends on TT, PP and nin_i by taking its total differential form,

dG=d(HTS)=dH(TdS+SdT)=(TdS+VdP+iμidni)TdSSdTdG=SdT+VdP+iμidni\begin{aligned} \dd G &= \dd (H-TS) \\ &= \dd H - (T\dd S + S \dd T) \\ &= \left(\cancel{T\dd S} + V\dd P + \sum_i \mu_i \dd n_i\right) - \cancel{T\dd S} - S \dd T\\ \dd G &= -S\dd T + V\dd P + \sum_i \mu_i \dd n_i \end{aligned}

Similar to the alternative definition of chemical potential in Equation 2.3.14, at constant TT, PP and njin_{j\neq i}, the chemical potential is defined as

μi=(Gni)T,P,nji\mu_i = \left(\frac{\partial G}{\partial n_i}\right)_{T, P, n_{j\neq i}}

In most real-world chemical reactions, TT and PP are held constant while all nin_i terms are allowed to vary. Under this scenario, we get

dGT,P=iμidni\dd G\big|_{T, P} = \sum_{i}\mu_i \dd n_i

The significance of Equation 2.3.20 will become apparent in the next section. For now, let’s recap two important lessons that we’ve learned so far.

  1. The chemical potential of species ii can be defined as partial molar quantities of different thermodynamic potentials under different control variables, but these definitions are all equivalent.
μi=(Uni)S,V,nji=(Hni)S,P,nji=(Fni)T,V,nji=(Gni)T,P,nji\mu_i = \left(\frac{\partial U}{\partial n_i}\right)_{S, V, n_{j\neq i}} = \left(\frac{\partial H}{\partial n_i}\right)_{S, P, n_{j\neq i}} = \left(\frac{\partial F}{\partial n_i}\right)_{T, V, n_{j\neq i}} = \left(\frac{\partial G}{\partial n_i}\right)_{T, P, n_{j\neq i}}
  1. Legendre transformation allows us to transform from existing thermodynamic potentials to new ones with a different set of control variable.

The transformation path that is demonstrated here is

U(S,V,ni)+PVH(S,P,ni)TSG(T,P,ni)U(S, V, n_i) \xrightarrow{+PV} H(S, P, n_i) \xrightarrow{-TS} G(T, P, n_i)

There is also an alternative transformation path as follows

U(S,V,ni)TSF(T,V,ni)+PVG(T,P,ni)U(S, V, n_i) \xrightarrow{-TS} F(T, V, n_i) \xrightarrow{+PV} G(T, P, n_i)

These two paths yield the same final Gibbs free energy potential, as shown in Figure 2.3.4

Source:Legendre Transformation

Figure 2.3.4:3D visualization of Legendre transformation from U(S,V,ni)U(S, V, n_i) to G(T,P,ni)G(T, P, n_i)

3D Legendre transformation from U(S,V)U(S, V) to G(T,P)G(T, P)

Why is it called Gibbs “free” energy

Some of you may wonder: why do we refer to these thermodyanmic potentials as “free” energies? Here is a spoiler alert: with some simple mathematical derivations, we will see that “free” here actually mean available or usable.

Let’s consider a system, as shown in Figure 2.3.6, that consists of a piston filled with ideal gas in contact with a infinite heat and mechanical work reservoir. We label the piston system with the subscript sys_{\text{sys}}, and the reservoir with the subscript res_{\text{res}}. Both TT and PP of the system and the reservoir remain constant. If we also fix nin_i, along with TT and PP, no change in the system’s volume can happen, leading to no expansion or compression work done. By allowing nin_i to vary, according to Equation 2.2.3,

Wchemical=iμidniW_{\text{chemical}} = -\sum_i \int \mu_i \dd n_i
An isolated system composed of a piston system, a heat reservoir and a work reservoir.

Figure 2.3.6:An isolated system composed of a piston system, a heat reservoir and a work reservoir.

Since we assume the piston and the reservoir to make up a larger isolated system, due to the conservation of the internal energy, any change in the internal energy of the piston system must balance out the change in that of the reservoir.

dUiso=0=dUsys+dUres\dd U_{\text{iso}}=0=\dd U_{\text{sys}} + \dd U_\text{res}

By expanding out the terms in both dUsys\dd U_{\text{sys}} and dUres\dd U_\text{res}, we have

dUsys=TdSsysPdVsys+iμidnidUres=TdSresPdVresδWother res\begin{aligned} \dd U_{\text{sys}} &= T\dd S_{\text{sys}} - P\dd V_{\text{sys}} + \sum_i \mu_i \dd n_i \\ \dd U_{\text{res}} &= T\dd S_{\text{res}} - P\dd V_{\text{res}} - \delta W_{\text{other res}} \end{aligned}

where δW\delta W is the infinitesimal change in the work, and δ is used to denote an infinitesimal change for a non-state variable like work. For the reservoir, since we know there would be no reaction happening in the reservoir, there is no chemical work. In addition to mechanical/expansion work and chemical work, all forms of work (e.g., electrical, magnetic work) other than “PVPV” mechanical work are represented by δWother res\delta W_{\text{other res}}. Plugging in terms and rearranging for δWother res\delta W_{\text{other res}}, we have

δWother res=T(dSsys+dSres)P(dVsys+dVres)+iμidni\delta W_{\text{other res}} = T(\dd S_{\text{sys}}+\dd S_{\text{res}}) - P(\dd V_{\text{sys}} + \dd V_{\text{res}}) + \sum_i \mu_i \dd n_i

If we assume all processes happens reversibly in this isolated system, there is no net entropy production dSiso=0=dSsys+dSres\dd S_{\text{iso}} = 0 = \dd S_{\text{sys}}+\dd S_{\text{res}}, and intuitively we know the total volume of an isolated system stays constant, dViso=0=dVsys+dVres\dd V_{\text{iso}} = 0 = \dd V_{\text{sys}}+\dd V_{\text{res}}. Then we have

δWother res=iμidni\delta W_{\text{other res}} = \sum_i \mu_i \dd n_i

If TT and PP are held constant, and by comparing with Equation 2.3.20, we can then conclude

δWother res=iμidni=dGT,P\delta W_{\text{other res}} = \sum_i \mu_i \dd n_i = \dd G\big|_{T, P}

In a nutshell, dGT,P\dd G\big|_{T, P} is the maximum amount of non-PVPV work that is available to be extracted from the system, at constant TT and PP, when the system is coupled to other forms of external reservoirs. In a fuel cell, TT and PP can be controlled and maintained. As a result, dGT,P\dd G\big|_{T, P} is used to determine the upper theoretical limit of non-PVPV work available to be used/extracted from the system.

Colin Ophus Lab | StanfordColin Ophus Lab | Stanford
Understanding materials, atom by atom — Colin Ophus Lab
Lab Group Website by Curvenote