Use two equations,one to describe the laboratory preparation of co2 and the other to confirm the presence of the gas.
Carbon dioxide is produced whenever an acid reacts with a carbonate. This makes carbon dioxide easy to make in the laboratory. Calcium carbonate and hydrochloric acid are usually used because they are cheap and easy to obtain.
CaCO3(s) + 2HCl(aq) → CaCl2(aq) + CO2(g) + H2O(l)
The most effective way to test for CO2 is to bubble the gas through "limewater", a diluted solution of calcium hydroxide (slaked lime). When you bubble carbon dioxide through the solution, it forms a solid precipitate of calcium carbonate – chalk or limestone.
Ca(OH)2 + CO2 → CaCO3 + H2O