# Integrate $\int_{p_1}^{p_2}(\frac {\partial G}{\partial p})_T$ with respect to p given that G is a state function

The equations discussed below apply to thermodynamics but the question is mathematical: $$dG=(\frac {\partial G}{\partial p})_T+(\frac {\partial G}{\partial T})_p$$ The above is an exact differential. Firstly what does this mean physically? (I hear about the fact that a change in G is independent of the "path" but I don't understand this argument because I don't know what is meant by this path. Also how would something be dependent on the path?)

It can also be shown that $dG$ can be written: $$dG=Vdp-SdT$$

So by comparing coefficients: $$(\frac {\partial G}{\partial p})_T=V$$ It is useful to integrate this to see how G varies with p: $$\int_{p_1}^{p_2}(\frac {\partial G}{\partial p})_Tdp=\int_{p_1}^{p_2}Vdp$$ $V$ can be expressed in terms of $p$ using the equation $V=\frac{nRT}p$ Where $nRT$ are constants. The above equation becomes: $$\int_{p_1}^{p_2}(\frac {\partial G}{\partial p})_Tdp=nRT\int_{p_1}^{p_2}\frac{dp}p$$ Integrating the LHS of the above equation is the crux of my question (I don't understand how that can be integrated). I am not sure whether the following step is correct mathematically, please explain why this is correct/incorrect. I cancel out the $dp$'s on the LHS: $$\int_{p_1}^{p_2}dG=nRT\int_{p_1}^{p_2}\frac{dp}p$$ Then the result is: $$G(p_2)-G(p_1)=nRT\ln(\frac{p_2}{p_1})$$ Or... $$\triangle G=nRT\ln(\frac{p_2}{p_1})$$ This result is correct but I don't understand the left hand side. I've been told that the reason it's possible to write "$G(p_2)-G(p_1)$" or "$\triangle G$" is because $G$ is a state function/exact differential but, again, I don't understand this. If $G$ was not a state function/exact differential how would the result change?

First and foremost, we need to agree on what a state function is. I suppose you're taking a thermodynamics course right now and that you already know that $S, U, V, T, P, F, G, H$ are state variables. An equilibrium state of a thermodynamical system is entirely determined by two state variables and so the other state variables become state functions. Each of the thermodynamic potentials $U, F, H, G$ has its own natural variables, a state function $U(S,V)$ contains the complete thermodynamic information about the given system. For a state function, we define its differential by

$$dA(B,C) = \left(\frac{\partial A}{\partial B}\right)_C dB + \left(\frac{\partial A}{\partial C}\right)_B dC.$$

You can think of this as a differential form (an outer derivative of a function), but in thermodynamics the theory is rather special; they are called Pfaffian forms. You can define path integrals in the space of state variables of these forms and think of them as integrals of 1-forms over 1-surfaces (paths, curves) in two dimensional space (not sure whether you're familiar with the calculus of differential forms and the Stokes theorem at this point). The fact that the change in a state function between two states is independent of the path you take is a simple consequence of what is called the general Stokes theorem for differential forms (This theorem is very general; its simplest application is potential theory $\nabla \times E = 0 \iff (\exists \phi) \; E = -\nabla \phi$). Since a state function can be expressed as an exact differential, it has all of the properties you were told about. For the exact formulation of the theorem, refer to your textbook, or something about potential theory. If you want to dig deeper on this in your free time, find more about the work of Pfaff, Caratheodory and a textbook about the calculus of differential forms.

To answer your questions in a concrete manner, the reason why you can write

$$dG = \left(\frac{\partial G}{\partial p}\right)_T dp$$

is because you're assuming temperature $T$ to be constant during the process you're considering. Thus $dT = 0$ and the formula for the exact differential of $G(T,P)$ simplifies.

To address your question in a broader sense: I understand you might be asking why do state functions have these special properties. To answer that you need to go revise the foundations of thermodynamics, its four postulates to be exact. The properties we are discussing here arise from the requirements we impose on internal energy/entropy (depends on what side we are approaching matters from), namely the requirement that entropy/internal energy be extensive and the equilibrium values of the extensive parameters of a system ($U,V$ in case of the $S(U,V)$ approach) be such that they maximise entropy of the system. I recommend you pick up H. Callen - Thermodynamics and an Introduction to Thermostatistics.