On this page
When studying thermodynamics, you might hit a contradiction that feels like a mistake in the textbook. In one chapter, you learn that during the isothermal expansion of an ideal gas, all the heat added to the system is converted completely into work (Q = W) (1/Book%3A_University_Physics_II_-_Thermodynamics_Electricity_and_Magnetism_(OpenStax)/03%3A_The_First_Law_of_Thermodynamics/3.05%3A_Thermodynamic_Processes)). But a few pages later, the Second Law of Thermodynamics declares that converting all heat into work in a cycle is impossible (2/Book%3A_University_Physics_II_-_Thermodynamics_Electricity_and_Magnetism_(OpenStax)/04%3A_The_Second_Law_of_Thermodynamics/4.04%3A_The_Second_Law_of_Thermodynamics)).
So, which one is right? The short answer is both, but they are talking about two different things. In a single, one-way process, you can convert all heat into work. The Second Law only forbids doing this in a continuous, repeating cycle.
If you are confused about which rules apply to which thermodynamic paths, you can explore the properties of each in the Fermi Concept Library.
Why does Q = W in a single step?
To understand the exception, look at a single isothermal expansion. Imagine an ideal gas trapped in a cylinder with a piston, placed in contact with a large heat bath to keep its temperature constant.
When the gas expands, it pushes the piston outwards, doing work on the surroundings. Normally, expanding makes a gas cool down. But because this is an isothermal process, the gas absorbs heat (Q) from the bath to maintain its constant temperature (1/Book%3A_University_Physics_II_-_Thermodynamics_Electricity_and_Magnetism_(OpenStax)/03%3A_The_First_Law_of_Thermodynamics/3.05%3A_Thermodynamic_Processes)).
For an ideal gas, internal energy depends only on temperature. Since the temperature does not change, the change in internal energy is zero (ΔU = 0). By the First Law of Thermodynamics (Q = ΔU + W), this leaves Q = W (1/Book%3A_University_Physics_II_-_Thermodynamics_Electricity_and_Magnetism_(OpenStax)/03%3A_The_First_Law_of_Thermodynamics/3.05%3A_Thermodynamic_Processes)). In this specific, one-time expansion, every joule of heat added becomes exactly one joule of work. There is no contradiction here because the system's state has changed—it now occupies a larger volume.
Why are cyclic heat engines different?
If we can get complete conversion once, why can't we build a machine that does it forever? This is where the Second Law steps in.
To build a continuously running engine, the piston cannot just expand forever; it has to come back to its starting position to push again. This means the engine must operate in a cycle.
The Kelvin-Planck statement of the Second Law of Thermodynamics specifically targets cycles. It states that it is impossible for any device operating on a cycle to receive heat from a single reservoir and produce a net amount of work (2/Book%3A_University_Physics_II_-_Thermodynamics_Electricity_and_Magnetism_(OpenStax)/04%3A_The_Second_Law_of_Thermodynamics/4.04%3A_The_Second_Law_of_Thermodynamics)).
To reset the piston, you have to compress the gas. Compressing a gas requires doing work on it, and it generates heat. To return the gas to its original starting state (the same pressure, volume and temperature), you must reject some of this heat to a colder environment (the cold reservoir) (2/Book%3A_University_Physics_II_-_Thermodynamics_Electricity_and_Magnetism_(OpenStax)/04%3A_The_Second_Law_of_Thermodynamics/4.04%3A_The_Second_Law_of_Thermodynamics)). In a real car engine, this is why you need an exhaust pipe and a radiator. Without a way to dump waste heat, the cycle stops.
Because some heat is always thrown away during the reset phase, the net work you get out of the full cycle is always less than the heat you put in. You cannot achieve perfect efficiency. Even a perfect, theoretical engine will always have to reject some energy to the cold sink.
How to solve heat conversion questions?
When a test asks if all heat can be converted into work, check what kind of process the question describes. Use this simple framework to avoid falling into the trap:
Is it a single, non-repeating expansion?
If it is an isothermal expansion of an ideal gas, the answer is yes. The gas changes its state (its volume gets larger and its pressure drops) to achieve this complete conversion. It is a one-way trip, so the Second Law's rules on cycles do not apply.
Is it a continuous cycle or a heat engine?
If the system returns to its exact starting state at the end to repeat the process, the answer is no. The Kelvin-Planck statement of the Second Law demands that some heat must be rejected to a cold sink to complete the cycle.
Is it asking about converting work into heat?
Be careful not to mix the two up. You can convert all work into heat continuously (for example, by rubbing two blocks together to create friction or running an electric current through a resistor). The universe is perfectly happy to let organised work become disorganised heat, but it fiercely resists the reverse.



