Calculate two point correlation functions in cosmology