The First Law of thermodynamics is:
The increase of the internal energy of a system is equal to the sum of the heat added to the system plus the work done on the system.
\[ d U=d Q+d W\]
You may regard this, according to taste, as any of the following
A fundamental law of nature of the most profound significance;
or A restatement of the law of conservation of energy, which you knew already;
or A recognition that heat is a form of energy.
or A definition of internal energy.
Note that some authors use the symbol E for internal energy. The majority seem to use U, so we shall use U here.
Note also that some authors write the first law as dU = dQ − dW, so you have to be clear what the author means by dW. A scientist is likely to be interested in what happens to a system when you do work on it, and is likely to define dW as the work done on the system, in which case dU = dQ + dW. An engineer, in the other hand, is more likely to be asking how much work can be done by the system, and so will prefer dW to mean the work done by the system, in which case dU = dQ − dW.
The internal energy of a system is made up of many components, any or all of which may be increased when you add heat to the system or do work on it. If the system is a gas, for example, the internal energy includes the translational, vibrational and rotational kinetic energies of the molecules. It also includes potential energy terms arising from the forces between the molecules, and it may also include excitational energy if the atoms are excited to energy levels above the ground state. It may be difficult to calculate the total internal energy, depending on which forms of energy you take into account. And of course the potential energy terms are always dependent on what state you define to have zero potential energy. Thus it is really impossible to define the total internal energy of a system uniquely. What the first law tells us is the increase in internal energy of a system when heat is added to it and work is done on it.
Note that internal energy is a function of state. This means, for example in the case of a gas, whose state is determined by its pressure, volume and temperature, that the internal energy is uniquely determined (apart from an arbitrary constant) by P, V and T – i.e. by the state of the gas. It also means that in going from one state to another (i.e. from one point in PVT space to another), the change in the internal energy is route-independent. The internal energy may be changed by performance of work or by addition of heat, or some combination of each, but, whatever combination of work and energy is added, the change in internal energy depends only upon the initial and final states. This means, mathematically, that dU is an exact differential (see Chapter 2, Section 2.1). The differentials dQ and dW, however, are not exact differentials.
Note that if work is done on a Body by forces in the Rest of the Universe, and heat is transferred to the Body from the Rest of the Universe (also known as the Surroundings of the Body), the internal energy of the Body increases by dQ + dW, while the internal energy of the Rest of the Universe (the Surroundings) decreases by the same amount. Thus the internal energy of the Universe is constant. This is an equivalent statement of the First Law. It is also sometimes stated as “Energy can neither be created nor destroyed”.