### Theory:

Let us now see an example to understand how to write a chemical formula for a compounds.
Formulae of simple compounds:
The constituent elements and their valencies are written down in the chemical formulae for compounds, as shown below.
The valencies of the combining atoms must be crossed.
1. Formula of Water.

We know the symbol for hydrogen $$H$$ and oxygen $$O$$.

Formula: $$H_2O$$

2. Formula of Hydrogen sulphide.

We know the symbol for hydrogen $$H$$ and sulphide $$S$$.

Formula: $$H_2S$$

3. Formula of Carbon tetrachloride.

We know the symbol for carbon $$C$$ and chlorine $$Cl$$.

Formula: $$CCl_4$$
Note: The ions' charges are also not specified in the chemical formula.
1. Formula of Magnesium chloride:

We know the symbol for magnesium $$Mg$$ and chlorine $$Cl$$.

Formula: $$MgCl_2$$

2. Formula of Aluminium oxide:

We know the symbol for aluminium $$Al$$ and oxygen $$O$$.

Formula: $$Al_2O_3$$

3. Formula of Calcium oxide:

We know the symbol for calcium $$Ca$$ and oxygen $$O$$.

Formula: $$CaO$$
Note: The valencies of the two elements are the same in this case. You could come up with the formula $$Ca_2O_2$$. However, we shorten it to $$CaO$$.
4. Formula of Sodium nitrate:

We know the symbol for sodium $$Na$$ and nitrate $$NO_3$$.

Formula: $$NaNO_3$$

5. Formula of Calcium hydroxide:

We know the symbol for calcium $$Ca$$ and hydroxyl groups $$OH$$.

Formula: $\mathit{Ca}{\left(\mathit{OH}\right)}_{2}$
Note:
• The formula of calcium hydroxide is $\mathit{Ca}{\left(\mathit{OH}\right)}_{2}$ not $$CaOH_2$$. We use brackets when we have two or more of the same ions in the formula. Here it indicates that there are two hydroxyl $$(OH)$$ groups joined to one calcium atom $$Ca$$. And also, remember that brackets are not needed if only one ion is present.
• It's worth noting that the charges on the ions aren't mentioned in the formula.