# Question about entropy generated in isothermal expansion of an ideal gas

So, this has been bugging me for a while.

Consider the isothermal expansion of an ideal gas in a container. As the gas is allowed to expand, it does work on the surroundings which causes the temperature of the gas to drop. Since it is isothermal expansion, energy must flow via heat into the gas from the surroundings to maintain the temperature. The total change in entropy is given by

$$\mathrm dS_\text{total}=\mathrm dS_\mathrm{system}+\mathrm dS_\mathrm{surroundings}$$

Now, the entropy change for the system is

$$\mathrm dS_\mathrm{system}=\mathrm dS_\mathrm{produced}+\mathrm dS_\mathrm{exchanged}$$

where, $$\mathrm dS_\mathrm{produced}$$ is internally produced entropy in the system and $$\mathrm dS_\mathrm{exchanged}$$ is entropy change due to exchange of energy via heat.

Let the amount of heat exchanged be
$$\delta q_\mathrm{system}=-\delta q_\mathrm{surroundings},$$ so $$\mathrm dS_\mathrm{exchanged}$$ over the temperature $$T$$ is $$\frac{\delta q_\mathrm{system}}T=-\frac{\delta q_\mathrm{surroundings}}T$$

Then, $$\mathrm dS_\mathrm{total}=\mathrm dS_\mathrm{system}+\mathrm dS_\mathrm{surroundings}\\ =\mathrm dS_\mathrm{produced}+\frac{\delta q_\mathrm{system}}T-\frac{\delta q_\mathrm{surroundings}}T\\ =\mathrm dS_\mathrm{produced}$$

My question is that why should we account for the energy given via heat by surroundings which is $$\frac{\delta q_\mathrm{system}}T$$, to the system, as it is already used by the gas to maintain the temperature. For an irreversible isothermal expansion the internally produced entropy will be greater than zero due to increase in volume of the gas. But how will heat exchanged add to total entropy when it is only used to maintain the temperature of the system.

Let $$T_B$$ be the temperature of the interface between the surroundings and the system. For an ideal surroundings reservoir (typically assumed), the entropy change of the surroundings is $$\Delta S_{surroundings}=\frac{-q_{system}}{T_B}$$.

If the expansion is irreversible, the average temperature of the gas system during the expansion is less than the initial (and final temperature) $$T=T_B$$, assuming that the surroundings reservoir is always at the initial temperature of the system T. From Cauchy's relationship, it follows that $$\Delta S_{system}=\frac{q_{system}}{T_B}+\sigma=\frac{q_{system}}{T}+\sigma$$where $$\sigma$$ is the generated entropy due to irreversibility during the process.

So we have $$\Delta S_{total}=\frac{q_{system}}{T}+\sigma+\frac{-q_{system}}{T}=\sigma$$

To get the entropy change for the system for a reversible path, we need to obtain the reversible isothermal work (which is equal to the reversible isothermal heat $$q_{rev}$$), and calculate the entropy change for the system from that: $$\Delta S_{system}=\frac{q_{rev}}{T}$$So, if we combine previous equations, we obtain: $$\sigma=\frac{q_{system,rev}-q_{system,irreversible}}{T}$$

Process 2 is a two step process. Step 1 consists of the isothermal reversible expansion we have been discussing, to the same final volume as Process 1. In Step 2 of this process, we use a stirrer to stir the gas at constant volume (generating viscous thermal energy and entropy) while at the same time removing the mechanical energy that the stirrer put in as heat. The amount of mechanical work that we allow the stirrer to do is $$\sigma T$$, where $$\sigma$$ is the entropy change in the irreversible Process 1. So, the heat removal in Step 2 is $$\sigma T$$ and the entropy change in Step 2 is 0. So, for the overall Process 2, the heat added to the system, the work done on the system, and the entropy change are: $$q=q_{rev}-T\sigma$$ $$w=w_{rev}-T\sigma$$ $$\Delta S=\frac{q_{rev}}{T}=\frac{q}{T}+\sigma$$ These are exactly the same as our irreversible isothermal Process 1.
• Thank you so much! $\Delta S_{system}=\frac{q_{system}}{T_B}+\sigma=\frac{q_{system}}{T}+\sigma$ is the part I'm confused about. I don't get why we have to include $\frac{q_{system}}{T_B}$ when all that part of the equation is doing is to maintain the temperature of system. Is it that as you said, that if the expansion is irreversible then average temperature of system during expansion is less than initial temperature, so entropy is less and this part $\frac{q_{system}}{T_B}$ is then used to make up for the loss of entropy due to expansion of gas. Is it like that? Jan 3 at 14:12