how to write the formula for magnesium phosphate