In thermodynamics, the internal energy of a system is the total energy contained within the system. It is the energy necessary to create or prepare the system in any given state, but does not include the kinetic energy of motion of the system as a whole, nor the potential energy of the system as a whole due to external force fields which includes the energy of displacement of the system's surroundings. It keeps account of the gains and losses of energy of the system that are due to changes in its internal state.The expression relating changes in internal energy to changes in temperature and volume isTo express dU in terms of dT and dV, the termThe partial derivative of the pressure with respect to temperature at constant volume can be expressed in terms of the coefficient of thermal expansion In thermodynamics, the internal energy of a system is the total energy contained within the system. It is the energy necessary to create or prepare the system in any given state, but does not include the kinetic energy of motion of the system as a whole, nor the potential energy of the system as a whole due to external force fields which includes the energy of displacement of the system's surroundings. It keeps account of the gains and losses of energy of the system that are due to changes in its internal state. The internal energy of a system can be increased by introduction of matter, by heat, or by doing thermodynamic work on the system. When matter transfer is prevented by impermeable containing walls, the system is said to be closed and the first law of thermodynamics may be regarded as defining the internal energy as the algebraic sum of the 'heat added to' and 'work done by' the system on its surroundings. If the containing walls pass neither matter nor energy, the system is said to be isolated and its internal energy cannot change. The internal energy of a given state of a system cannot be directly measured and knowledge of all components is rarely interesting. Thermodynamics is chiefly concerned only with changes in the internal energy, not with its absolute value. Changes, relative to a reference state, are determined from convenient chains of thermodynamic operations and thermodynamic processes by which a given state can be prepared. Such a process can be described by certain extensive state variables of the system, for example, entropy, mole numbers, or electric dipole moment. For practical considerations in thermodynamics and engineering it is rarely necessary or convenient to consider all energies belonging to the total intrinsic energy of a system, such as the energy given by the equivalence of mass. Customarily, thermodynamic descriptions include only items relevant to the processes under study. The internal energy is one of the two cardinal state functions of the state variables, and its value depends only on the current state of the system and not on the processes undergone to prepare it. It is an extensive quantity. It is the one and only cardinal thermodynamic potential. All other thermodynamic potentials are formulated from the internal energy. In practical considerations in thermodynamics it is rarely necessary, nor convenient, to consider all intrinsic energies of a system, such as the energy given by the mass-energy equivalence. Conveniently, it can be explained in microscopic terms by the random kinetic energy due to the microscopic motion of the system's particles from translations, rotations, and vibrations, and by the potential energy associated with microscopic forces, including chemical bonds. In statistical mechanics, internal energy is the ensemble average of the sum of the microscopic kinetic and potential energies of the system. For study of thermonuclear reactions, the static rest mass energy of the constituents of matter are important. The unit of energy in the International System of Units (SI) is the joule (J). Sometimes it is convenient to use a corresponding intensive energy density, called specific internal energy, which is either relative to the mass of the system, with the unit J/kg, or relative to the amount of substance with unit J/mol (molar internal energy). The internal energy, U(S,V,{Nj}), expresses the thermodynamics of a system in the energy-language, or in the energy representation. As a function of state, its arguments are exclusively extensive variables of state. Alongside the internal energy, the other cardinal function of state of a thermodynamic system is its entropy, as a function, S(U,V,{Nj}), of the same list of extensive variables of state, except that the entropy, S, is replaced in the list by the internal energy, U. It expresses the entropy representation. Each cardinal function is a monotonic function of each of its natural or canonical variables. Each provides its characteristic or fundamental equation, for example U = U(S,V,{Nj}), that by itself contains all thermodynamic information about the system. The fundamental equations for the two cardinal functions can in principle be interconverted by solving, for example, U = U(S,V,{Nj}) for S, to get S = S(U,V,{Nj}). In contrast, Legendre transforms are necessary to derive fundamental equations for other thermodynamic potentials and Massieu functions. The entropy as a function only of extensive state variables is the one and only cardinal function of state for the generation of Massieu functions. It is not itself customarily designated a 'Massieu function', though rationally it might be thought of as such, corresponding to the term 'thermodynamic potential', which includes the internal energy.