Where is the error in this change of entropy derivation?

The thermodynamic definition of entropy is $\mathrm{d}S \equiv \frac{\delta Q_{\mathrm{rev}}}{T}$ where $\delta Q_{\mathrm{rev}}$ is a strictly reversible "change" in heat. The second law of thermodynamics tells us that, for some irreversible change in heat $\delta Q_{\mathrm{irrev}}$, we will have $\mathrm{d}S \gt \frac{\delta Q_{\mathrm{irrev}}}{T}$. Additionally, the definition of heat capacity with some state variable $X$ held constant is $C_X \equiv \left(\frac{\partial Q}{\partial T}\right)_X$.

Now, I've been lead to believe that the above definition for heat capacity holds in all circumstances (with reversible heat flow and irreversible heat flow). With that in mind, let's look at the change in entropy $\Delta S_\textrm{rev}$ resulting from some reversible, constant $X$ process that starts in some state $A$ and ends in some other state $B$: $$\mathrm{d}S = \frac{\delta Q_{\mathrm{rev}}}{T} \implies \Delta S_\textrm{rev} = \int_A^B \frac{\delta Q_{\mathrm{rev}}}{T} = \int_A^B \frac{C_X \mathrm{d}T}{T}.$$ Consider also the change in entropy $\Delta S_\textrm{irrev}$ resulting from some irreversible, constant $X$ process that also starts in state $A$ and ends in state $B$: $$\mathrm{d}S > \frac{\delta Q_{\mathrm{irrev}}}{T} \implies \Delta S_\textrm{irrev} > \int_A^B \frac{\delta Q_{\mathrm{irrev}}}{T} = \int_A^B \frac{C_X \mathrm{d}T}{T}.$$ Entropy is a state variable and both the reversible process and irreversible process above begin in state $A$ and end in state $B$. Therefore, $\Delta S = \Delta S_\textrm{rev} = \Delta S_\textrm{irrev}$. However, my logic is clearly faulty somewhere as this means I've just shown $$\Delta S = \int_A^B \frac{C_X \mathrm{d}T}{T}$$ and $$\Delta S > \int_A^B \frac{C_X \mathrm{d}T}{T}.$$ Obviously these cannot both be true at the same time so where have I gone wrong? My statistical mechanics professor suggested that the definition for heat capacity at the top of my post is invalid for irreversible processes so my substitution $\delta Q_\textrm{irrev} = C_X \mathrm{d}T$ is incorrect. Is her explanation right? If it is, why is the usual definition for heat capacity invalid for irreversible processes? Is there any definition of heat capacity that is true for both reversible and irreversibly processes?

The problem is that heat Q is path dependent while heat capacity C is supposed to be a function of state (i.e., a unique physical property of the material), independent of path. So, even though they taught us in freshman physics that dQ=CdT, this relationship is no longer generally correct in the more complicated situations encountered in thermodynamics. The inconsistencies are overcome however when we modify the definition of heat capacity a little for use in thermodynamics, by defining heat capacity in terms of internal energy U and enthalpy H, both of which are functions of state: $$mC_v=\left(\frac{\partial U}{\partial T}\right)_V$$ $$mC_p=\left(\frac{\partial H}{\partial T}\right)_P$$ Another issue with your analysis is that, in applying the Clausius inequality to an irreversible process, the temperature T in the denominator is supposed to be the temperature at the boundary of the system through which the heat transfer $\delta Q_{irrev}$ is occurring (The temperature of the system is typically non-uniform spatially, and varies from location to location). So, more precisely, the Clausius inequality should read: $$\Delta S\geq\int{\frac{dQ}{T_B}}$$where $T_B$ is the temperature at the boundary through which the heat is passing.
• I completely agree with you. But that doesn't resolve the final issue the OP is having. The OP seems to understand this point. It doesn't resolve the contradiction of equality in one case and inequality in the other when they should both be the same (assuming $\Delta S$ should be change in entropy of just the system). – Aaron Stevens Sep 6 '18 at 9:17