text: First write down the equilibrium expression
  This shows that when the acid dissociates, equal amounts of hydrogen ion and anion are produced. The equilibrium concentrations of these three components can be calculated in an ICE table (ICE standing for "initial, change, equilibrium").
  The first row, labelled I, lists the initial conditions: the concentration of acid is C, initially undissociated, so the concentrations of A and H would be zero; y is the initial concentration of added strong acid, such as hydrochloric acid. If strong alkali, such as sodium hydroxide, is added, then y will have a negative sign because alkali removes hydrogen ions from the solution. The second row, labelled C for "change", specifies the changes that occur when the acid dissociates. The acid concentration decreases by an amount −x, and the concentrations of A and H both increase by an amount +x. This follows from the equilibrium expression. The third row, labelled E for "equilibrium", adds together the first two rows and shows the concentrations at equilibrium.
  To find x, use the formula for the equilibrium constant in terms of concentrations:
  Substitute the concentrations with the values found in the last row of the ICE table:
  Simplify to 
  With specific values for C, K and y, this equation can be solved for x. Assuming that pH = −log[H], the pH can be calculated as pH = −log(x + y).