What is the difference between a hydrate and an anhydrate compound?
A hydrate is a compound that has a specific number of water molecules in its structure. The first step in determining the formula of a hydrate is to calculate the mole-to-mole ratio between the water portion and the anhydrate portion of the compound.
Anhydrate is the name given to the substance that remains after the water is removed from a hydrate. This is often done by heating the compound, a process that eliminates that water molecules as steam.
If this is the case, you go about determining the formula by keeping track of the hydrate's original mass and of the mass lost after water was removed. The difference between these two values will give you the mass of the anhydrate.
Video of lab (uses copper sulfate) which allows you to do this...
video from: Noel Pauller
It could be done the other way around, too; you can determine the mass of the removed water by substracting from the hydrate's original mass the mass of the anhydrate.
Once you know the mass of the hydrate and the mass of the water, you go to moles by using molar masses. This will allow you to establish mole ratios between the anhydrate and the water.
Here's a sample problem (you can find more here: http://www.chemteam.info/Mole/Determine-formula-of-hydrate.html)
A 15.67 g sample of a hydrate of magnesium carbonate was heated, without decomposing the carbonate, to drive off the water. The mass was reduced to 7.58 g. What is the formula of the hydrate?
So, you know that heating the compound reduced its mass to 7.58 g, which represents the mass of the anhydrate. The mass of the water is the difference between the hydrate's and the anhydrate's masses:
Now you go to moles. The number of magnesium carbonate and water moles:
Divide both numbers by the smallest one to get the mole ratio:
The pentahydrate is more common, so your formula is probably
Here's a nice video on this I've found on Youtube: