how to find range of a function