# What has entropy to do with internal energy?

I'm trying to get an intuitive understanding of what entropy is and, frankly, I'm starting to get desperate for the click in my mind that allows me to connect all that stuff. This is my current understanding: internal energy accounts for the total amount of energy contained in a system; alternatively, the amount of energy that would be needed to reproduce that system in that particular place and state. Thus, the equation dU = dQ + dW makes complete sense. Or even dU = KE + PE; PE including all different kinds of potential energy. However, I can't make sense of the equation dU = TdS + dW.

Why is the change of entropy related to the change of heat? Does an increase of entropy produce an increase of heat? It does. But why? Does it mean that a system which undergoes a decrease of entropy (at the expense of its surroundings) requires less energy to reproduce? Put it in another way: does the second law mean that, as the entropy increases in an isolated system, every system is increasingly rising its internal energy?

I'm thoroughly confused and I'd really appreciate some help from someone with a clear picture about this. Thanks a lot and have a nice day!

There are two possible answers, depending on which end you're approaching thermodynamics from. If you're approaching thermodynamics from the macroscopic perspective, the temperature of a system is a fundamental, natural quantity that you can easily determine (by comparing it to other objects of known temperature), and the entropy is a state function that you define such that it tracks how changes in temperature and heat transfer are related. In contrast, if you're approaching thermodynamics from the microscopic perspective, then the entropy of a system is something you can easily determine (by enumerating the possible states of the system), and the temperature of the system is a state function that you define to track how the entropy and heat transfer are related. Either way, you get to a similar answer: the three quantities were defined such that they relate to each other in this way. Why? Because it turned out that defining such a quantity was useful to describe the world.

From your equations, you can easily see that $$\delta Q= T \;dS$$. So adding heat to a system leads to an increase in entropy for positive temperatures.

In fact, this often serves as the formal definition of temperature in thermodynamics from the microscopic perspective - it's how much heat you have to add to increase the system's entropy by a certain amount.

If, when you add heat, your system's entropy decreases, your system, formally, has a negative temperature. An example of a system with negative temperature is a population inversion in a laser medium.

First, let's take a look at the first law, which says that during any thermodynamic process,

$$dU = \delta Q - \delta W$$ where $$dU$$ is the change in the total internal energy of the system, $$\delta Q$$ is the amount of heat added to the system, and $$\delta W$$ is the mechanical work done by the system.

The reason we typically use $$\delta$$ instead of $$d$$ on the right hand side is because "heat" and "work" are not so-called state functions. What that means is that even if you have complete knowledge of the current state of the system, there is no way to know how much mechanical work was performed (or how much heat was added) in order to bring it to its current condition. Writing the right hand side as $$dQ-dW$$ would misleadingly imply that there are functions $$Q$$ and $$W$$ which have corresponding differentials $$dQ$$ and $$dW$$; this is emphatically not the case. Such functions don't exist.

This can be demonstrated by observing that if you take your system through a cyclic process, so the state of the system at the end is precisely the same as it was in the beginning, then the total amount of heat added (and the total amount of work done) is generically nonzero - therefore "total heat" (and "total work") cannot possibly be functions which are determined by the state of the system at any given time.

Mathematically, this can be expressed by the statement $$\sum_{\text{cyclic process}} \delta Q \neq 0$$

It was historically noticed by Clausius that although the above is true, in certain (so-called reversible) processes, we find that

$$\sum_{\text{rev. cyclic process}} \frac{\delta Q}{T} = 0$$

This implies that for reversible processes, while there is no state function whose differential is $$\delta Q$$, there is a state function whose differential is $$\frac{\delta Q}{T}$$. We call this function $$S$$, and say that for reversible processes,

$$dS = \frac{\delta Q}{T} \implies \delta Q = T dS$$

Similarly,

$$\sum_{\text{rev. cyclic process}} \frac{\delta W}{p} = 0$$

