Determining if a function has a constant rate of change