A 21.8603 g sample of impure magnesium carbonate was heated to complete decomposition according to the equation

MgCO3(s) → MgO(s) + CO2(g).
After the reaction was complete, the solid residue (consisting of MgO and the original impurities) had a mass of 18.7358 g. Assuming that only the magnesium carbonate had decomposed, how much magnesium carbonate was present in the original sample?
Answer in units of g

MgCO3(s) → MgO(s) + CO2(g)

So the loss in mass is due to the evolved CO2.
mass CO2 = 21.8603 - 18.7358 = ?
Convert mass CO2 into mass MgCO3 this way.
mass MgCO3 = mass CO2 x (molar mass MgCO3/molar mass CO2) = ?

To determine the amount of magnesium carbonate present in the original sample, we need to subtract the mass of the residue from the mass of the impure magnesium carbonate before decomposition.

Given:
Mass of impure magnesium carbonate = 21.8603 g
Mass of residue (MgO + impurities) = 18.7358 g

To find the mass of magnesium carbonate before decomposition, we can subtract the mass of the residue from the mass of the impure magnesium carbonate:

Mass of magnesium carbonate before decomposition = Mass of impure magnesium carbonate - Mass of residue

Mass of magnesium carbonate before decomposition = 21.8603 g - 18.7358 g
Mass of magnesium carbonate before decomposition = 3.1245 g

Therefore, there was approximately 3.1245 grams of magnesium carbonate present in the original sample.