Determining the domain of a function