The relationship between atmospheric pressure and density?

The relationship between atmospheric pressure and density?

If the density changes with the height, then do the density integral along the height, and then multiply g to get the pressure