Isothermal and adiabatic compression in the Carnot cycle I am reading about the Carnot Engine and I understood the first 2 stages (Isothermal and Adiabatic Expansion) well. In the 3rd stage where isothermal compression takes place, the surroundings do work on the system. The following is an image from wikipedia:


*

*My question is that do we physically have to compress it or does the gas get compressed on its own?


*What is not quite intuitive to me is how is it that after 4 stages, the temperature goes back to being the original temperature?
 A: *

*The gas has a positive pressure and is in contact with a reservoir that keeps it at constant temperature. It’s pushing out on the piston. To reduce the volume, the piston has to push in, within an inward force. That force and distance is the work done by the piston.


*It’s the Carnot cycle because it comes back to the same points over and over again.
The ideal gas obeys $PV=nkT$ so if all the gas (same $n$) gets back to the same $P$ and $V$, then $T$ has to be the same.
A: We have to physically compress the gas. The reason behind this, along with answering your 2nd question, will be apparent if we analyze the Carnot cycle. It's convenient to consider the $PV$ and $TS$ diagrams when talking about processes:

Let's start at state 1 with $S_1$, $T_1$, $P_1$, etc.
1 $\rightarrow$ 2: Isentropic work input.
2nd law for this process gives:
$$ S_2 - S_1 = \int\frac{\delta Q_{12}}{T} + \Delta S_{gen}$$
Look at the TS diagram; clearly, $S_2 = S_1$. We also know $\Delta S_{gen} = 0$ since this is the Carnot cycle. 
Therefore, $Q_{12} = 0$ and the 2nd law yields $S_1 = S_2$.
How else are we gonna increase the temperature to state 2? We have to add some sort non-heat energy to increase the temperature but keep $\Delta S = 0$. We therefore must add work.
2 $\rightarrow$ 3: Isothermal heat addition and work output.
The second law for this process gives:
$$ S_3 - S_2 = \frac{Q_{23}}{T_H}$$
where $T_H = T_2 = T_3$. Heat must therefore be added because we increase entropy. Note from the $PV$ diagram that we also have positive work output.
We've now made half a square on the $TS$ diagram. Next step is to isentropically decrease the temperature back to $T_1$.
3 $\rightarrow$ 4: Isentropic work output.
For the same reason as process 1 $\rightarrow$ 2, this process is adiabatic. The only way to decrease the entropy is to remove some sort of non-heat energy (i.e., the second law says we have to output work). 
4 $\rightarrow$ 1: Isothermal heat rejection and work input.
The second law for this process gives:
$$ S_{1'} - S_4 = \frac{Q_{41'}}{T_C}$$
where $T_C = T_4 = T_1$. I'm using state $1'$ because we could reject heat $Q_{41'} = T_C(S_1' - S_4)$ that takes us to a different state. But, since this is a cycle, we reject just enough heat to bring us back to state $1$. We don't have to do that, we just choose to since this is a cycle. I think that answers your 2nd question.
A: In the adiabatic compression stage, you squash the gas until it gets to the temperature you want.
A: *

*In the adiabatic compression step, the system volume decreases while no heat flows into or out of the system. Using a hypothetical piston example, we envision the step as though the piston is pushed inward to the system by (something in) the surroundings. The details about how the compression happens in a hypothetical Carnot cycle are never a matter for further discussion. Call it as happening due to an invisible hand, Mother Nature, or Maxwell's demon. No matter. The piston is moved inward so that volume decreases. In a real cycle, we certainly have to push physically on the piston from the outside (surroundings). The gas inside the piston does not collapse on its own.


*Any closed system has a mechanical equation of state (EoS) that relates the three parameters $p, T, V$. The ideal gas in a Carnot cycle has the EoS $p V = n R T$. Consider a case where the cycle starts at $p_o, T_o, V_o$. Any sequence of steps that returns the container ideal gas to the same $p_o, V_o$ by definition also returns the container gas to the same $T_o$. In your choice for the direction around the Carnot cycle, the first step keeps temperature constant while increasing volume. The second step changes all three $p, T, V$. The third step keeps temperature constant while decreasing volume. We are at an entirely new set of $p, T, V$ conditions by the end of step 3. All we need to do is have a process step that returns to the original $p_o, V_o$. That step happens to be an adiabatic compression.
