The partial pressure of a gas in a mixture is that which it contributes to the total pressure of the mixture. John Dalton's law of partial pressures states: 'The pressure of a gas in a mixture is equal to the pressure it would exert if it occupied the same volume alone at the same temperature.' A consequence of this is that the total pressure of a mixture at equilibrium is equal to the sum of partial pressures of the gases present. For example, given the reaction:
N2 + 3H2 <-> 2NH3

The total pressure is equal to the sum of the individual partial pressures of the gases in the mixture:
P = PN2 + PH2 + PNH3

Where P is the total pressure of the mixture and Px denotes the partial pressure of x.

If the volume of the container is decreased the total pressure of the gases increases. Because the reaction is reversible, the equilibrium position shifts to the side of the reaction with the least moless (in this case the product side, on the right). By Le Chatelier's Principle, this has the effect of increasing the fraction of the whole pressure available to the products, and decreasing the fraction available to the reactants (because there is more moles of reactant than product). The composition of the gases change so more ammonia is present. Similarly, changing the temperature of the system causes more reactants to be produced (because the reverse reaction is endothermic.)

The partial pressure of a gas is proportional to its mole fraction, which is a measure of concentration. This means that it is possible to work out the equilibrium constant for an equilibrium reaction involving a mixture of gases given the partial pressure of each and the chemical formula for the reaction. The equlibrium constant for gases is denoted KP. For a reaction:

aA + bB <-> cC + dD

So the equilibrium constant, KP can be calculated with,
KP = (PCc + PDd) / (PAa + PBb)

Although the composition of the gases change when the container is compressed, the equilibrium remains the same (assuming the temperature also remains constant).

See also: Pressure -- Chemical equilibrium