I am rather confused about this. I know from Charles' law that under constant pressure, the volume of a gas is directly proportional to its absolute temperature i.e.

$$\frac{V_1}{T_1} = \frac{V_2}{T_2}$$

Thus accordingly, during compression, temperature of the gas would decrease. But in Lectures of physics ,vol 1 by Feynman, it is written:

Suppose that the piston moves inward, so that the atoms are slowly compressed into a smaller space. What happens when an atom hits the moving piston? Evidently it picks up speed from the collision. [...] So the atoms are "hotter" when they come away from the piston than they were before they struck it. Therefore all the atoms which are in the vessel will have picked up speed. This means that when we compress a gas slowly, the temperature of the gas increases.

(Constant pressure?) So, this is contrary to Charles' law. Why does this happen? Who is right? Or are they both correct? I am confused. Help.

  • 2
    $\begingroup$ You're compressing the gas, the pressure is increasing not constant. $\endgroup$
    – Michael
    Commented Sep 20, 2014 at 13:27
  • $\begingroup$ So there are different conditions? .... Is not Charles' law speaking of gas'pressure? What is Feynman talking of ? $\endgroup$
    – user36790
    Commented Sep 20, 2014 at 13:40
  • 1
    $\begingroup$ I don't know its name, but the equation I learned in highschool was: $$\frac{P_1V_1}{T_1} = \frac{P_2V_2}{T_2}$$ $\endgroup$
    – Izkata
    Commented Sep 20, 2014 at 20:35

5 Answers 5


There's actually not one simple answer to your question, which is why you are a bit confused. To specify your problem fully, you must specify exactly how and whether the gas swaps heat with its surroundings and how or even whether it is compressed. You should always refer to the full gas law $P\,V=n\,R\,T$ when reasoning. Common situations that are considered are:

  1. Charles's Law: The pressure on the volume gas is constant. No work is done by the gas on its surroundings, nor does the gas do any work on its surroundings or piston or whatever during any change. The gas's temperature is that of its surroundings. If the ambient temperature rises / falls, heat is transferred into / out from the gas and its volume accordingly increases / shrinks so that the gas's pressure can stay constant: $V = n\,R\,T/P$; with $P$ constant, you can retrieve Charles's Law;

  2. Isothermal: the gas is compressed / expanded by doing work on / allowing its container to do work on its surroundings. You think of it inside a cylinder with a piston. As it does so, heat leaves / comes into the gas to keep the temperature constant. As the gas is compressed, the work done on it shows up as increased internal energy, which must be transferred to the surroundings to keep the temperature constant. At constant temperature, the gas law becomes $P\propto V^{-1}$;

  3. Adiabatic: No heat is transferred between the gas and its surroundings as it is compressed / does work. AGain, you think of the gas in a cylinder with a plunger. This is prototypical situation Feynman talks about. As you push on the piston and change the volume $V\mapsto V-{\rm d}V$, you do work $-P\,{\rm d}V$. This energy stays with the gas, so it must show up as increased internal energy, so the temperature must rise. Get a bicycle tyre pump, hold your finger over the outlet and squeeze it hard and fast with your other hand: you'll find you can warm the air up inside it quite considerably (put you lips gently on the cylinder wall to sense the rising temperature). This situation is described by $P\,{\rm d}V = -n\,\tilde{R}\,{\rm d} T$. The internal energy is proportional to the temperature and the number of gas molecules, and it is negative if the volume increases (in which case the gas does work on its surroundings). But the constant $\tilde{R}$ is not the same as $R$: it depends on the internal degrees of freedom. For instance, diatomic molecules can store vibrational as well as kinetic energy as their bond length oscillates (you can think of them as being held together by elastic, energy storing springs). So, when we use the gas law to eliminate $P = n\,R\,T/V$ from the equation $P\,{\rm d}V = -n\,\tilde{R}\,{\rm d} T$ we get the differential equation:

$$\frac{{\rm d} V}{V} = - \frac{\tilde{R}}{R}\frac{{\rm d} T}{T}$$

