Determining the empirical formula from mass of CO2 and H2O

Compounds containing carbon and hydrogen are combusted to give CO2 and H2O. 

The compound that is combusted is the only source of the carbon in the CO2.

Thus the mass of carbon, m(C) present can be calculated from the mass of CO2m(CO2) as shown below. 

m(CO2) n(CO2 n(C)  m(C)

Note that the calculation depends on the fact that the amount in molesIn(CO2) is equal to the amount in moles n(C) in that mass of CO2. The amount in moles of any substance can be calculated from the mass by dividing by its molar mass.

The compound that is combusted is only source of the hydrogen in H2O.  Thus in a similar calculation the mass of hydrogen in the original compound can be calculated from the mass of H2O.

m(H2O)  n(H2O)  n(H)  m(H)
 
Be sure to take into account the fact that there are two hydrogens per mole of water.

If the compound also contains oxygen, the mass of oxygen can be calculated from the difference in the mass of the compound burned and the mass of the carbon and hydrogen present.