where $$p$$ is the pressure. Therefore, there exists a state function (which we'll call $$V$$) such that during reversible processes, $$\frac{\delta W}{p} = dV \implies \delta W = p dV$$

It follows that for reversible processes, we can rewrite the first law as follows:

$$dU = TdS - pdV$$

The second term is easy enough to interpret - $$V$$ is simply the volume of the system at a particular time, and $$pdV$$ can be identified as the mechanical work being done by the pressure being exerted on the walls of the box, in complete agreement with Newtonian physics. The first term is less familiar; $$S$$ is called the entropy of the system, but at this point it doesn't have an immediately obvious physical interpretation besides being a valid state function.

The development of statistical thermodynamics gives us a much clearer interpretation for $$S$$. From a macroscopic point of view, we describe a system by macroscopic quantities like total energy and volume. Such quantities define a so-called macrostate for our system.

If you zoom in to the level of atoms and molecules, however, the system becomes much more complicated. A microstate is specified by providing microscopic quantities like the position and momentum of each atom or molecule.

Each macrostate of the system corresponds to many, many microstates. For instance, it's easy to imagine rearranging the particles of a non-interacting gas in such a way as to create a totally different microstate with precisely the same pressure, temperature, total energy, etc. Let $$\Omega_i$$ be the number of microstates which correspond to some macrostate $$i$$; then the entropy $$S_i$$ of that macrostate is simply $$k_B \ln(\Omega_i)$$. In other words, the entropy is the (log of the) number of ways you could microscopically rearrange your system without changing anything on the macroscopic level.

From there, we argue that in equilibrium, the system will occupy the macrostate which corresponds to the largest number of microstates - the macrostate of maximal entropy.

Why is the change of entropy related to the change of heat?

From a thermodynamic perspective, the answer is "because that's how it is defined." It is the state function which can be related to the change in heat by dividing by the temperature of the system, and its existence was first noticed empirically.

From a microscopic/statistical perspective, the answer is that the number of accessible microstates of a system depends on how much total energy is divided among the system's constituents. Loosely speaking, if I give you and four of your friends a handful of pennies, the number of ways you could divide up those pennies is related to how many pennies I give you. In the same way, the entropy of a system is related to its total internal energy.

From there, there are two ways I could increase the total internal energy of the system - I could allow it to do work, or I could provide it with heat. Performing work equates to a change in volume; adding heat equates to a change in entropy.

Does an increase of entropy produce an increase of heat? It does. But why?

No, not always. You could increase the entropy of a system without adding heat. For instance, you could increase the number of particles in the system, or increase the size of the box. In the coin analogy, if I give you the same number of coins but you add another five friends, then the number of possible arrangements goes up.

Does it mean that a system which undergoes a decrease of entropy (at the expense of its surroundings) requires less energy to reproduce?

When a system loses entropy, then that means that it occupies a macrostate corresponding to fewer possible microscopic rearrangements. It could be because the system loses energy (fewer coins), or it could be because there are fewer particles (some of your friends go home), or it could be because the volume of the system decreases (my analogy doesn't really apply here).

Put it in another way: does the second law mean that, as the entropy increases in an isolated system, every system is increasingly rising its internal energy?

No, it definitely doesn't mean that. Imagine a hot system $$H$$ in thermal contact with a cold system $$C$$. Energy will flow from $$H$$ to $$C$$, and it will be conserved because whatever energy is lost by $$H$$ is gained by $$C$$.

However, $$H$$ will also lose entropy. Since we have $$dU_H + dU_C = 0$$ and that $$dU=TdS$$ (we assume the volumes don't change), $$dS_H + dS_C = \frac{dU_H}{T_H} + \frac{dU_C}{T_C} = dU_H\left(\frac{1}{T_H}-\frac{1}{T_C}\right)>0$$

because $$dU_C=-dU_H$$, $$T_H > T_C$$, and $$dU_H<0$$ (because $$H$$ is losing energy). Therefore, the total energy has been conserved ($$dU_H+dU_C=0$$) but the total entropy has increased ($$dS_H+dS_C > 0$$).

It sounds like you are in the beginning stages of learning thermodynamics. So I'll spare the equations and focus on trying to give you an intuitive feel.

Total energy is a conserved quantity. The total change in internal energy of a system and the surroundings (the universe) is zero, that is $$\Delta U_{tot}=0$$.

Total entropy is not a conserved quantity, except in the ideal case of a reversible process in which case $$\Delta S_{tot}=0$$. But all real processes are irreversible, thus $$\Delta S_{tot}>0$$. That is why you hear that the entropy of the universe is always increasing.

An increase in entropy does not "produce" heat. Heat is defined as energy transfer due solely to temperature difference. Heat transfer produces entropy. Irreversible work also generates entropy.

I'm sure you know that heat naturally (spontaneously) flows from a higher temperature object to a lower temperature object. And you probably also know that heat does not naturally (spontaneously) transfer in the reverse direction, i.e., from a cold object to a hot object. It violates the second law. To do so work must be done (e.g., an air conditioner). The process is said to be irreversible and increases entropy. On the other hand, it would not violate the 1st law if the same heat were able to spontaneously go from hot to cold and back again to hot. Internal energy is still conserved.

The major difference between energy and entropy is that conservation of energy does not determine the direction that processes can take. Heat transfer naturally going from cold to hot does not violate conservation of energy (first law). It does, however, violate the second law. The second law sets limits on the direction that processes can take (second law), in addition to the maximum possible efficiency of converting heat to work.

(BTW. The equation dU = TdS + dW is simply a consequence of Q = TdS which comes from the definition of entropy dS=dQ/T).

This is only intended to introduce you to these concepts. Much much more is involved.

Hope it helps.