When magnesium ribbon is burnt in the presence of oxygen, it forms magnesium oxide. The chemical formula for compound X is MgO.
Mg(s)+ O2(g)Heat−−→MgO(s) + Energy
The reaction of a metal oxide with water results in the formation of a metal hydroxide. So, when the magnesium oxide (X) is dissolved in water, it forms magnesium hydroxide.
The chemical equation for this reaction is:
MgO(s) + H2O(l) →Mg(OH)2(aq)
Since the number of Mg, O, and H atoms is equal on both the sides, the chemical equation is balanced.