In thermodynamics, a system can exchange energy with its environment in two ways: as heat or as work, whereby different variants of work exist depending on the system and process control, including volume work, magnetic work. In the course of such energy exchange, the entropy of both the system and the environment may change. Only if the sum of all entropy changes is positive, the change occurs spontaneously.
Basics
The entropy
(unit J/K) is an extensive state variable of a physical system and behaves additively like the volume, the electric charge or the amount of matter when several systems are united. The physicist Rudolf Clausius introduced this term in 1865 to describe circular processes. Dividing
by the mass of the system yields the specific entropy
with the unit J/(kg-K) as the intensive state variable.
The differential
is, according to Clausius, for reversible processes between systems in equilibrium, the ratio of transferred heat δ
and absolute temperature
:

This entropy change is positive when heat is added and negative when heat is removed. In this notation,
uses a noncursive emphasize that it is a complete differential, unlike δ
, which cannot be a complete differential because
is a process variable. In this context, then, the reciprocal absolute temperature plays the role of an "integrating evaluation factor" that turns the reversibly added or removed heat, an - mathematically speaking - incomplete differential, into an associated complete differential .
This makes the change in entropy for reversible processes - unlike heat added or removed - path-independent. With the definition of an arbitrary value for a reference state, the entropy thus becomes a state variable given solely by the respective state.
In this respect, entropy in reversible process control can also be defined as the "heat energy valued at
". Further on, the problem of how far the energy of a system can be converted into work is treated.
Using the first law of thermodynamics,
, so that the energy change
is composed of work supplied and heat, and sets for the work δ
all processes possible for the experimenter by means of changing the system variables, one obtains from (1) for the change of entropy as a function of the thermodynamic variables (still in the reversible case)

Clausius also treated irreversible processes and showed that in an isolated thermodynamic system the entropy can never decrease:

where the equal sign applies only to reversible processes.
is the entropy change of the system with
for the entropy of the state at the beginning of the state change and
for the state at the end of the process.
From (2), for closed systems where thermal energy can pass through the system boundaries, the inequality follows:

is the entropy fraction resulting from the supply of heat across the system boundary. The formula also applies to the removal of heat from the system, in which case Δ
negative. Inequality (3a) becomes an equation only for purely reversible processes.
When analyzing thermodynamic systems in engineering, one often performs a balance analysis. To do this, one writes the inequality (3a) in the following form:

Here Δ
is the entropy fraction that arises from irreversible processes inside the system. These include, for example, mixing processes after the removal of an internal partition, thermal equalization processes, the conversion of electrical or mechanical energy (ohmic resistance, stirring) into heat, and chemical reactions. If the irreversible processes are restricted exclusively to the dissipation of mechanical or electrical work δ
, then Δ can be
expressed
by the work or dissipated power

If the irreversible process runs quasistatically, so that the system is always close to an equilibrium state, then (3) can also be written with time derivatives.

Here,
is called the entropy transport stream and
the entropy production stream.
From the first law of thermodynamics

it follows that the product
represents the non-utilized part ("waste heat") in the isothermal generation of work
from available internal energy Δ The maximum value of this work is the so-called free energy
.
This is an equivalent form of the 2nd main theorem.
One consequence of this is the impossibility of a perpetual motion machine of the 2nd kind. Clausius formulated:
"No cycle exists whose sole effect is to transfer heat from a colder reservoir to a warmer reservoir."
Obviously, otherwise one would have constructed an inexhaustible source of energy. If it were possible to construct such a cyclic process, one could continuously take energy from the warm reservoir and do work with it. The dissipated work would then be supplied to the cold reservoir and would again benefit the warm reservoir via the mentioned circular process. Equivalent to this is the formulation of William Thomson, the later Lord Kelvin:
"No cycle exists that takes a quantity of heat from a reservoir and turns it entirely into work."
An ideal process that can be reversed at any time without friction losses is also called reversible. Often the entropy remains unchanged during a process, Δ
, well-known example is the adiabatic compression and expansion in the cycle of a Carnot machine. Changes of state with constant entropy are also called isentropic, but not all isentropic changes of state are adiabatic. However, if a process is adiabatic and reversible, it always follows that it is also isentropic.
If the heat
is
absorbed in a cycle at the temperature the amount of heat
is released again
at and if the heat absorption and release are reversible, then the entropy does not change:
; or
.
From this, the maximum work done
and the maximum efficiency η
, the so-called Carnot efficiency, can be derived:

The Carnotian efficiency represents the maximum work output for all heat engines. Real machines usually have a considerably lower efficiency. In them, part of the theoretically available work is dissipated, e.g. by friction. Consequently, entropy is produced in a real machine and more heat is dissipated to the cold reservoir than is necessary. It therefore works irreversibly.
The third law (the so-called "Nernst heat theorem") defines the entropy of a perfectly crystalline substance, in which, for example, no spin degeneracy occurs, as zero at absolute zero:

One conclusion is, for example, that the heat capacity of a system vanishes at low temperatures and, above all, that the absolute temperature zero is not attainable (this also applies to spin degeneracy).
If a substance does not fulfil the condition of being perfectly crystalline (e.g. if there are several configurations or if it is a glass), an entropy can also be attributed to it at absolute zero (zero point entropy).
Partial derivatives of entropy
From the 2nd law follow statements about the partial derivatives of entropy, e.g. according to the temperature
or the volume
. Using the second law, it first holds that for reversible changes of state
. Together with the first law, it follows that
, because according to the first law for the internal energy
it holds that the sum of the work supplied to the system under consideration δ
and the heat supplied δ
(individually not state functions!) yields a state function, namely the "internal energy" of the system. It was assumed that the changes of volume and temperature occur adiabatically-slowly, so that no irreversible processes are generated.
So

Where δ
was used.
resp.
.
Similar relationships arise when the system depends on other variables besides density or volume, such as electrical or magnetic moments.
It follows from the 3rd law that both ∂
and ∂
must vanish for and sufficiently rapidly, which (as can be shown) is satisfied only if quantum physics, rather than classical physics, holds for low temperatures.