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.Crawford, F. H. (1963), pp. 106–107.Haase, R. (1971), pp. 24–28.
The internal energy of a system can be increased by introduction of matter, by heat, or by doing thermodynamic work on the system.Max Born (1949), Appendix 8, pp. 146–149. When matter transfer is prevented by impermeable containing walls, the system is said to be Closed system 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 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 massenergy 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, , and oscillation, 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).
Each cardinal function is a monotonic function of each of its natural or canonical variables. Each provides its characteristic or fundamental equation, for example , 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, for , to get .
In contrast, Legendre transforms are necessary to derive fundamental equations for other thermodynamic potentials and . 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.Münster, A. (1970), Chapter 3.Bailyn, M. (1994), pp. 206–209.
For real and practical systems, explicit expressions of the fundamental equations are almost always unavailable, but the functional relations exist in principle. Formal, in principle, manipulations of them are valuable for the understanding of thermodynamics.
From a nonrelativistic microscopic point of view, it may be divided into microscopic potential energy, , and microscopic kinetic energy, , components:
The microscopic kinetic energy of a system arises as the sum of the motions of all the system's particles with respect to the centerofmass frame, whether it be the motion of atoms, molecules, atomic nuclei, electrons, or other particles. The microscopic potential energy algebraic summative components are those of the Chemical energy and nuclear particle bonds, and the physical force fields within the system, such as due to internal induced electric or magnetism dipole moment, as well as the energy of deformation of solids (stressstrain). Usually, the split into microscopic kinetic and potential energies is outside the scope of macroscopic thermodynamics.
Internal energy does not include the energy due to motion or location of a system as a whole. That is to say, it excludes any kinetic or potential energy the body may have because of its motion or location in external , electrostatics, or electromagnetics fields. It does, however, include the contribution of such a field to the energy due to the coupling of the internal degrees of freedom of the object with the field. In such a case, the field is included in the thermodynamic description of the object in the form of an additional external parameter.
For practical considerations in thermodynamics or engineering, it is rarely necessary, convenient, nor even possible, to consider all energies belonging to the total intrinsic energy of a sample system, such as the energy given by the equivalence of mass. Typically, descriptions only include components relevant to the system under study. Indeed, in most systems under consideration, especially through thermodynamics, it is impossible to calculate the total internal energy.I. Klotz, R. Rosenberg, Chemical Thermodynamics  Basic Concepts and Methods, 7th ed., Wiley (2008), p.39 Therefore, a convenient null reference point may be chosen for the internal energy.
The internal energy is an extensive property: it depends on the size of the system, or on the amount of substance it contains.
At any temperature greater than absolute zero, microscopic potential energy and kinetic energy are constantly converted into one another, but the sum remains constant in an isolated system (cf. table). In the classical picture of thermodynamics, kinetic energy vanishes at zero temperature and the internal energy is purely potential energy. However, quantum mechanics has demonstrated that even at zero temperature particles maintain a residual energy of motion, the zero point energy. A system at absolute zero is merely in its quantummechanical ground state, the lowest energy state available. At absolute zero a system of given composition has attained its minimum attainable entropy.
The microscopic kinetic energy portion of the internal energy gives rise to the temperature of the system. Statistical mechanics relates the pseudorandom kinetic energy of individual particles to the mean kinetic energy of the entire ensemble of particles comprising a system. Furthermore, it relates the mean microscopic kinetic energy to the macroscopically observed empirical property that is expressed as temperature of the system. This energy is often referred to as the thermal energy of a system, Thermal energy – Hyperphysics relating this energy, like the temperature, to the human experience of hot and cold.
Statistical mechanics considers any system to be statistically distributed across an ensemble of N microstates. Each microstate has an energy E_{i} and is associated with a probability p_{i}. The internal energy is the mean value of the system's total energy, i.e., the sum of all microstate energies, each weighted by their probability of occurrence:
For a closed system, with matter transfer excluded, the changes in internal energy are due to heat transfer and due to work. The latter can be split into two kinds, pressurevolume work , and frictional and other kinds, such as electrical polarization, which do not alter the volume of the system, and are called isochoric, . Accordingly, the internal energy change for a process may be written
When a closed system receives energy as heat, this energy increases the internal energy. It is distributed between microscopic kinetic and microscopic potential energies. In general, thermodynamics does not trace this distribution. In an ideal gas all of the extra energy results in a temperature increase, as it is stored solely as microscopic kinetic energy; such heating is said to be Sensible heat.
A second mechanism of change of internal energy of a closed system is the doing of work on the system, either in mechanical form by changing pressure or volume, or by other perturbations, such as directing an electric current through the system.
If the system is not closed, the third mechanism that can increase the internal energy is transfer of matter into the system. This increase, cannot be split into heat and work components. If the system is so set up physically that heat and work can be done on it by pathways separate from and independent of matter transfer, then the transfers of energy add to change the internal energy:
If a system undergoes certain phase transformations while being heated, such as melting and vaporization, it may be observed that the temperature of the system does not change until the entire sample has completed the transformation. The energy introduced into the system while the temperature did not change is called a latent energy, or latent heat, in contrast to sensible heat, which is associated with temperature change.
Therefore, internal energy changes in an ideal gas may be described solely by changes in its kinetic energy. Kinetic energy is simply the internal energy of the perfect gas and depends entirely on its pressure, volume and thermodynamic temperature.
The internal energy of an ideal gas is proportional to its mass (number of moles) n and to its temperature T
where c is the heat capacity (at constant volume) of the gas. The internal energy may be written as a function of the three extensive properties S, V, n (entropy, volume, mass) in the following way
where const is an arbitrary positive constant and where R is the Gas constant. It is easily seen that U is a linearly homogeneous function of the three variables (that is, it is extensive in these variables), and that it is weakly convex function. Knowing temperature and pressure to be the derivatives $T\; =\; \backslash frac\{\backslash partial\; U\}\{\backslash partial\; S\},$ $p\; =\; \backslash frac\{\backslash partial\; U\}\{\backslash partial\; V\},$ the ideal gas law $PV\; =\; nRT$ immediately follows.
Typically this relationship is expressed in infinitesimal terms using the differentials of each term. Only the internal energy is an exact differential. For a system undergoing only thermodynamics processes, i.e. a closed system that can exchange only heat and work, the change in the internal energy is
For example, for a nonviscous fluid, the mechanical work done on the system may be related to the pressure p and volume V. The pressure is the intensive generalized force, while the volume is the extensive generalized displacement:
and the change in internal energy becomes
This is useful if the equation of state is known.
In case of an ideal gas, we can derive that $dU\; =\; C\_V\; dT$, i.e. the internal energy of an ideal gas can be written as a function that depends only on the temperature.
The expression relating changes in internal energy to changes in temperature and volume is
The equation of state is the ideal gas law
Solve for pressure:
Substitute in to internal energy expression:
Take the derivative of pressure with respect to temperature:
Replace:
And simplify:
To express dU in terms of dT and dV, the term
is substituted in the fundamental thermodynamic relation
This gives:
The term $T\backslash left(\backslash frac\{\backslash partial\; S\}\{\backslash partial\; T\}\backslash right)\_\{V\}$ is the heat capacity at constant volume $C\_\{V\}.$
The partial derivative of S with respect to V can be evaluated if the equation of state is known. From the fundamental thermodynamic relation, it follows that the differential of the Helmholtz free energy A is given by:
The symmetry of second derivatives of A with respect to T and V yields the Maxwell relation:
This gives the expression above.
where it is assumed that the heat capacity at constant pressure is related to the heat capacity at constant volume according to:
The partial derivative of the pressure with respect to temperature at constant volume can be expressed in terms of the coefficient of thermal expansion
and the isothermal compressibility
by writing:
and equating dV to zero and solving for the ratio dp/dT. This gives:
Substituting (2) and (3) in (1) gives the above expression.
$dU\; =\; \backslash sum\_i\; E\_i\; dp\_i\; +\; \backslash sum\_i\; p\_i\; dE\_i$
$\backslash delta\; Q\; =\; \backslash sum\_i\; E\; \_\; \{\; i\; \}\; d\; p\; \_\; \{\; i\; \}$
$\backslash delta\; W\; =\; \backslash sum\_i\; p\_i\; dE\_i$
We obtain the first law of thermodynamics:
$dU\; =\; \backslash delta\; Q\; +\; \backslash delta\; W$
where N_{j} are the molar amounts of constituents of type j in the system. The internal energy is an extensive function of the extensive variables S, V, and the amounts N_{j}, the internal energy may be written as a linearly homogeneous function of first degree:
= \alpha U(S,V,N_{1},N_{2},\ldots)\,where α is a factor describing the growth of the system. The differential internal energy may be written as
which shows (or defines) temperature T to be the partial derivative of U with respect to entropy S and pressure p to be the negative of the similar derivative with respect to volume V
and where the coefficients $\backslash mu\_\{i\}$ are the chemical potentials for the components of type i in the system. The chemical potentials are defined as the partial derivatives of the energy with respect to the variations in composition:
The sum over the composition of the system is the Gibbs free energy:
where Einstein notation has been used for the tensors, in which there is a summation over all repeated indices in the product term. The Euler theorem yields for the internal energy:
For a linearly elastic material, the stress is related to the strain by:

