Reaction quotients, equilibrium constants and temperature

For a reaction system at equilibrium, the equilibrium constant is related to the concentrations of reactants and products (equilibrium composition) as shown below. 

Kp = p(C)cp(D)d  
p(A)ap(B)b  
  reaction quotient
If aA(g) + bB(g) cC(g) + dD(g)
and A, B, C and D  are all gases
where a, b, c and d are coefficients in the balanced equation

The magnitude of Kp depends on the temperature. If the temperature of a system at equilibrium is changed, the reaction quotient will no longer equal K, and reaction occurs to re-establish equilibrium. This results in a change in the equilibrium composition. 

If the reaction is endothermicH positive) K is larger at higher temperature.
Increasing T causes net reaction to form products until the expression above is equal to the new K at the higher temperature.

If the reaction is exothermicH negative), K is smaller at higher temperatures.
Increasing T causes net reaction to form reactants until the expression above is equal to the new K at the lower temperature.

Thus the equilibrium composition depends on the temperature because the magnitude of the equilibrium constant depends on the temperature.