Finding the domain of a function