finding the range of a composite function