= State function
{wiki}
A <state function> assigns a value to each equilibrium <thermodynamic state> of a specified <thermodynamic system>. Its change depends only on the initial and final states. <Internal energy> $U$, <entropy> $S$ and <enthalpy> $H=U+pV$ are <state functions>; here $p$ is <pressure> and $V$ is <volume (thermodynamics)>. Transferred <heat> $Q$ and <work> $W$ belong to a <thermodynamic process>, rather than to a state. A system stores <internal energy>; it does not store separate inventories of “heat received” and “work received”.<Thermodynamics and Propulsion>[Thermodynamics and Propulsion, §2.1, points 3–5 and equation 2.2: internal energy, transfer notation and signs]{ref}
Use the explicit convention $Q>0$ for <heat> entering and $W_{\rm by}>0$ for <work> done by the <thermodynamic system> on its surroundings. For a <closed system> with unchanged endpoint bulk <kinetic energy> and external <potential energy>, the <first law of thermodynamics> reads
$$
\Delta U=Q-W_{\rm by},\qquad dU=\delta Q-\delta W_{\rm by}.
$$
The notation $dU$ denotes an <exact differential> of a <state function>; $\delta Q$ and $\delta W_{\rm by}$ denote incremental transfers. Along a <reversible thermodynamic process> of a <simple compressible system>,
$$
\delta W_{\rm by,rev}=p\,dV,\qquad \delta Q_{\rm rev}=T\,dS,
$$
where $T$ is absolute <temperature>. These are rules for particular <thermodynamic processes>, not definitions of stored <heat> or stored <work>. In particular, a <quasistatic process> with <friction> can remain near <thermodynamic equilibrium> while producing <entropy>.<Thermodynamics and Propulsion>[Thermodynamics and Propulsion, §5.3: reversible transfer formulas distinguished from relations between state properties]{ref}
For any <state function> $F$ and two equilibrium states $A,B$, an <integral> of its <exact differential> gives
$$
\int_{A}^{B}dF=F(B)-F(A),\qquad \oint dF=0.
$$
The proof is telescoping: add the changes $F(x_{i+1})-F(x_i)$ along a subdivided path, and all intermediate values cancel. The smooth limit gives the <integral>. Conversely, if an integrable <differential form> has zero <integral> around every accessible closed path in a connected region, define $F(B)$ by integrating from a reference state. Two routes differ by a closed path, so the definition is unambiguous. This argument needs every accessible loop, rather than a local test that might miss a hole in the domain; see <path independence>.
The same cancellation does not hold separately for <heat> and <work>. A <thermodynamic cycle> has $\Delta U=0$ but can have nonzero net transfers, with $\oint\delta Q=\oint\delta W_{\rm by}$. Nor does the fact that <entropy> is a <state function> make $Q/T$ its general change: the formula $dS=\delta Q_{\rm rev}/T$ uses a <reversible thermodynamic process> and its varying <temperature>.
This distinction makes endpoint calculations powerful. We can compute an <internal energy>, <entropy> or <enthalpy> difference along a convenient reversible reference path even when the actual <thermodynamic process> is irreversible. Its actual <heat> and <work> must still be obtained from its own boundary interactions. The appealing cancellation is visible in <two reversible ideal-gas paths between the same states>: a different mechanical output requires a matching difference in thermal input, while stored <internal energy> arrives at the same value.
Back to article page