During combustion, when gasoline burns, hydrogen and carbon get separated. Then, oxygen will combine with hydrogen forming water (H2O) and with carbon, forming CO2, carbon dioxide.
The majority of the weight of CO2 comes from the oxygen in the air, not from the gasoline being burned. A gallon of gas only weights approximately 6.3 pounds, but it will produce around 20 pounds of CO2.
The atomic weight of a carbon atom is 12 while the atomic weight of oxygen is 16 and there are two atoms of oxygen in each single molecule of CO2. Each molecule of CO2 has a total atomic weight of 44 (12 from carbon and 32 from oxygen).
So, if we want to calculate the amount of CO2 produced from one gallon of gasoline we need to multiply the weight of the carbon present in the gasoline by 3.7 (44 divided by 12).
Because gasoline contains 87% carbon and 13% hydrogen we know that in one gallon of gasoline there are 5.5 pounds (87% of 6.3 pounds) of carbon.
Finally, if we multiply the weight of the carbon (5.5 pounds) by 3.7 we get the figure of 19.592 pounds of CO2
Note: In our calculations we use 19.592 pounds of CO2 emitted per gallon of gas.