which integrates to yield $(\gamma-1)\,\log V = -\log T + \text{const}$ or $T\,V^{\gamma-1} = \text{const}$, where $\gamma=\frac{R}{\tilde{R}}+1$ is called the adiabatic index and is the ratio of the gas's specific heat at constant pressure to the specific heat at constant volume.

  • $\begingroup$ No. See Ed Golla below. For your case 3, PV=nRT does not imply a temperature change. H = U + PV. It is H that stays constant. So if PV increases there is no need for U to change. $\endgroup$
    – Tuntable
    Commented Jun 29, 2020 at 7:40
  • $\begingroup$ @Tuntable I don't think what i've written disagrees with you, does it? The point here is that the ideal gas law doesn't model the internals of the non ideal gas that lead to a heat capacity. It's the "fudge" of adding a heat capacity and the modelling of heat storage in these internals that gives rise to the different constant $\tilde{R}$ and the adiabatic index. And indeed Feynman returns to this same idea in the same source to document one aspect of the historical "demise" of ideal gas law - there are different heat capacities for different gasses. $\endgroup$ Commented Apr 24, 2023 at 0:07

Consider two devices: A gas law demonstration apparatus measures temperature and pressure during compression. This device slowly lowers a piston in a thin walled container, resulting in mostly pressure increase with typically less than one degree of temperature increase. Compare this with a fire syringe, in which a piston in a well insulated container is hammered down, creating a temperature change high enough to ignite cotton.

Explanation: The gas law demonstration apparatus is primarily an isothermal compression device (slow and poorly insulated), and the fire syringe is an adiabatic compression device (fast and well insulated.

A process is adiabatic when the system does not exchange heat with its surroundings. This can happen in two ways - either you can insulate the system so well that the heat transfer is negligible or you can )make the process so fast that there is not enough time for heat exchange (All heat transfer mechanisms - conduction, convection, diffusion and radiation - are time consuming). 

Just how fast a process needs to be to be adiabatic depends on how well the system is insulated. If the system is insulated very well, the adiabatic processes can be a lot slower than when the system is insulated poorly. Even if the system is not insulated at all, there is some timescale below which any process becomes adiabatic. For example, the expansion of an air parcel raising in the atmosphere is approximately adiabatic.

In contrast, isothermal processes are necessarily slow as they require heat transfer to remain at the same temperature which is done by being in thermal equilibrium with some reservoir. A process will be isothermal only if it happens on timescales larger than the timescale required for effective heat transfer.


You need to read about the Joule-Thompson effect in Wikipedia. In an ideal gas there is no temperature change upon compression or expansion. The only gases that come close to being ideal at room temperature are Helium, Hydrogen and Neon. They actually slightly cool on compression and heat on expansion at room temperature. This can be reversed at very low temperatures. Most non-ideal gases such as nitrogen, oxygen and carbon dioxide do heat on compression and cool on expansion. With carbon dioxide having the biggest temperature change for a given pressure change. This Joule-Thompson effect is due mostly to Van der Waal forces between the molecules.

  • $\begingroup$ Exactly, what I was thinking I wish I could rate this higher. Lots of dubious statements about this. The heat is due to the gas being non-Ideal. $\endgroup$
    – Tuntable
    Commented Jun 29, 2020 at 7:38
  • $\begingroup$ So does this mean that the compression stroke of a diesel engine (which compresses air and thereby increases it's temperature to a point at which diesel fuel will ignite) only works because air is a non-ideal gas? $\endgroup$
    – EddyTheB
    Commented Feb 18, 2022 at 10:47

Compression of gas will have inverse relation to volume but direct relation to temperature bcz of molecular collision regardless of effect being exerted by container or piston.


Gay Lussac's law (of pressure–temperature): $P$ is directly proportional to $T$.

When $P$ increases, $T$ also increases. When we compress the gas, pressure increases, which means temperature also increases.

  • 2
    $\begingroup$ "When we compress the gas pressure increases which means temperature also increase" Not necessarily. It depends on how you compress it. $\endgroup$
    – JMac
    Commented Jan 8, 2018 at 14:06