When carbon dioxide gas is dissolved in water, it forms carbonic acid (H2CO3). Carbonic acid is a weak acid and partially dissociates into hydrogen ions (H+) and bicarbonate ions (HCO3-). In the presence of barium chloride (BaCl2), the barium ions will react with the bicarbonate ions to form barium carbonate (BaCO3), which is a white, insoluble solid that precipitates out of solution.
The overall reaction can be represented as follows:
CO2 (g) + H2O (l) → H2CO3 (aq)
H2CO3 (aq) → H+ (aq) + HCO3- (aq)
Ba2+ (aq) + HCO3- (aq) → BaCO3 (s) + H+ (aq)