The first law of thermodynamics states that the heat energy ($Q$) supplied to a system is equal to the sum of the change in internal energy ($\Delta U$) and the work done ($W$) by the system. It can be represented as:
$$ Q = \Delta U + W $$
All these quantities are expressed in joules ($J$).
In an ideal gas, no forces of attraction act between gas molecules therefore they possess no molecular potential energy. This means that the temperature depends only on the internal energy ($U$) which in turn depends on the kinetic energy of the molecules.
To change the internal energy of a gas, work must be done or heat transfer must occur. For a tube of gas at pressure $p$ in a piston:
An isothermal process is a process that takes place under constant temperature conditions. For an ideal gas, the temperature only depends on the internal energy so $\Delta U = 0$. This results in the heat transfer being equal to the work done:
$$ Q = W $$
In order to maintain a constant temperature when a gas is expanding and doing external work $W$, an equal amount of heat $Q$ must be transferred into the system. For an ideal gas:
$$ pV = \text{constant} $$
Therefore for an isothermal change,
$$ p_{1}V_{1} = p_{2}V_{2} $$
Where $p_{1}$ and $V_{1}$ are the initial pressure ($Pa$) and volume ($m^{3}$) of the gas and $p_{2}$ and $V_{2}$ are the final pressure ($Pa$) and volume ($m^{3}$) of the gas.
An adiabatic process is a process that takes place in such a way that no heat can enter or leave a system. This means that $Q = 0$ so the work done by the system is equal to the loss in internal energy:
$$ W = -\Delta U $$
Therefore if the gas does work, the internal energy decreases and the temperature falls. While a truly adiabatic process is not possible, near adiabatic conditions can be achieved by reducing the volume rapidly or using a very well insulated container.
When an ideal gas undergoes an adiabatic expansion or compression, the adiabatic equation can be used:
$$ pV^{\gamma} = \text{constant} $$
Where $\gamma$ is the adiabatic constant which depends on the molecular structure of the gas. Typical values include $\gamma = 1.67$ for a monatomic gas and $\gamma = 1.40$ for a diatomic gas. For an adiabatic change:
$$ p_{1}V_{1}^{\gamma} = p_{2}V_{2}^{\gamma} $$
Where $p_{1}$ and $V_{1}$ are the initial pressure ($Pa$) and volume ($m^{3}$) of the gas and $p_{2}$ and $V_{2}$ are the final pressure ($Pa$) and volume ($m^{3}$) of the gas.
The ideal gas equation can also be used in order to determine the initial or final temperatures:
$$ \frac{p_{1}V_{1}}{T_{1}} = \frac{p_{2}V_{2}}{T_{2}} $$
Where $T_{1}$ is the initial temperature ($K$) and $T_{2}$ is the final temperature ($K$).
This is a process where the volume is held constant, such as the heating of a gas in a rigid fixed container. If the volume is constant no work can be done so $W = 0$. This means that the heat transfer is equal to the change in internal energy:
$$ \Delta U = Q $$
If heat is absorbed into a system, the internal energy of the system rises.
This is a process where the pressure is held constant, such as when a gas is heated in a cylinder with a movable frictionless piston. As the work done is equal to the pressure multiplied by the change in volume:
$$ W = p\Delta V $$
The first law of thermodynamics can then show that the heat energy supplied to a system is equal to the sum of the change in internal energy and the product of the pressure and change in volume:
$$ Q = \Delta U + p\Delta V $$
A pressure-volume diagram, also known as an indicator diagram is used to show changes to the pressure and volume in thermodynamic cycles. The area under a p-V curve represents the work done on or by a gas. Some p-V diagrams are shown below:
p-V diagrams can be used to show closed thermodynamic cycles whereby a system is taken back to its original state.
Since the area under the expansion curve is greater than the area under the compression curve, the net work done by the gas is positive and is represented by the area between the curves.
In an adiabatic process no heat transfer can occur as $\Delta U = 0$, whereas in an isothermal process the temperature is constant. During an isothermal expansion, heat can be transferred to the gas which increases the pressure. This results in the adiabatic expansion having a steeper curve.
This p-V diagram shows a gas that has been expanded adiabatically then compressed isothermally to its original volume. The area between the curves is the net work done by the gas.