The laws of thermodynamics are a grand-sounding term often bandied around in discussions of science, pseudoscience and general woo. Despite being scientific laws themselves, they are often cited by pseudoscientists (e.g., creationists) as a reason for why some other bit of science must be wrong. The classic example of this is "evolution must be wrong as it violates the laws of thermodynamics". As well as being ironic, such claims are usually also bullshit.

Thermodynamics as a subject originated in the Industrial Revolution, more or less as a way for engineers to understand how steam engines worked, and how to make them more efficient. Since then it has developed and generalised into a rigorous mathematical treatment of energy and entropy, and is a bread-and-butter part of science courses such as physics and chemistry.

There are three 'Laws' of thermodynamics ("laws" in the sense that they describe how physical systems "must" behave), and also a "zeroth" law, which isn't really a law so much as a definition of what is meant by "temperature".

Zeroth law of thermodynamics: "When two systems are in thermal equilibrium with a reservoir, they are in thermal equilibrium with each other."

First law of thermodynamics: "The total energy of the Universe is constant."

Second law of thermodynamics: "The entropy of an isolated system does not decrease."

Third law of thermodynamics: "As the temperature of a perfect crystal approaches zero, its entropy approaches a constant."[1]

The 1st, 2nd and 3rd Laws may be humorously summarized in non-scientific form as:

You can't get something for nothing.

You can't even break even unless you cool the temperature to absolute zero.

The zeroth law of thermodynamics states that "if two systems are in thermal equilibrium with a reservoir, then they are in thermal equilibrium with each other." It means that thermal equilibrium is a transitive relation. It's not possible to have three systems, A, B and C, where A is in equilibrium with B and B in equilibrium with C, but A is not in equilibrium with C. If this was possible, periodically connecting the systems A and C through a heat engine would create a perpetual motion machine.

The zeroth law is kind of a no-brainer, and was obviously known before the first, second, and third laws of thermodynamics were described. The need to formulate it as a formal law arose after the other laws had been established, so it was named the zeroth law in a backronym-ish manner.
In fact, it's arguably not really a "law" at all, but more just a definition of what is meant by "temperature".

The first law of thermodynamics states that you do not talk about thermodynamics the total energy of the universe is constant. It is an expression of the law of conservation of energy; energy cannot be created or destroyed, only change form as with matter becoming energy or vice versa. To put it simply, you can't create energy or matter, just change its arrangement. And as with all the other laws of thermodynamics, it only applies to a closed system.

The first law of thermodynamics, together with the second law, is the main reason why perpetual motion doesn't work. Since the machine can't create any new energy of its own, and the second law degrades what energy it has, the machine will eventually stop functioning. Proponents of perpetual motion often will come up with a rather wide variety of reasons as to why this isn't the case, ranging from magnets to "time crystals".[2]

“”Nothing in life is certain except death, taxes and the second law of thermodynamics.

—Seth Lloyd

The second law of thermodynamics states that "the entropy of an isolated system does not decrease". This is often taken to mean that "disorder always increases" and is frequently misinterpreted. Another way of putting it is "an isolated system's ability to do work decreases over time". The second law provides the thermodynamic arrow of time in that one can tell the difference between the past and the future by looking at the amount of entropy in the closed system.

The Universe is an isolated system since it is a term to describe the entire spacetime continuum, including all of the energy stored in it. In reality, the Universe is regarded as the only true isolated system, as perfect isolation on a smaller scale is impossible. The Earth can be viewed as an approximately closed system, although it is open in reality.

Strictly speaking, entropy is the logarithm of the multiplicity of states, or the degree of dispersion of energy in a system. It is expressed by the equation , where S is entropy, kB is Boltzmann's constant and Ω is the multiplicity of the states.

A more commonly given definition is "degree of disorder in the system," and hence the Second Law of Thermodynamics is often explained as "systems become increasingly disordered." From the definition above, this is equivalent to saying that a system will tend to transition from less probable to more probable sets of states.

Actually entropy is a little more abstract and the second law of thermodynamics implies that the Universe will always become increasingly uniform; that is, heat (transfer of energy in a way other than work) will spread until the entire universe has the same temperature and energy level (between systems in thermal contact, heat always transfers from the system at a higher temperature to the one at a lower temperature until balance is achieved), and forces will continue to work until a universal balance has been achieved.

In other words, everything in an isolated system is seen to work towards attaining a state of equilibrium or balance. Once universal equilibrium is attained there will be no basis for any work to be sustained or to occur; ergo the forces in an isolated system will become sedentary and no work will be done.

The simple physical analogy commonly given, is that given a period of time, a room will become more disordered (stuff gets distributed evenly throughout the room instead of being concentrated in a neat stack) as long as a person lives in it but does no effort to clean it out.[3] In the physical world, all forms of energy are converted to thermal energy, and become more uniformly distributed among the Universe, until the universe becomes energetically uniform. In its final state the Universe will become one uniform space where no work can be done since energy cannot be "concentrated" by doing work. This state is called maximum entropy. When the universe has reached maximum entropy it is said to be completely "disordered" as there are no ordered patterns left and there is no way to ascertain information about the history of the universe.

