Maxwell conceived a "thought experiment" as a challenge to the second law. He described the experiment as follows::
In other words, Maxwell imagines two containers, A and B. The containers are filled with the same gas at equal temperatures and placed next to each other. Observing the molecules on both sides, a little "demon" guards a trapdoor between the two containers. When a faster-than-average molecule from A flies towards the trapdoor, the demon opens it, and the molecule will fly from A to B. The average speed of the molecules in B will have increased while in A they will have slowed down on average. Since average molecular speed corresponds to temperature, the temperature decreases in A and increases in B, contrary to the second law of thermodynamics.
One of the most famous responses to this question was suggested in 1929 by Leó Szilárd and later by Léon Brillouin. Szilárd pointed out that a real-life Maxwell's demon would need to have some means of measuring molecular speed, and that the act of acquiring information would require an expenditure of energy. The second law states that the total entropy of an isolated system must increase. Since the demon and the gas are interacting, we must consider the total entropy of the gas and the demon combined. The expenditure of energy by the demon will cause an increase in the entropy of the demon, which will be larger than the lowering of the entropy of the gas. For example, if the demon is checking molecular positions using a flashlight, the flashlight battery is a low-entropy device, a chemical reaction waiting to happen. As its energy is used up emitting photons (whose entropy must now be counted as well), the battery's chemical reaction will proceed and its entropy will increase, more than offsetting the decrease in the entropy of the gas.
Szilárd's insight was expanded upon in 1982 by Charles H. Bennett. In 1960, Rolf Landauer realized that certain measurements need not increase thermodynamic entropy as long as they were thermodynamically reversible. Due to the connection between thermodynamic entropy and information entropy, this also meant that the recorded measurement must not be erased. In other words, to determine what side of the gate a molecule must be on, the demon must store information about the state of the molecule. Bennett showed that, however well prepared, eventually the demon will run out of information storage space and must begin to erase the information it has previously gathered. Erasing information is a thermodynamically irreversible process that increases the entropy of a system.
Note that if the whole universe consisted of the demon and the container, and energy were needed to operate the gate, the only source of energy is letting heat flow from B to A. Now, the quantum of B to A heat flow is a single particle going from B to A. This restores entropy, because on average the single particles going from B to A are more energetic than the ones going from A to B.
The above argument can take another form if the door is modeled as a potential energy barrier. In order to raise the potential, work must be done, and that potential energy cliff should be higher than the kinetic energy of the particle going from A to B. Thus, the quantum of heat flow going from B to A should be more energetic than the incoming particle.
Put simply, no matter how it is done, both the act of the demon watching molecules and the act of opening and closing the trapdoor is by definition work and requires the expenditure of energy.
However, John Earman and John Norton have argued that Szilard and Landauer's explanations of Maxwell's Demon begin by assuming that the second law of thermodynamics cannot be violated, thus rendering their proofs that Maxwell's Demon cannot violate the Second Law vacuous.
Single-atom traps used by particle physicists allow an experimenter to control the state of individual quanta in a way similar to Maxwell's demon.
Molecular-sized mechanisms are no longer found only in biology; they are also the subject of the emerging field of nanotechnology.
A large-scale, commercially-available pneumatic device, called a Ranque-Hilsch vortex tube separates hot and cold air. It sorts molecules by exploiting the conservation of angular momentum: hotter molecules are spun to the outside of the tube while cooler molecules spin in a tighter whirl within the tube. Gas from the two different temperature whirls may be vented on opposite ends of the tube. Although this creates a temperature difference, the energy to do so is supplied by the pressure driving the gas through the tube.
If hypothetical mirror matter exists, demons can be envisaged which can act like perpetuum mobiles of the second kind: extract heat energy from only one reservoir, use it to do work and be isolated from the rest of ordinary world. Yet the Second Law is not violated because the demons pay their entropy cost in the hidden (mirror) sector of the world by emitting mirror photons.
In 1962 lectures, to illustrate thermodynamics, physicist Richard Feynmann analyzed a putative Maxwell's demon device, a tiny paddlewheel attached to a ratchet, showing why it cannot extract energy from molecular motion of a fluid at equilibrium. This brownian ratchet is a popular teaching tool.
In the 1 February, 2007 issue of Nature, David Leigh, a professor at the University of Edinburgh, announced the creation of a nano-device based on this thought experiment. This device is able to drive a chemical system out of equilibrium, but it must be powered by an external source (light in this case) and therefore does not violate thermodynamics.
Previously, other researchers created a ring-shaped molecule which could be placed on an axle connecting two sites (called A and B). Particles from either site would bump into the ring and move it from end to end. If a large collection of these devices were placed in a system, half of the devices had the ring at site A and half at B at any given moment in time.
Leigh made a minor change to the axle so that if a light is shone on the device, the center of the axle will thicken, thus restricting the motion of the ring. It only keeps the ring from moving, however, if it is at site A. Over time, therefore, the rings will be bumped from site B to site A and get stuck there, creating an imbalance in the system. In his experiments, Leigh was able to take a pot of "billions of these devices" from 50:50 equilibrium to a 70:30 imbalance within a few minutes.
In music and film, Maxwell Demon was the name of Brian Eno's first band, which was the inspiration for the name of a fictional character in the movie Velvet Goldmine, and Maxwell's Demon is the name of a 1968 film by the American experimental filmmaker Hollis Frampton. Maxwell's Demon is mentioned in the song 'A Metaphysical Drama', by Vintersorg and also is the name of a Brooklyn-based indie rock band, as well as that of a London alt-pop band See also the lyrics to "Isaac's Law" by The Loud Family.
The theory is also referenced in 2003 video-game Max Payne 2, in the form of an in-game cartoon show the chief villain of which is named 'Maxwell's Demon'.