When to include chemical potential in Gibbs equations? I'm struggling to understand when to and when not to include the chemical potential in the differential forms of the thermodynamic potentials. In principle I would assume that any system wherein the number of particles or the composition is changing should include the term - however I have run into two issues.


*

*Whilst studying thermochemistry, my lecturer was quick to bring up some old results from thermodynamics, that the heat of an isobaric process corresponds to the enthalpy change and the heat of an isochoric process corresponds to the internal energy change.


A quick 'derivation' shows this :
$dH=TdS+VdP$ which at constant pressure becomes $dH=TdS=q_P$ however, had we included the chemical potential we would have obtained 
$$dH=TdS+\sum_i\mu_idn_i=q_P+\sum_i\mu_idn_i$$Thus when interpreting $\Delta H$ as heat of reaction under constant pressure, are we not ignoring the effects of composition on H?


*Earlier, when chemical potential was first being introduced in my Pchem class - a derivation of the condition of spontaneity for transport between phases was put forward:$$dG=-SdT+VdP+\sum_i\sum_j\mu_i^jdn_i^j$$ and from the second law we know that for an irreversible process $dG<-SdT+VdP$, thus:
$$\sum_i\sum_j\mu_i^jdn_i^j<0$$ However, I would argue that this formulation of the second law is not accurately accounting for chemical potential. Consider the more general $TdS\geqq dq$, and the first law $dU=dq+dw$, one obtains that $dG\leqq VdP-SdT+w_{non-PV}$ which to reproduce the first equation in the case of a reversible proces, I would identify that $$w_{non-PV}=\sum_i\sum_j\mu_i^jdn_i^j \rightarrow dG\leqq -SdT+VdP+\sum_i\sum_j\mu_i^jdn_i^j$$
Of course with this result you can no longer figure out the condition of spontaneity this way as you simply get $0<0$. Furthermore wouldn't the lecturer's original derivation technically be applying both a relation that holds specifically for reversible processes and one for irreversible processes together? When it came to entropy as a condition for spontaneity in isolated systems - we knew that only reversible or irreversible pathways existed between two states but not both, preventing such potential contradictions. Though I'm uncertain if a similar interpretation can be made for the formulation in terms of Gibbs energy.


Am I merely confusing myself with the interpretation of chemical potential as a form of non-PV work?
 A: *

*You are assuming $T\text{d}S =\delta Q$, which is only true if the process is internally reversible; in fact, the other expression, $\delta Q_P = \text{d}H_P$, is the general one, as it can be derived directly from the first law for an isobaric process with no "other" work:
\begin{align}
\text{d}U &= \delta Q - P \text{d}V - \delta W_\text{other}^\text{out}
\\
\text{d}U_P &= \delta Q_P - P \text{d}V_P - \underbrace{\delta W_\text{other}^\text{out}}_0
\\
\text{d}U_P + P \text{d}V_P &= \delta Q_P 
\\
\text{d}H_P &= \delta Q_P 
\end{align}
This expression holds for a closed system undergoing a process with no non-mechanical work or acceleration regardless of whether or not there are chemical reactions.

*You seem to be confusing expressions for $W_\text{non-$PV$}$ with extremum principles which are derived for the special case where $W_\text{non-$PV$}$ is fixed as zero.



Earlier, when chemical potential was first being introduced in my Pchem class - a derivation of the condition of spontaneity for transport between phases was put forward:$$dG=-SdT+VdP+\sum_i\sum_j\mu_i^jdn_i^j$$

This is true in general.

and from the second law we know that for an irreversible process $dG<-SdT+VdP$, thus:
  $$\sum_i\sum_j\mu_i^jdn_i^j<0$$ 

This is only true in the special case where $W_\text{non-$PV$} = 0$. Combining these results will just lead to the conclusion $W_\text{non-$PV$}= 0$, which was the starting point. 
Relationship between Chemical Potential and "Other" Work

Am I merely confusing myself with the interpretation of chemical potential as a form of non-PV work?

It seems that you are. Although it is generally true that $\delta W_\text{mechanical} = P\text{d}V$, it is not generally true that $\delta W_\text{other} = \sum_i \mu_i \text{d}n_i$. 
The first law connects fluxes across the system boundary to property changes within the system; "other" work is a flux, while the chemical potential term is a property change:
\begin{align}
\overbrace{\delta Q \underbrace{- P\text{d} V - \delta W_\text{other}}_{-\delta W}}^\text{$\text{d}U$ in terms of fluxes}
&=
\overbrace{T\text{d}S - P\text{d}V + \sum_i \mu_i \text{d}n_i}^\text{$\text{d}U$ in terms of properties}
\end{align}
I imagine that you are thinking that $\delta W_\text{other}$ must equal $\sum_i \mu_i \text{d}n_i$ in order to be able to derive the Gibbs Equation, but this is not the case - they aren't equal, and the Gibbs Equation is derived in a different way. 
Deriving the Gibbs Equation from the First Law
The easiest way I know to derive the Gibbs Equation for $U$ from the First Law is to consider a process in which $\delta W_\text{other} = 0$ and the composition is changed by reversibly adding/removing chemical components rather than by chemical reactions (diffusion becomes reversible in the limit where the driving concentration gradient approaches zero, just as heat transfer becomes reversible in the limit where the temperature gradient approaches zero). Since this process is reversible, we can say $\delta Q = T \text{d}S$. If we define the chemical potential of species $i$, $\mu_i$, as
$$
\mu_i \equiv \left( \frac{\partial U}{\partial n_i} \right)_{S,V,n_{j\neq i}}
$$
then we can conclude that total $U$ added to the system by mass transfer in this model process is $\sum_i \mu_i \text{d}n_i$, and thus
$$
\text{d}U_\text{model process} = \underbrace{T \text{d} S}_\text{Heat} - \underbrace{P \text{d} V}_\text{Work} + \underbrace{\sum_i \mu_i \text{d} n_i}_\text{Mass Transfer}
$$
Since $U$ is a property (as opposed to a flux), changes in $U$ depend only on the initial and final states (not on the path between them), so we can conclude that for any arbitrary process - even one involving "other" work or chemical reactions - the expression 
$$
\text{d}U = T \text{d} S - P \text{d} V + \sum_i \mu_i \text{d} n_i
$$
continues to hold. Note that the labelling of the individual terms as heat, work, and transfer by mass is specific to the model process; in general, we can't identify the individual terms in the equation with fluxes - we can just identify the sum of the terms with the sum of the fluxes.
