All chemical equations must be balanced. This means that the number of atoms of each element must be same on both sides of the equation.
The following steps must be followed to write an ionic equation:
Write the balanced chemical equation
Separate each compound into its component ions. (This cannot be applied to liquids such as water and solids which are products)
Any ions, which appear on both sides of the equations, should be cancelled.
There are some rules which help to write ionic equations much easily.
For any acid alkali (neutralization) reactions, the products are salt and water. The ionic equation can be written as:
H+ (aq) + OH - (aq) → H2O (l)
It does not matter whether the acid is monobasic such as HCl or HNO3, or dibasic acids such as H2SO4. It also does not matter if the alkali is NaOH or Ca(OH)2.
When two solutions are mixed together and solid precipitate is formed, we call them precipitation reactions. For such reactions, you only write those two ions which make the precipitate.
Let us consider the reaction of hydrochloric acid with silver nitrate. The products are silver chloride and nitric acid. Silver chloride is a precipitate and a solid.
Ag+ (aq) + Cl – (aq) → AgCl (s)
Remember, solid, liquid (water), and gases do not ionize.
But if the reactant is a solid, chemical equation should be written first. Ions would be written in the next line, and common ions which appear on both sides, are cancelled.
Solid magnesium reacts with HCl to produce MgCl2 and H2.
The chemical equation is, Mg(s) + 2HCl(aq) = MgCl2 (aq) + H2 (g).
The ionic equation is, Mg(s) + 2H+ (aq) = Mg 2+ (aq) + H2 (g)
Solid magnesium carbonate reacts with HCl to produce MgCl2, CO2 and H2O.
The chemical equation is, MgCO3(s) + 2HCl(aq) = MgCl2 (aq) + CO2(g) + H2O(l)
The ionic equation is, MgCO3 (s) + 2H+ (aq) = Mg 2+ (aq) + CO2(g) + H2O(l)