I've been working through the derivation of quantities like Gibb's free energy and internal energy, and I realised that I couldn't easily justify one of the final steps in the derivation.
For instance, in deriving the formula for Gibb's Free Energy, we first found the differential equation:
$$dG = dH - TdS$$
which has the property that, for spontaneous processes, $dG \leq 0$. We then went from there to defining the state function:
$$G = H - TS$$
and claimed that this had the analagous property that $\Delta G\leq0$ for all spontaneous processes. Apparently we can reason this way because the second equation can be obtained from the first by integration. But I'm not entirely sure of this. For instance, temperature is not necessarily independent of entropy, so I'm not convinced that $TS$ must be the integral of $TdS$. Physically I'm not convinced because the derivative refers to small changes at constant temperature, while the state function applies at all temperatures.
Wikipedia's Gibbs free energy page said that this part of the derivation is justified by 'Euler's Homogenous Function Theorem'. Now, I've done some work with ODE's before, but I've never seen this theorem, and I've been having trouble seeing how it applies to the derivation at hand.
If anyone can shed any light on the matter or recommend some further reading I'd appreciate it. Thanks