Finding the domain of functions