# Gibbs free energy and maximum work

I'm getting confused between two important results.

The Gibbs free energy is $G = H-TS$ where $H$ is the enthalpy and $S$ is the entropy. When the temperature and pressure are constant the change in the Gibbs energy represents maximum net work available from the given change in system .

But $dG = VdP-SdT$, so at constant temperature and pressure i'm getting $dG=0$. This is the criteria for phase equilibria. I'm getting Gibbs free energy change at constant $T$ and $P$ as maximum work in one relation and zero in another. How are these compatible?

• G = H - TS is not defined at any particular temperature, as G = f(T,P). In fact G = H - TS is itself a definition. It is only when you are attempting to find $\Delta{G}$ of a reaction then you need to keep the temperature and pressure constant, as G=f(T,P), so you'll want your $\Delta{G}$ to measure only the change in Gibbs energy during a reaction at that particular temp and pressure. The differential form could easily be derived from dU = TdS - PdV and H = U + PV. – t.c Oct 6 '14 at 6:42

There is no contradiction here. The change in Gibbs free energy tells you the maximum extractable work and at constant teperature and pressure $dG = 0$. The conclusion here is that you can extract no work while maintaining a fixed temperature and pressure.

Why is this? Well you have 5 variables in your thermodynamic system $U, p, V, T$ and $S$. We can replace $U$ with $G$ in our list using $G = U +pV - TS$. Now we know from the fundamental relation that \begin{align} G &= G(p,T)\\ V &= \left(\frac{\partial G}{\partial p}\right)_T\\ S &= \left(\frac{\partial G}{\partial T}\right)_p \end{align}

So we have 5 variables and 3 constraint, leaving us with 2 degrees of freedom in our system. If we now impose another 2 constants, say by fixing $p$ and $T$, we have fully defined the state of our system. This means under these conditions we can extract no work because there is no other state we can move to in the transition.

If we do want to extract some useful work from our system there are 2 things we can do; either we can relax one of our constraints, say by allowing temperature to vary, or we can introduce additional physical degrees of freedom to the system, for example by allowing particle number to vary, and modify the expression for the change in $G$ accordingly, as @higgsss describes in they're answer.

It means that there exists a third variable, say, $X$, describing the system. The corresponding thermodynamic relation should be \begin{equation} dG = VdP - SdT + \bigg(\frac{\partial G}{\partial X}\bigg)_{P,T} dX. \end{equation}

If $X$ is not fixed, the system at constant $T$ and $P$ adjusts itself such that $G$ is minimized with respect to $X$. Then, $(\partial G/\partial X)_{P,T} = 0$, leading to $dG = 0$ even if $X$ changes by a small amount $dX$.

Now suppose that one controls the system to make it go through a thermodynamic process involving a change in $X$. During this process, the non-expansive work the system does on the outside is less than or equal to $-\Delta G$ (equal in a reversible process).

For example, consider a battery. The decrease in its Gibbs free energy from the fully charged state to the completely discharged state is equal to the maximum (ideal) electrical work the battery can do. In this case, the variable "$X$" is a measure of how far the chemical reaction inside the battery has proceeded.

The math derivation can be made below $$G=H-TS$$ $$dG = dH -d(TS)$$ $$dG = d(U+PV) -d(TS)$$ $$dG = dU + PdV +VdP -TdS - SdT$$

at constant pressure and temperature, $dP=0$, $dT=0$, $$dG = dU + PdV -TdS$$

From above, we know dG decreases when internal energy is transferred out, system does work and system entropy increases.

• Because $dU = TdS - PdV$, what you have proved is, in effect, that $dG = 0$. – higgsss Apr 9 '18 at 15:29