In actuality, as opposed to being in a state of complete disorder upon achieving maximum entropy, the Universe has instead homogenized and become more uniform. In very simple terms, maximum entropy ≠ disorder, get it? It is on a basis similar to this that scientific educators have recognized that the disorder terminology, while simple and easy to comprehend, is an oversimplification at best, and a misleading false analogy at worst. As a result, disorder terminology has been largely phased out; most chemistry textbooks, for example, have removed (or at least heavily edited out) the disorder terminology.[4] Of utmost importance, entropy is an energetic phenomenon, and only tangentially has to do with the distribution of matter in a system.[5] (Statistically speaking, the molecules of a gas are unlikely to move to one side of a container without work being done on the gas. But doing work on the gas would increase the entropy of the universe, as the plunger, or whatever does the compression, would have to increase its entropy.)

The Second Law is a law of statistical mechanics, rather than a fundamental law of nature. As such, it is not entirely impossible to be violated; however, its violation is extremely unlikely. But because its violation is not impossible, only extremely unlikely, it turns out that over extremely long timeframes, a violation may eventually occur. For example, a classical system which exhibits the second law of thermodynamics over reasonable timespans, may nonetheless violate the law over times on the order of its Poincaré recurrence time — when Poincaré recurrence occurs, the entropy of the system will decrease to its original value. However, given the Poincaré recurrence time is going to be greatly longer than the age of the Universe so far, this is a purely theoretical consideration. Additionally, given any instance in which a macrostate decreases in entropy, there will be an astronomically large number of other instances of the same macrostate increasing in entropy. Also, the Second Law applies to large-scale systems; given two molecules, it is unlikely for the one with lower vibrational energy to impart some of its energy to one with higher, but unlike with large-scale systems, it remains a sizable possibility, and given the large number of molecules, it is guaranteed to happen occasionally.

The false analogy of entropy as disorder is used in a number of fields outside of science with varying success. Creationists have picked up on disorder terminology like a drowning man to a rope and attempted to apply the second law of thermodynamics as a refutation of evolution. The analogy would state that more complex life forms could never evolve from simpler ones.

It seems obvious that this false analogy of a false analogy is incorrect. First, the Earth is not an isolated system — it receives a copious amount of incoming energy from the Sun. Second, evolution does not imply that life is becoming increasingly complex; it only says that natural selection allows genes to be passed on differentially, such that life forms' characteristics change over time in response to their environment.

It also is a corruption to believe life is always "more ordered" than inanimate objects. In fact, life does not violate the second law of thermodynamics in strict energetic sense. The energy of the sun is converted into chemical potential energy, which is converted to mechanical work or heat (since, again, the Earth is not an isolated system). In each case, the energy transfer is inefficient, and some energy is dissipated as heat to the environment, leading to a dispersion of energy. In the same way, "ordered" snowflakes can form when the weather becomes cold but the entropy of the universe still increases.

“”However, a transmitter and a receiver are two interacting systems. They are not individually isolated. So, the entropy lost by one system can be gained by the other. Or, equivalently, the information lost by one can be gained by the other. So a physical system, such as a biological organism or Earth itself, which gets energy from the sun, can become more ordered by purely natural processes.[6]

A quote in reference to chemistry education illustrates this point:

“”One aspect of biological systems that intrigues students is the possibility of discovering violations of the well-known laws of thermodynamics and physical chemistry. It is easy to refute most of the examples suggested. A germinating seed or an embryo developing in a fertilized chicken egg are often naively cited as examples of isolated systems in which an increase in order, or decrease in entropy occurs spontaneously. It is evident, however, that respiration, assuming O2 is present, produces an increase in entropy in the form of heat, which more than compensates for the decrease in entropy that arises when the elements present in the seed or in the yolk of the egg are organized into tissues of the plant or animal. Indeed, neither germination nor embryonic development will occur in the absence of oxygen in the system in question.[7]

In reference to evolution, PZ Myers put it: "The second law of thermodynamics argument is one of the hoariest, silliest claims in the creationist collection. It's self-refuting. Point to the creationist: ask whether he was a baby once. Has he grown? Has he become larger and more complex? Isn't he standing there in violation of the second law himself? Demand that he immediately regress to a slimy puddle of mingled menses and semen."

Furthermore, Carl Sagan pointed out that if the second law of thermodynamics were applied to a god, then god would necessarily have to die.[8]

(Brief quiz about thermodynamics: How many generally recognized laws of thermodynamics are there? We know about the second law: Give the numbers for the other laws.[9])

Let us suppose that there actually were some process in nature which violated the second law of thermodynamics. Is that any reason to suppose that intelligent designers are responsible? The only intelligent designers that we have direct familiarity with, humans and other more or less intelligent animals, are as much subject to the second law of thermodynamics as are non-intelligent agents. Indeed, the laws of thermodynamics were discovered as limitations on what the clever engineers of the 19th century were able to design. Intelligent designers are not able to construct perpetual motion machines. Intelligent designers don't bypass the second law of thermodynamics.

(See also, The Simpsons: "Lisa! In this house we obey the laws of thermodynamics!")

Some young Earth creationists have invoked "hydrodynamic sorting" in Noah's flood to account for the organization of the fossil record. Thereby they implicitly acknowledge that an undirected mechanical process is capable of producing order from disorder, and contradict their naive version of the second law of thermodynamics.

↑Note, however, that a clean room and a messy room with the same objects at the same temperature have the same entropy content, as physical changes do not significantly change the entropy content in a system.

↑When confining matter to a smaller volume, there are fewer translational energy levels available to the system and hence a lower density of states for a system. It is the number of microstates of the energy quanta corresponding to a macrostate that is important in determining the entropy of the system, and hence the two are related. Note, however, that two gases separated by a barrier will indeed mix despite maintaining the same volume, and hence one can't separate entirely the distribution of matter from the distribution of energy.