finding the average rate of change