the fundamental thermodynamic relation
The first law is about energy accounting (heat plus work), the second law is about entropy. The fundamental thermodynamic relation fuses them into a single differential equation that is, in a sense, all of equilibrium thermodynamics compressed into one line. It says how the internal energy of a system changes when its entropy, volume and particle content change.
It reads dU = T dS - p dV + sum mu_i dN_i. It is assembled from the first law dU = dQ - dW using, for a reversible path, dQ = T dS and dW = p dV, plus mu dN for particle exchange. Crucially, because U, S, V and N are all state functions, the relation among them holds for any process joining the same two equilibrium states, reversible or not — even though the individual identifications dQ = T dS and dW = p dV hold only along a reversible path.
This is the seed from which the whole formal structure grows: every thermodynamic potential (H, F, G, Omega) is a Legendre transform of it, and the Maxwell relations are its cross-derivatives. The subtle point students miss: the equation is exact and general, but reading T dS as 'heat' and p dV as 'work' is legitimate only for a reversible, quasi-static process.
Free expansion of an ideal gas into vacuum does no work and exchanges no heat, so dU = 0 and the temperature is unchanged. Yet the entropy rises by delta S = N k_B ln(V2/V1). The fundamental relation still applies because we compare the same initial and final equilibrium states — even though here Q = 0 is not T dS, since the process is irreversible.
The relation connects equilibrium states regardless of the (possibly irreversible) path between them.
dU = T dS - p dV holds between equilibrium states for any path, but T dS equals the heat and p dV the work only for a reversible process; for an irreversible one, dQ < T dS and the split shifts even though the totals still match.