I'm going to evaluate the entropy change for the 2-step process in the original post and then show that the integral of dQ/T for the polytropic process with negative n between the same two end states is exactly equal to the same entropy change. This will allow us to reach a definite conclusion about the reversibility of the polytropic process, and whether the polytonic process with negative n is consistent with the 2nd law of thermodynamics.
The 2-step process in the original post consists of an adiabatic reversible compression, followed by an isothermal reversible expansion, in which the final pressure, the final temperature, and the final volume are all greater then in the initial state before the compression. Let the pressure, volume, and temperature in the initial state be ##(P_1,V_1,T_1)##, let the pressure, volume, and temperature in the intermediate state after the compression be ##(P_C,V_C,T_C)##, and let the pressure, volume, and temperature in the final state after the isothermal expansion be ##(P_2,V_2,T_2)##. Since the expansion step is isothermal, we must have that ##T_C=T_2##.
For the initial adiabatic reversible compression step, we have that $$\frac{P_C}{P_1}=\left(\frac{V_C}{V_1}\right)^{-\gamma}$$
$$\frac{T_C}{T_1}=\frac{T_2}{T_1}=\left(\frac{V_C}{V_1}\right)^{1-\gamma}$$ From this, if follows that the volume in the intermediate compressed state can be expressed in terms of the temperature ratio for the overall two-step process by $$V_C=V_1\left(\frac{T_2}{T_1}\right)^{-\frac{1}{\gamma-1}}\tag{1}$$We will be using the value of this intermediate state compressed volume to determine the entropy change for the combined 2-step process.
In the present development, we are not only going to use the polytropic process relationships to represent a path from the initial state to the final state. We are also going to use it to establish the final state using the single polytropic process parameter n to guarantee that the final pressure and volume exceed the initial pressure and volume. For the direct polytropic path between the initial and final states, I indicated in post # 17 that the polytropic process path intersects the 2-step reversible path at $$\frac{P_2}{P_1}=\left(\frac{V_2}{V_1}\right)^{-n}$$This equation indicates that at n=0, the final pressure is equal to the initial pressure before compression while for ##n\rightarrow -\infty## the final volume approaches the initial volume before compression. Therefore, any negative value selected for n will guarantee that both the final pressure and final volume after the 2-step process are greater than their initial values before compression. In other words, the intersection of the P-V curve for a polytropic process with negative n will always intersect the P-V curve for the isothermal reversible expansion of the 2-step process at a point where the final pressure is greater than the initial pressure before compression and the final volume is greater than the initial volume before compression; and the full range of negative values for n from zero to ##-\infty## will span all the possible final states satisfying these requirements.
In addition to the previous relationship, we have for the polytropic process path $$\frac{V_2}{V_1}=\left(\frac{T_2}{T_1}\right)^{\frac{1}{1-n}}\tag{2}$$
Let's next evaluate the entropy change for the 2-step process in terms of the two parameters n and ##\gamma##, and the overall process temperature ratio ##T_2/T_1##. The entropy change for the adiabatic reversible compression step is zero, so the entropy change for the overall 2-step process is equal to that for the isothermal reversible expansion step: $$\Delta S=mR\ln{(V_2/V_C)}=mR\ln{\left(\frac{V_1}{V_C}\frac{V_2}{V_1}\right)}$$where m is the number of moles.
If we substitute Eqns. 1 and 2 into this relationship, we obtain:$$\Delta S=mR\ln{(T_2/T_1)^{\left[\frac{1}{\gamma-1}+\frac{1}{1-n}\right]}}$$$$=mR\ln{(T_2/T_1)^{\frac{\gamma-n}{(\gamma-1)(1-n)}}}$$$$=mR\frac{(\gamma-n)}{(\gamma-1)(1-n)}\ln{(T_2/T_1)}$$$$=mC_v\frac{(\gamma-n)}{(1-n)}\ln{(T_2/T_1)}\tag{3}$$
Next, let's consider the integral of dQ/T for the polytropic path, and see how it compares with the known entropy change between the initial and final states, as determined from the 2-step process. Unlike the 2-step process where all the heat transfer takes place from a single constant temperature reservoir at temperature ##T_2##, in the polytropic path, the heat transfer occurs from a continuous sequence of reservoirs (in differential increments) at temperatures running all the way from the initial temperature ##T_1## to the final temperature ##T_2##.
In post #17, I indicated that, for a polytropic process, the 1st law of thermodynamics tells us that the cumulative amount of heat received by the gas in going from the initial temperature ##T_1## to temperature T during the process is given by the equation $$Q=mC_v\frac{(\gamma-n)}{(1-n)}(T-T_1)$$Therefore, the differential amount of heat received by the gas in going from temperature T to temperature ##T+dT## is given by $$dQ=mC_v\frac{(\gamma-n)}{(1-n)}dT$$If we divide this by the temperature T at the interface with the reservoir from which the heat is received, we obtain:$$\frac{dQ}{T}=mC_v\frac{(\gamma-n)}{(1-n)}\frac{dT}{T}$$And integrating this over the entire polytropic path between temperatures ##T_1## and ##T_2## gives: $$\int_{T_1}^{T_2}{\frac{dQ}{T}}=mC_v\frac{(\gamma-n)}{(1-n)}\ln{(T_2/T_1)}$$
But this is exactly equal to the entropy change between the initial and final states as determined from the 2-step process. So we have that: $$\left[\int{\frac{dQ}{T}}\right]_{polytropic\ path}=\Delta S$$The only way this can happen is if the polytropic path is reversible. According to the Clausius inequality, to be consistent with the 2nd law of thermodynamics, the process path must be such that the integral of dQ divided by the boundary temperature at which the heat transfer occurs must be less than or equal to
change in entropy between the initial and final states. In the case of a polytropic process, the equality condition is satisfied, even for negative values of the polytropic index n. Thus, the polytropic process (even with negative n) is consistent with the 2nd law of thermodynamics.