. For some simple materials, like an ideal gas, one can derive from basic theory the equation of state and even the specific internal energy In general, these functions must be determined experimentally for each substance. Conservation of energy The absolute value of this quantity is undefined, and (for the purposes of thermodynamics) the state of "zero internal energy" can be chosen arbitrarily. However, by the law of conservation of energy, any infinitesimal increase in the total internal energy must be matched by the net flow of heat energy into the sample, plus any net mechanical energy provided to it by enclosure or surrounding medium on it. The latter is , where is the change in the sample's volume in that infinitesimal step. Therefore hence If the volume of the sample (hence the specific volume of the material) is kept constant during the injection of the heat amount , then the term is zero (no mechanical work is done). Then, dividing by , where is the change in temperature that resulted from the heat input. The left-hand side is the specific heat capacity at constant volume of the material. For the heat capacity at constant pressure, it is useful to define the specific enthalpy of the system as the sum . An infinitesimal change in the specific enthalpy will then be therefore If the pressure is kept constant, the second term on the left-hand side is zero, and The left-hand side is the specific heat capacity at constant pressure of the material. Connection to equation of state In general, the infinitesimal quantities are constrained by the equation of state and the specific internal energy function. Namely, Here denotes the (partial) derivative of the state equation with respect to its argument, keeping the other two arguments fixed, evaluated at the state in question. The other partial derivatives are defined in the same way. These two equations on the four infinitesimal increments normally constrain them to a two-dimensional linear subspace space of possible infinitesimal state changes, that depends on the material and on the state. The constant-volume and constant-pressure changes are only two particular directions in this space. This analysis also holds no matter how the energy increment is injected into the sample, namely by heat conduction, irradiation, electromagnetic induction, radioactive decay, etc. Relation between heat capacities For any specific volume , denote the function that describes how the pressure varies with