The equation for respiration is C6H12O6+6O2→6CO2+6H2O+36ATP. The chemical formula for ATP is C10H16N5O13P3. How is this possible, since it violates the law of conservation of mass because it is unbalanced?
The ATP is not actually produced from the respiration. It comes from ADP and free phosphate ions.
The production of ATP in cellular respiration happens in all parts of a series of chain reactions, and you can read more about those here: https://en.wikipedia.org/wiki/Cellular_respiration#Aerobic_respiration