The phosphate groups in an ATP molecule are joined forming an ester group. Esters can be formed when an alcohol (-OH) bonds with an acid (-COOH, or, in the case of phosphoric acid, ). When this bonding occurs, the two molecules together lose a molecule of water, because the alcohol loses the hydroxyl and the acid loses an hydrogen, and the three atoms combine to form water. All the chemical bonds that are formed with the loss of a water molecule can also be broken using water, and this reaction is called hydrolysis.
The chemical formula of a compound is a representation which shows all the elements therein and the mole relationship between them expressed as subscripts.