Towards understanding the mathematics of the 2nd law of thermodynamics

Abstract: In this paper, the mathematical formulation of 2nd law of thermodynamics has been explained, and the mathematical formulation of 1st law has been revisited from this noble perspective. It is not claimed that the 2nd law of thermodynamics is a redundant of the 1st law, rather I shown here how we can extract the mathematical formulation of the 2nd law from the mathematical formulation of the 1st law of thermodynamics. The Clausius statement of the 2nd law of thermodynamics is, it is impossible to construct a device whose sole effect is the transfer of heat from a cool reservoir to a hot reservoir. An alternative statement of the law is, "All spontaneous processes are irreversible" or, "the entropy of an isolated system always increases". Having strong experimental evidences, this empirical law is obvious, which tells us the arrow of time and the direction of spontaneous changes.


Introduction
T he 1 st law of thermodynamics is often claimed as a version of the law of conservation of energy, adapted to the thermodynamic systems, which can be formulated as: which states that the amount of heat accumulated by a closed system is spent to change its internal energy, and to do some work by the system on its surroundings. Here δW rev is the differential work done by the surroundings on the system. So work done by the system on its surroundings is (−δW rev ), hence, δQ rev = dU + p ext dV. This law is a very common-sense law, adapted to the thermodynamic system, which is the total energy of an isolated system e.g., the universe is conserved.
The aim of this paper is to show the mathematical formulation of the 2 nd law of thermodynamics as a consequence of the 1 st law.

Preliminaries
In the mathematical formulation of the 1 st law of thermodynamics, the quantity of heat and work transfer are energies that depend on the process followed, whereas internal energy of a system is an extensive thermodynamic property of system describes quantitatively an equilibrium state irrespective of the process.
Here, δQ rev and δW rev are non-exact differentials and dU is an exact differential. Let X(U, V) is the integrating factor, so that XδQ rev becomes exact, so, XδQ rev = XdU + X p ext dV is an exact differential equation. Definition 1. dZ = MdP + NdQ will be an exact differential equation provided that ∂M ∂Q P = ∂N ∂P Q . Assumption 1. Let us assume that the integrating factor X is a function of only internal energy U. Joule experimentally shown that the internal energy of an ideal gas is only the function of its temperature, independent of pressure or volume. So, X = f (T).
As, XδQ rev = XdU + X p ext dV is an exact differential equation, so from Definition 1, we have The above partial differential equation in general has more than one solution. The general solution can't be known as the Internal Energy as a function of temperature and the boundary conditions are not known. However, a particular solution for X can be obtained assuming X, the integrating factor as a function of only internal energy U.
From Assumption 1, we have i.e., for ideal gas.
The functional equation f (T)p ext = g T p ext has a unique solution f (y) = g(y) = 1 y , so, the integrating factor is X = f (T) = 1 T . Now, δQ rev T is an exact differential. For reversible process, temperature of the system is same as the temperature of the surroundings at any particular instant of time, so, δQ rev T surr is an exact differential and is known as differential change in entropy.
It can be shown that maximum work delivered to surroundings for isothermal gas expansion can be obtained using a reversible path [1], so, Being a state function,

Existence on global systems
The Equation (1) and the inequality (2) were proved by using the fact for ideal gas laws, but they holds for any materials in the system. The fact behind this is δQ rev is reversible heat accumulated by the system from its surroundings and T surr is the temperature of surroundings. So, the surroundings can't see inside the system and provide the same heat irrespective of material in the system for its same temperature at the instant of heat exit. Similarly, δQ irrev is the irreversible heat accumulated by the system from its surroundings and T surr is the temperature of surroundings at that instant which are independent of the system provided that heat transfer occurs irreversibly. The accumulation rate of heat may be different for different systems but that is the kinetics of the systems, which is beyond the scope of this paper. Theorem 1. The 2nd Law of Thermodynamics is a consequence of the 1st Law of Thermodynamics.
The above argument proves the existence of the equation for global systems, where the equality holds for reversible cases and for irreversible changes, the equality does not hold. Let a system ( Figure 1) is isolated and spontaneously changes from A to B. The system is then brought into contact with a heat source of same temperature as B at that particular instant of time and reversibly brought back from B to A. (It would be necessary and sufficient to show that "changes from A to B is irreversible" to prove the above statement.) Proof of Theorem 1. Let us first assume that spontaneous change from A to B is reversible, so, the total cyclic path is also reversible as all the elements of the path is reversible [2]. Hence which is not true, because, Q rev (B → A) = 0 (not isolated), so, That is a contradiction, so, our initial assumption was incorrect, i.e., spontaneous change from A to B must be irreversible. Consequently, the cycle of heating and cooling back to the same point A is an irreversible cycle, as, minimum portion of this path is proved to be irreversible (A → B).
which is the change in entropy for the spontaneous process indicating that the entropy always increases in isolated system for spontaneous processes to occur.
From the above argument it is proved that "All spontaneous processes are irreversible". Also "the entropy of an isolated system always increases".

Efficiency of heat engines
Let us consider a heat engine, in the first cycle it gains ∆Q 1 amount of heat from a hot reservoir and releases ∆Q 2 amount of heat to a cold reservoir. So, the amount of heat energy converted into useful work by the heat engine is The engine is said to be reversible if in the reversed cycle it can work as a heat pump, i.e., it takes ∆Q 2 amount of heat from the cold reservoir and releases ∆Q 1 amount of heat to the hot reservoir, provided that it consumes the useful work converted in the first cycle. That means, after completing two cycles, the engine is back to the old state, so, ∆Q 1 T 1 + ∆Q 2 T 2 = 0. But the equality does not hold for actual engines (irreversible), as we have proved that all spontaneous processes are irreversible. That means, after completing the two cycles, the engine is not back to the old state, so, ∆Q 1 The efficiency of a heat engine is defined by the ratio of work done per cycle and the heat energy it gains per cycle, i.e., ∆Q 1 +∆Q 2 , which is clearly less than 100% as we know T 1 , T 2 ≮ 0 from the 3 rd law of thermodynamics.
That is the evidence of the alternative formulation of the 2 nd law of thermodynamics used in the literature, "There does not exist any heat engine that does nothing but absorb heat energy from one single reservoir and convert it into work".

Conclusion
In this paper, we proved the 2 nd law of thermodynamics by mathematical arguments. Some familiar quotes used in the literature relevant to the 2 nd law of thermodynamics, "you can't unscramble an egg", "you can't take the cream out of the coffee" as these are irreversible processes. No matter how long you wait, the cream won't jump out of the coffee into the creamer or could not travel in time back to its old state. These seem to be just natural phenomena, but we have shown the mathematical validation of these natural phenomena. So, the 2 nd Law of Thermodynamics is not only a law of nature, but a law of mathematics also.
Conflicts of Interest: "The author declares no conflict of interest."