In a thermodynamic process, entropy change from a state $a$ to $b$ is defined as $$ \int_{a}^{b}\frac{\delta Q_{rev}}{T} $$ But, there can be infinitely many reversible paths to reach $b$ from $a$. In general, the heat transfer $\delta Q_{rev}$ will be different for different paths taken. How does the temperature in the denominator make the integral i.e. change in entropy a path independent quantity? I tried to find a necessary condition by imposing that change in entropy should be a path independent function as follows: $$\Delta S =\int_{a}^{b}\frac{\delta Q_{rev}}{T} $$ $$\Delta S =\int_{a}^{b}\frac{ dU + \delta W}{T} $$
In terms of P and V, $$= \int_{a}^{b}\frac{ dU + P dV}{T} $$ Let's consider a path $P(V)$ in P V diagram from $a$ to $b$. Internal energy $U = U(P,V) = U(P(V),V)$ Temperature $T=T(P,V)=T(P(V),V)$ $$\Delta S= \int_{a}^{b}\frac{ dU(P,V) + P dV}{T(P,V)} = \int_{a}^{b}\frac{ \partial_P U(P,V) \frac{dP}{dV} dV + \partial_V U(P,V) dV + P dV}{T(P,V)}$$ Now if we perturb our path $P(V)$ to $P(V) + \delta P(V)$, keeping the end points fixed, $\Delta S$ should be the same. So the difference in $\Delta S$ should be zero i.e. $\delta (\Delta S)=0$ $$\delta (\Delta S) = \delta\int_{a}^{b}\frac{ dU(P,V) + P dV}{T(P,V)} $$ (The math is going somewhat similar to the stationary action principle except that in the stationary action principle, we find the path having stationary action but here we are imposing the condition on every path)
Let $$\frac{ \partial_P U(P,V) \frac{dP}{dV} + \partial_V U(P,V) + P }{T(P,V)} = L(P,P',V)$$, where $P'= \frac{dP(V)}{dV}$ $$\delta (\Delta S) = \int_{a}^{b}\delta L(P,P',V) dV$$ Writing down the first order changes: $$\delta (\Delta S) = \int_{a}^{b} \partial_P L(P,P',V)\delta P + \partial_{P'} L(P,P',V)\delta P' dV$$ $$0= \int_{a}^{b} (\partial_P L(P,P',V) - \frac{d\partial_{P'} L(P,P',V)}{dV})\delta P + \frac{d}{dV}(\partial_{P'} L(P,P',V)\delta P) dV$$ The end points are fixed so the last term in the integral will be zero. And becasue it is true for any perturbation $\delta P$ so $$\partial_P L(P,P',V) - \frac{d\partial_{P'} L(P,P',V)}{dV} = 0$$ This gives us $$\partial_P (\frac{\partial_P U}{T}) P' + \partial_P(\frac{\partial_V U + P}{T})=\frac{d}{dV}(\frac{\partial_P U}{T})$$ $$\partial_P (\frac{\partial_P U}{T}) P' + \partial_P(\frac{\partial_V U + P}{T})=\partial_P(\frac{\partial_P U}{T}) P' + \partial_V(\frac{\partial_P U}{T})$$ $$\partial_P(\frac{\partial_V U + P}{T})=\partial_V(\frac{\partial_P U}{T})$$
Is the last equation correct? If yes then, is the last equation a result of Maxwell's relations?