Energy appears in many forms, including thermal energy, or the energy associated with heat. Heat is internal thermal energy that flows from one body of matter to another—or, more specifically, from a system at a higher temperature to one at a lower temperature.
Two systems at the same temperature are said to be in a state of thermal equilibrium. When this occurs, there is no exchange of heat. Though people ordinarily speak of "heat" as an expression of relative warmth or coldness, in physical terms, heat only exists in transfer between two systems. It is never something inherently part of a system; thus, unless there is a transfer of internal energy, there is no heat, scientifically speaking.
Thus, heat cannot be said to exist unless there is one system in contact with another system of differing temperature. This can be illustrated by way of the old philosophical question: "If a tree falls in the woods when there is no one to hear it, does it make a sound?" From a physicist's point of view, of course, sound waves are emitted whether or not there is an ear to receive their vibrations; but, consider this same scenario in terms of heat. First, replace the falling tree with a hypothetical object possessing a certain amount of internal energy; then replace sound waves with heat. In this case, if this object is not in contact with something else that has a different temperature, it "does not make a sound"—in other words, it transfers no internal energy, and, thus, there is no heat from the standpoint of physics.
This could even be true of two incredibly "hot" objects placed next to one another inside a vacuum—an area devoid of matter, including air. If both have the same temperature, there is no heat, only two objects with high levels of internal energy. Note that a vacuum was specified: assuming there was air around them, and that the air was of a lower temperature, both objects would then be transferring heat to the air.
If heat is internal thermal energy in transfer, from whence does this energy originate? From the movement of molecules. Every type of matter is composed of molecules, and those molecules are in motion relative to one another. The greater the amount of relative motion between molecules, the greater the kinetic energy, or the energy of movement, which is manifested as thermal energy. Thus, "heat"—to use the everyday term for what physicists describe as thermal energy—is really nothing more than the result of relative molecular motion. Thus, thermal energy is sometimes identified as molecular translational energy.
Note that the molecules are in relative motion, meaning that if one were "standing" on a molecule, one would see the other molecules moving. This is not the same as movement on the part of a large object composed of molecules; in this case, molecules themselves are not directly involved in relative motion.
Put another way, the movement of Earth through space is an entirely different type of movement from the relative motion of objects on Earth—people, animals, natural forms such as clouds, manmade forms of transportation, and so forth. In this example, Earth is analogous to a "large" item of matter, such as a baseball, a stream of water, or a cloud of gas.
The smaller objects on Earth are analogous to molecules, and, in both cases, the motion of the larger object has little direct impact on the motion of smaller objects. Hence, as discussed in the Frame of Reference essay, it is impossible to perceive with one's senses the fact that Earth is actually hurling through space at incredible speeds.
The relative motion of molecules determines phase of matter—that is, whether something is a solid, liquid, or gas. When molecules move quickly in relation to one another, they exert a small electromagnetic attraction toward one another, and the larger material of which they are a part is called a gas. A liquid, on the other hand, is a type of matter in which molecules move at moderate speeds in relation to one another, and therefore exert a moderate intermolecular attraction.
The kinetic theory of gases relates molecular motion to energy in gaseous substances. It does not work as well in relation to liquids and solids; nonetheless, it is safe to say that—generally speaking—a gas has more energy than a liquid, and a liquid more energy than a solid. In a solid, the molecules undergo very little relative motion: instead of bumping into each other, like gas molecules and (to a lesser extent) liquid molecules, solid molecules merely vibrate in place.
As with heat, temperature requires a scientific definition quite different from its common meaning. Temperature may be defined as a measure of the average molecular translational energy in a system—that is, in any material body.
Because it is an average, the mass or other characteristics of the body do not matter. A large quantity of one substance, because it has more molecules, possesses more thermal energy than a smaller quantity of that same substance. Since it has more thermal energy, it transfers more heat to any body or system with which it is in contact. Yet, assuming that the substance is exactly the same, the temperature, as a measure of average energy, will be the same as well.
Temperature determines the direction of internal energy flow between two systems when heat is being transferred. This can be illustrated through an experience familiar to everyone: having one's temperature taken with a thermometer. If one has a fever, one's mouth will be warmer than the thermometer, and therefore heat will be transferred to the thermometer from the mouth until the two objects have the same temperature.
The principles of thermodynamics—the study of the relationships between heat, work, and energy, show that heat always flows from an area of higher temperature to an area of lower temperature. The opposite simply cannot happen, because coldness, though it is very real in terms of sensory experience, is not an independent phenomenon. There is not, strictly speaking, such a thing as "cold"—only the absence of heat, which produces the sensation of coldness.
One might pour a kettle of boiling water into a cold bathtub to heat it up; or put an ice cube in a hot cup of coffee "to cool it down." These seem like two very different events, but from the standpoint of thermodynamics, they are exactly the same. In both cases, a body of high temperature is placed in contact with a body of low temperature, and in both cases, heat passes from the high-temperature body to the low-temperature one.
The boiling water warms the tub of cool water, and due to the high ratio of cool water to boiling water in the bathtub, the boiling water expends all its energy raising the temperature in the bathtub as a whole. The greater the ratio of very hot water to cool water, on the other hand, the warmer the bathtub will be in the end. But even after the bath water is heated, it will continue to lose heat, assuming the air in the room is not warmer than the water in the tub. If the water in the tub is warmer than the air, it immediately begins transferring thermal energy to the low-temperature air until their temperatures are equalized.
As for the coffee and the ice cube, what happens is quite different from, indeed, opposite to, the common understanding of the process. In other words, the ice does not "cool down" the coffee: the coffee warms up the ice and presumably melts it. Once again, however, it expends at least some of its thermal energy in doing so, and as a result, the coffee becomes cooler than it was.
If the coffee is placed inside a freezer, there is a large temperature difference between it and the surrounding environment—so much so that if it is left for hours, the once-hot coffee will freeze. But again, the freezer does not cool down the coffee; the molecules in the coffee respond to the temperature difference by working to warm up the freezer. In this case, they have to "work overtime," and since the freezer has a constant supply of electrical energy, the heated molecules of the coffee continue to expend themselves in a futile effort to warm the freezer. Eventually, the coffee loses so much energy that it is frozen solid; meanwhile, the heat from the coffee has been transferred outside the freezer to the atmosphere in the surrounding room.
Temperature is related to the concept of thermal equilibrium, and has an effect on thermal expansion. As discussed below, as well as within the context of thermal expansion, a thermometer provides a gauge of temperature by measuring the level of thermal expansion experienced by a material (for example, mercury) within the thermometer.
In the examples used earlier—the thermometer in the mouth, the hot water in the cool bathtub, and the ice cube in the cup of coffee—the systems in question eventually reach thermal equilibrium. This is rather like averaging their temperatures, though, in fact, the equation involved is more complicated than a simple arithmetic average.
In the case of an ordinary mercury thermometer, the need to achieve thermal equilibrium explains why one cannot get an instantaneous temperature reading: first, the mouth transfers heat to the thermometer, and once both mouth and thermometer reach the same temperature, they are in thermal equilibrium. At that point, it is possible to gauge the temperature of the mouth by reading the thermometer.